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

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

MaxGekk commented on code in PR #42018:
URL: https://github.com/apache/spark/pull/42018#discussion_r1285193239


##########
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:
   @Hisoka-X Could you explain, please, why did introduce new exception and why cannot you re-use the existing one.



##########
common/utils/src/main/resources/error/error-classes.json:
##########
@@ -1900,6 +1900,11 @@
           "Parsing JSON arrays as structs is forbidden."
         ]
       },
+      "CANNOT_PARSE_STRING_AS_DATATYPE" : {
+        "message" : [
+          "Cannot parse field name <fieldName>, field value <fieldValue>, [<token>] as target spark data type [<dataType>]."

Review Comment:
   ```suggestion
             "Cannot parse the value <fieldValue> of the field <fieldName> as target spark data type <targetType> from the input type <inputType>."
   ```



-- 
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