From a91784fb6e47e2f72551e2379731e0a36fda9d04 Mon Sep 17 00:00:00 2001
From: Rekha Joshi <rekhajoshm@gmail.com>
Date: Sat, 26 Mar 2016 12:53:37 +0000
Subject: [PATCH] [SPARK-13973][PYSPARK] ipython notebook` is going away

## What changes were proposed in this pull request?
https://issues.apache.org/jira/browse/SPARK-13973

## How was this patch tested?
Pyspark

Author: Rekha Joshi <rekhajoshm@gmail.com>
Author: Joshi <rekhajoshm@gmail.com>

Closes #11829 from rekhajoshm/SPARK-13973.
---
 bin/pyspark | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/bin/pyspark b/bin/pyspark
index 6962f4577d..a25749964e 100755
--- a/bin/pyspark
+++ b/bin/pyspark
@@ -49,7 +49,11 @@ if [[ -n "$IPYTHON_OPTS" || "$IPYTHON" == "1" ]]; then
   # If IPython options are specified, assume user wants to run IPython
   # (for backwards-compatibility)
   PYSPARK_DRIVER_PYTHON_OPTS="$PYSPARK_DRIVER_PYTHON_OPTS $IPYTHON_OPTS"
-  PYSPARK_DRIVER_PYTHON="ipython"
+  if [ -x "$(command -v jupyter)" ]; then
+    PYSPARK_DRIVER_PYTHON="jupyter"
+  else
+    PYSPARK_DRIVER_PYTHON="ipython"
+  fi
 elif [[ -z "$PYSPARK_DRIVER_PYTHON" ]]; then
   PYSPARK_DRIVER_PYTHON="${PYSPARK_PYTHON:-"$DEFAULT_PYTHON"}"
 fi
-- 
GitLab