HyukjinKwon commented on a change in pull request #34219:
URL: https://github.com/apache/spark/pull/34219#discussion_r724688775



##########
File path: python/pyspark/sql/utils.py
##########
@@ -78,31 +103,34 @@ class UnknownException(CapturedException):
 
 
 def convert_exception(e):
-    s = e.toString()
     c = e.getCause()
-    stacktrace = 
SparkContext._jvm.org.apache.spark.util.Utils.exceptionString(e)
-
-    if s.startswith('org.apache.spark.sql.AnalysisException: '):
-        return AnalysisException(s.split(': ', 1)[1], stacktrace, c)
-    if s.startswith('org.apache.spark.sql.catalyst.analysis'):

Review comment:
       This was added to capture inherited classes of `AnalysisException` at 
https://github.com/apache/spark/commit/ef7a5e0bcaee45b907a10b73f11c838ef6e23614.
 Now it works without this since it can capture by `isInstanceOf`.

##########
File path: python/pyspark/sql/utils.py
##########
@@ -78,31 +103,34 @@ class UnknownException(CapturedException):
 
 
 def convert_exception(e):
-    s = e.toString()
     c = e.getCause()
-    stacktrace = 
SparkContext._jvm.org.apache.spark.util.Utils.exceptionString(e)
-
-    if s.startswith('org.apache.spark.sql.AnalysisException: '):
-        return AnalysisException(s.split(': ', 1)[1], stacktrace, c)
-    if s.startswith('org.apache.spark.sql.catalyst.analysis'):

Review comment:
       cc @gatorsmile 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to