diff --git a/bin/pyspark b/bin/pyspark index ed6f8da73035a..5a12516d70740 100755 --- a/bin/pyspark +++ b/bin/pyspark @@ -58,7 +58,8 @@ if [ -n "$IPYTHON_OPTS" ]; then IPYTHON=1 fi -if [[ "$IPYTHON" = "1" ]] ; then +# Only use ipython if no command line arguments were provided [SPARK-1134] +if [[ "$IPYTHON" = "1" && $# = 0 ]] ; then exec ipython $IPYTHON_OPTS else exec "$PYSPARK_PYTHON" "$@"