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 <dataType>."
     ]
   },
-  "_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 <dataType>."
     ]
   },
-  "_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 <dataType>."
     ]
   },
-  "_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 <value> (class of <valueClass>}) with the type 
of <dataType> to JSON."
-    ]
+      "Invalid JSON conversion."
+    ],
+    "subClass" : {
+      "UNSUPPORTED_VALUE_TYPE" : {
+        "message" : [
+          "Failed to convert value <value> (class of <valueClass>}) with the 
type of <dataType> to JSON."

Review Comment:
   ```suggestion
             "Failed to convert the row value <value> of the class <class> to 
the target SQL type <sqlType> 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 <dataType>."
     ]
   },
-  "_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 <dataType>."
     ]
   },
-  "_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 <value> (class of <valueClass>}) with the type 
of <dataType> to JSON."
-    ]
+      "Invalid JSON conversion."
+    ],
+    "subClass" : {
+      "UNSUPPORTED_VALUE_TYPE" : {

Review Comment:
   The sub-class is too much for the case, I believe. Let's inline the error 
message to parent's message.



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

Reply via email to