MaxGekk commented on code in PR #38754:
URL: https://github.com/apache/spark/pull/38754#discussion_r1033344766
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/types/DataType.scala:
##########
@@ -160,8 +157,8 @@ object DataType {
try {
fallbackParser(schema)
} catch {
- case NonFatal(e2) =>
- throw QueryCompilationErrors.failedFallbackParsingError(errorMsg,
e1, e2)
+ case NonFatal(_) =>
Review Comment:
Could you catch `SparkThrowable`, and re-throw it.
##########
sql/core/src/test/resources/sql-tests/results/csv-functions.sql.out:
##########
@@ -43,11 +43,10 @@ struct<>
-- !query output
org.apache.spark.sql.AnalysisException
{
- "errorClass" : "_LEGACY_ERROR_TEMP_1227",
+ "errorClass" : "INVALID_SCHEMA.PARSE_ERROR",
"messageParameters" : {
- "e1" : "\n[PARSE_SYNTAX_ERROR] Syntax error at or near 'InvalidType':
extra input 'InvalidType'(line 1, pos 2)\n\n== SQL ==\na InvalidType\n--^^^\n",
- "e2" : "\nDataType invalidtype is not supported.(line 1, pos 2)\n\n== SQL
==\na InvalidType\n--^^^\n",
- "msg" : "Cannot parse the data type: "
+ "inputSchema" : "\"a InvalidType\"",
+ "reason" : "\n[PARSE_SYNTAX_ERROR] Syntax error at or near 'InvalidType':
extra input 'InvalidType'(line 1, pos 2)\n\n== SQL ==\na InvalidType\n--^^^\n"
Review Comment:
Let's bypass `SparkThrowable` to users. I don't think the wrapping is useful.
--
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]