Skip to content

Commit 1878c70

Browse files
committed
[SPARK-12120][PYSPARK] Improve exception message when failing to initialize HiveContext in PySpark
1 parent d0d7ec5 commit 1878c70

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

python/pyspark/sql/context.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -686,9 +686,10 @@ def _ssql_ctx(self):
686686
self._scala_HiveContext = self._get_hive_ctx()
687687
return self._scala_HiveContext
688688
except Py4JError as e:
689-
raise Exception("You must build Spark with Hive. "
690-
"Export 'SPARK_HIVE=true' and run "
691-
"build/sbt assembly", e)
689+
warnings.warn("You must build Spark with Hive. "
690+
"Export 'SPARK_HIVE=true' and run "
691+
"build/sbt assembly")
692+
raise e
692693

693694
def _get_hive_ctx(self):
694695
return self._jvm.HiveContext(self._jsc.sc())

0 commit comments

Comments
 (0)