diff options
author | Davies Liu <davies@databricks.com> | 2015-06-30 16:17:46 -0700 |
---|---|---|
committer | Davies Liu <davies@databricks.com> | 2015-06-30 16:17:46 -0700 |
commit | 58ee2a2e47948a895e557fbcabbeadb31f0a1022 (patch) | |
tree | 86d79553be2fd7df6b7afe2b226bb40ede319725 /python/pyspark/sql/context.py | |
parent | d2495f7cc7d7caaa50d122d2969ddb693e6ecebd (diff) | |
download | spark-58ee2a2e47948a895e557fbcabbeadb31f0a1022.tar.gz spark-58ee2a2e47948a895e557fbcabbeadb31f0a1022.tar.bz2 spark-58ee2a2e47948a895e557fbcabbeadb31f0a1022.zip |
[SPARK-8738] [SQL] [PYSPARK] capture SQL AnalysisException in Python API
Capture the AnalysisException in SQL, hide the long java stack trace, only show the error message.
cc rxin
Author: Davies Liu <davies@databricks.com>
Closes #7135 from davies/ananylis and squashes the following commits:
dad7ae7 [Davies Liu] add comment
ec0c0e8 [Davies Liu] Update utils.py
cdd7edd [Davies Liu] add doc
7b044c2 [Davies Liu] fix python 3
f84d3bd [Davies Liu] capture SQL AnalysisException in Python API
Diffstat (limited to 'python/pyspark/sql/context.py')
-rw-r--r-- | python/pyspark/sql/context.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/python/pyspark/sql/context.py b/python/pyspark/sql/context.py index 4dda3b430c..4bf232111c 100644 --- a/python/pyspark/sql/context.py +++ b/python/pyspark/sql/context.py @@ -33,6 +33,7 @@ from pyspark.sql.types import Row, StringType, StructType, _verify_type, \ _infer_schema, _has_nulltype, _merge_type, _create_converter, _python_to_sql_converter from pyspark.sql.dataframe import DataFrame from pyspark.sql.readwriter import DataFrameReader +from pyspark.sql.utils import install_exception_handler try: import pandas @@ -96,6 +97,7 @@ class SQLContext(object): self._jvm = self._sc._jvm self._scala_SQLContext = sqlContext _monkey_patch_RDD(self) + install_exception_handler() @property def _ssql_ctx(self): |