panbingkun commented on code in PR #44902:
URL: https://github.com/apache/spark/pull/44902#discussion_r1568665548


##########
core/src/test/scala/org/apache/spark/SparkThrowableSuite.scala:
##########
@@ -125,23 +128,26 @@ class SparkThrowableSuite extends SparkFunSuite {
       s"Error classes without SQLSTATE: ${errorClassesNoSqlState.mkString(", 
")}")
   }
 
-  test("Error category and error state / SQLSTATE invariants") {
-    val errorCategoriesJson = 
Utils.getSparkClassLoader.getResource("error/error-categories.json")
+  test("Error class and error state / SQLSTATE invariants") {
+    // Unlike in the rest of the codebase, the term "error class" is used here 
as it is in our
+    // documentation as well as in the SQL standard. We can remove this 
comment as part of this
+    // ticket: https://issues.apache.org/jira/browse/SPARK-47429
+    val errorClassesJson = 
Utils.getSparkClassLoader.getResource("error/error-classes.json")
     val errorStatesJson = 
Utils.getSparkClassLoader.getResource("error/error-states.json")
     val mapper = JsonMapper.builder()
       .addModule(DefaultScalaModule)
       .enable(STRICT_DUPLICATE_DETECTION)
       .build()
-    val errorCategories = mapper.readValue(
-      errorCategoriesJson, new TypeReference[Map[String, String]]() {})
+    val errorClasses = mapper.readValue(
+      errorClassesJson, new TypeReference[Map[String, String]]() {})
     val errorStates = mapper.readValue(
       errorStatesJson, new TypeReference[Map[String, ErrorStateInfo]]() {})
-    val errorClassStates = 
errorReader.errorInfoMap.values.toSeq.flatMap(_.sqlState).toSet
+    val errorConditionStates = 
errorReader.errorInfoMap.values.toSeq.flatMap(_.sqlState).toSet

Review Comment:
   Perhaps calling `errorStates` would better align with the the `file` name ?
   `error/error-classes.json` -> `errorClasses`
   `error/error-states.json` -> `errorStates`



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to