I wrote this launcher script a while ago for this purpose. I wanted to be able to interact with the pyspark shell from the bpython (1) code completion interpreter and the WING IDE , or any IDE, if so, because they have code and also provide a complete development experience. Learning the Spark core by simply typing "pyspark" is not enough. So I wrote this. It was written in the Cloudera CDH5 environment, but with a little tweaking you can make it work regardless of your environment (even manually installed).
How to use:
NOTE: You can place all of the following in your .profile (or equivalent). (1) linux$ export MASTER='yarn-client | local[NN] | spark://host:port' (2) linux$ export SPARK_HOME=/usr/lib/spark
Now for use with the IDE, you simply determine how to specify the equivalent PYTHONSTARTUP script for this IDE, and set it to '/ path / to / script / below'. For example, as I described in the comments below, for the WING IDE, you simply set the key / value pair “PYTHONSTARTUP = / path / to / script / below” inside the project properties section.
See comments on line for more information.
#! /usr/bin/env python
Enjoy and good luck! = :)
prismalytics.io Feb 07 '15 at 8:37 2015-02-07 08:37
source share