如何Pyspark运行脚本,完成后拖放到IPython的壳呢? [英] How to run script in Pyspark and drop into IPython shell when done?
本文介绍了如何Pyspark运行脚本,完成后拖放到IPython的壳呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想运行一个脚本火花拖放到一个IPython的外壳交互检查数据。
I want to run a spark script and drop into an IPython shell to interactively examine data.
同时运行:
$ IPYTHON=1 pyspark --master local[2] myscript.py
和
$ IPYTHON=1 spark-submit --master local[2] myscript.py
这两个口出IPython的的一次。
both exit out of IPython once done.
这看起来很简单,但怎么也找不到任何地方做。
This seems really simple, but can't find how to do it anywhere.
推荐答案
如果您启动IPython的壳:
If you launch the iPython shell with:
$ IPYTHON=1 pyspark --master local[2]
你可以这样做:
>>> %run myscript.py
和所有变量将留在工作区中。您还可以通过用一步一步进行调试:
and all variables will stay in the workspace. You can also debug step by step with:
>>> %run -d myscript.py
这篇关于如何Pyspark运行脚本,完成后拖放到IPython的壳呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文