karenfeng commented on a change in pull request #32850:
URL: https://github.com/apache/spark/pull/32850#discussion_r649275213



##########
File path: core/src/main/resources/error/error-classes.json
##########
@@ -0,0 +1,22 @@
+{
+  "DIVIDE_BY_ZERO_ERROR" : {
+    "sqlState" : "22012",
+    "messageFormatLines" : [ "divide by zero" ]
+  },
+  "DUPLICATE_KEY_ERROR" : {
+    "sqlState" : "23000",
+    "messageFormatLines" : [ "Found duplicate keys '%s'" ]
+  },
+  "MISSING_COLUMN_ERROR" : {
+    "sqlState" : "42000",
+    "messageFormatLines" : [ "cannot resolve '%s' given input columns: [%s]" ]
+  },
+  "SECOND_FUNCTION_ARGUMENT_NOT_INTEGER_ERROR" : {
+    "sqlState" : "22023",
+    "messageFormatLines" : [ "The second argument of '%s' function needs to be 
an integer." ]
+  },
+  "WRITING_JOB_ABORTED_ERROR" : {
+    "sqlState" : "40000",
+    "messageFormatLines" : [ "Writing job aborted" ]
+  }
+}

Review comment:
       Not necessarily; `sqlState` can be re-used, especially for common error 
classes without known subclasses, like `42000` (syntax or semantic error). In 
those cases, the error class will be the disambiguator.




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

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