Re: [PR] [WIP][SPARK-47255][SQL] Assign names to the error classes _LEGACY_ERROR_TEMP_324[7-9] [spark]

2024-03-08 Thread via GitHub


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


##
sql/api/src/main/scala/org/apache/spark/sql/Row.scala:
##
@@ -611,7 +611,7 @@ trait Row extends Serializable {
   case (v: Any, udt: UserDefinedType[Any @unchecked]) =>
 toJson(UDTUtils.toRow(v, udt), udt.sqlType)
   case _ => throw new SparkIllegalArgumentException(
-errorClass = "_LEGACY_ERROR_TEMP_3249",
+errorClass = "JSON_CONVERSION_ERROR.UNSUPPORTED_VALUE_TYPE",

Review Comment:
   Please, quote `dataType` by `toSQLType`, and `value` by `toSQLValue`



-- 
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-unsubscr...@spark.apache.org

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


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



Re: [PR] [WIP][SPARK-47255][SQL] Assign names to the error classes _LEGACY_ERROR_TEMP_324[7-9] [spark]

2024-03-08 Thread via GitHub


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


##
common/utils/src/main/resources/error/error-classes.json:
##
@@ -7822,20 +7822,34 @@
   "Failed to parse a value for data type ."
 ]
   },
-  "_LEGACY_ERROR_TEMP_3247" : {
+  "INVALID_DELIMITER_VALUE" : {
 "message" : [
-  "Delimiter cannot be empty string"
-]
-  },
-  "_LEGACY_ERROR_TEMP_3248" : {
-"message" : [
-  "Single backslash is prohibited. It has special meaning as beginning of 
an escape sequence. To get the backslash character, pass a string with two 
backslashes as the delimiter."
-]
+  "Invalid value for delimiter"
+],
+"subClass" : {
+  "EMPTY_STRING": {
+"message" : [
+  "Delimiter cannot be empty string"

Review Comment:
   ```suggestion
 "Delimiter cannot be empty string."
   ```



##
common/utils/src/main/resources/error/error-classes.json:
##
@@ -7822,20 +7822,34 @@
   "Failed to parse a value for data type ."
 ]
   },
-  "_LEGACY_ERROR_TEMP_3247" : {
+  "INVALID_DELIMITER_VALUE" : {
 "message" : [
-  "Delimiter cannot be empty string"
-]
-  },
-  "_LEGACY_ERROR_TEMP_3248" : {
-"message" : [
-  "Single backslash is prohibited. It has special meaning as beginning of 
an escape sequence. To get the backslash character, pass a string with two 
backslashes as the delimiter."
-]
+  "Invalid value for delimiter"
+],
+"subClass" : {
+  "EMPTY_STRING": {
+"message" : [
+  "Delimiter cannot be empty string"
+]
+  },
+  "SINGLE_BACKSLASH": {
+"message" : [
+  "Single backslash is prohibited. It has special meaning as beginning 
of an escape sequence. To get the backslash character, pass a string with two 
backslashes as the delimiter."
+]
+  }
+}
   },
-  "_LEGACY_ERROR_TEMP_3249" : {
+  "JSON_CONVERSION_ERROR" : {

Review Comment:
   Let's assign more specific name to it: `FAILED_ROW_TO_JSON`



##
common/utils/src/main/resources/error/error-classes.json:
##
@@ -7822,20 +7822,34 @@
   "Failed to parse a value for data type ."
 ]
   },
-  "_LEGACY_ERROR_TEMP_3247" : {
+  "INVALID_DELIMITER_VALUE" : {
 "message" : [
-  "Delimiter cannot be empty string"
-]
-  },
-  "_LEGACY_ERROR_TEMP_3248" : {
-"message" : [
-  "Single backslash is prohibited. It has special meaning as beginning of 
an escape sequence. To get the backslash character, pass a string with two 
backslashes as the delimiter."
-]
+  "Invalid value for delimiter"
+],
+"subClass" : {
+  "EMPTY_STRING": {
+"message" : [
+  "Delimiter cannot be empty string"
+]
+  },
+  "SINGLE_BACKSLASH": {
+"message" : [
+  "Single backslash is prohibited. It has special meaning as beginning 
of an escape sequence. To get the backslash character, pass a string with two 
backslashes as the delimiter."
+]
+  }
+}
   },
-  "_LEGACY_ERROR_TEMP_3249" : {
+  "JSON_CONVERSION_ERROR" : {
 "message" : [
-  "Failed to convert value  (class of }) with the type 
of  to JSON."
-]
+  "Invalid JSON conversion."
+],
+"subClass" : {
+  "UNSUPPORTED_VALUE_TYPE" : {
+"message" : [
+  "Failed to convert value  (class of }) with the 
type of  to JSON."

Review Comment:
   ```suggestion
 "Failed to convert the row value  of the class  to 
the target SQL type  in the JSON format."
   ```



##
common/utils/src/main/resources/error/error-classes.json:
##
@@ -7822,20 +7822,34 @@
   "Failed to parse a value for data type ."
 ]
   },
-  "_LEGACY_ERROR_TEMP_3247" : {
+  "INVALID_DELIMITER_VALUE" : {
 "message" : [
-  "Delimiter cannot be empty string"
-]
-  },
-  "_LEGACY_ERROR_TEMP_3248" : {
-"message" : [
-  "Single backslash is prohibited. It has special meaning as beginning of 
an escape sequence. To get the backslash character, pass a string with two 
backslashes as the delimiter."
-]
+  "Invalid value for delimiter"

Review Comment:
   ```suggestion
 "Invalid value for delimiter."
   ```



##
common/utils/src/main/resources/error/error-classes.json:
##
@@ -7822,20 +7822,34 @@
   "Failed to parse a value for data type ."
 ]
   },
-  "_LEGACY_ERROR_TEMP_3247" : {
+  "INVALID_DELIMITER_VALUE" : {
 "message" : [
-  "Delimiter cannot be empty string"
-]
-  },
-  "_LEGACY_ERROR_TEMP_3248" : {
-"message" : [
-  "Single backslash is prohibited. It has special meaning as beginning of 
an escape sequence. To get the backslash character, pass a string with two 
backslashes as the delimiter."
-]
+  "Invalid value for delimiter"
+],
+"subClass" : {
+  "EMPTY_STRING": {
+"message" : [
+  "Delimiter cannot be empty string"
+]
+ 

Re: [PR] [WIP][SPARK-47255][SQL] Assign names to the error classes _LEGACY_ERROR_TEMP_324[7-9] [spark]

2024-03-08 Thread via GitHub


miland-db commented on PR #45423:
URL: https://github.com/apache/spark/pull/45423#issuecomment-1985380767

   I corrected the title, and I am attaching the JIRA link: 
https://issues.apache.org/jira/browse/SPARK-47255


-- 
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-unsubscr...@spark.apache.org

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


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