我使用这个命令来运行scala脚本。
spark-shell -i test.scala在脚本执行结束时,我仍然看到spark-shell正在运行。
我在test.scala脚本中使用了":q/:quit“来尝试退出,但它不起作用。
发布于 2016-03-17 16:06:55
您需要在脚本的末尾添加exit(),以避免陷入scala REPL。
Helloworld.scala
print("Hello World");
print("Second Line");
print("Bye now");
exit()在上面运行
spark-shell -i helloworld.scala发布于 2020-02-12 08:56:18
我也喜欢another question上提供的echo :quit | spark-shell ...答案。
发布于 2020-05-07 08:17:00
在版本2.4.3中,System.exit(0)正常工作。
https://stackoverflow.com/questions/36054145
复制相似问题