From 986a24fab27e258f263590a2e55cb88c0f8a662a Mon Sep 17 00:00:00 2001 From: Jeff Zhang Date: Mon, 29 Aug 2016 11:36:51 +0800 Subject: [PATCH] [SPARK-17261][PYSPARK] Using HiveContext after re-creating SparkContext in Spark 2.0 throws "Java.lang.illegalStateException: Cannot call methods on a stopped sparkContext" --- python/pyspark/sql/session.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python/pyspark/sql/session.py b/python/pyspark/sql/session.py index 61fa107497c6..8418abf99c8d 100644 --- a/python/pyspark/sql/session.py +++ b/python/pyspark/sql/session.py @@ -595,6 +595,7 @@ def stop(self): """Stop the underlying :class:`SparkContext`. """ self._sc.stop() + SparkSession._instantiatedContext = None @since(2.0) def __enter__(self):