You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "Hisoka-X (via GitHub)" <gi...@apache.org> on 2023/08/06 11:59:17 UTC

[GitHub] [spark] Hisoka-X commented on a diff in pull request #42018: [SPARK-42321][SQL] Assign name to _LEGACY_ERROR_TEMP_2133

Hisoka-X commented on code in PR #42018:
URL: https://github.com/apache/spark/pull/42018#discussion_r1285208116


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/json/JacksonParser.scala:
##########
@@ -231,8 +231,8 @@ class JacksonParser(
               Float.PositiveInfinity
             case "-INF" | "-Infinity" if options.allowNonNumericNumbers =>
               Float.NegativeInfinity
-            case _ => throw QueryExecutionErrors.cannotParseStringAsDataTypeError(
-              parser, VALUE_STRING, FloatType)
+            case _ => throw StringAsDataTypeException(parser.getCurrentName, parser.getText,

Review Comment:
   Throw `StringAsDataTypeException`  then recatch it in `FailureSafeParser` to make sure can throw  `CANNOT_PARSE_STRING_AS_DATATYPE` normally. Just like we do in https://github.com/apache/spark/pull/40632. Before this PR, the `CANNOT_PARSE_STRING_AS_DATATYPE` can't be throwed.
   
   Before this PR, it will throw
   ```scala
   Caused by: org.apache.spark.SparkException: [MALFORMED_RECORD_IN_PARSING.WITHOUT_SUGGESTION] Malformed records are detected in record parsing: [null].
   Parse Mode: FAILFAST. To process malformed records as null result, try setting the option 'mode' as 'PERMISSIVE'. 
   ```
   



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org