aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorPatrick Wendell <pwendell@gmail.com>2014-01-09 20:29:51 -0800
committerPatrick Wendell <pwendell@gmail.com>2014-01-09 20:29:51 -0800
commit300eaa994c399a0c991c1e39b4dd864a7aa4bdc6 (patch)
treebbc423ab189d43a809dd7b082cfc8fb00a60e2fe /bin
parent4b074fac054848ebd3397a3cce0a3e7871d3860c (diff)
parent77ca9e1ba845c8cbb1566f803b591f6a826b0f1d (diff)
downloadspark-300eaa994c399a0c991c1e39b4dd864a7aa4bdc6.tar.gz
spark-300eaa994c399a0c991c1e39b4dd864a7aa4bdc6.tar.bz2
spark-300eaa994c399a0c991c1e39b4dd864a7aa4bdc6.zip
Merge pull request #353 from pwendell/ipython-simplify
Simplify and fix pyspark script. This patch removes compatibility for IPython < 1.0 but fixes the launch script and makes it much simpler. I tested this using the three commands in the PySpark documentation page: 1. IPYTHON=1 ./pyspark 2. IPYTHON_OPTS="notebook" ./pyspark 3. IPYTHON_OPTS="notebook --pylab inline" ./pyspark There are two changes: - We rely on PYTHONSTARTUP env var to start PySpark - Removed the quotes around $IPYTHON_OPTS... having quotes gloms them together as a single argument passed to `exec` which seemed to cause ipython to fail (it instead expects them as multiple arguments).
Diffstat (limited to 'bin')
-rwxr-xr-xbin/pyspark7
1 files changed, 1 insertions, 6 deletions
diff --git a/bin/pyspark b/bin/pyspark
index d6810f4686..ed6f8da730 100755
--- a/bin/pyspark
+++ b/bin/pyspark
@@ -59,12 +59,7 @@ if [ -n "$IPYTHON_OPTS" ]; then
fi
if [[ "$IPYTHON" = "1" ]] ; then
- # IPython <1.0.0 doesn't honor PYTHONSTARTUP, while 1.0.0+ does.
- # Hence we clear PYTHONSTARTUP and use the -c "%run $IPYTHONSTARTUP" command which works on all versions
- # We also force interactive mode with "-i"
- IPYTHONSTARTUP=$PYTHONSTARTUP
- PYTHONSTARTUP=
- exec ipython "$IPYTHON_OPTS" -i -c "%run $IPYTHONSTARTUP"
+ exec ipython $IPYTHON_OPTS
else
exec "$PYSPARK_PYTHON" "$@"
fi