diff options
-rw-r--r-- | python/pyspark/sql/context.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/python/pyspark/sql/context.py b/python/pyspark/sql/context.py index 91e27cf16e..7f6fb410ab 100644 --- a/python/pyspark/sql/context.py +++ b/python/pyspark/sql/context.py @@ -15,6 +15,7 @@ # limitations under the License. # +from __future__ import print_function import sys import warnings import json @@ -571,9 +572,10 @@ class HiveContext(SQLContext): self._scala_HiveContext = self._get_hive_ctx() return self._scala_HiveContext except Py4JError as e: - raise Exception("You must build Spark with Hive. " - "Export 'SPARK_HIVE=true' and run " - "build/sbt assembly", e) + print("You must build Spark with Hive. " + "Export 'SPARK_HIVE=true' and run " + "build/sbt assembly", file=sys.stderr) + raise def _get_hive_ctx(self): return self._jvm.HiveContext(self._jsc.sc()) |