srielau commented on code in PR #43438:
URL: https://github.com/apache/spark/pull/43438#discussion_r1365531762


##########
common/utils/src/main/scala/org/apache/spark/SparkThrowableHelper.scala:
##########
@@ -51,9 +51,11 @@ private[spark] object SparkThrowableHelper {
       messageParameters: Map[String, String],
       context: String): String = {
     val displayMessage = errorReader.getErrorMessage(errorClass, 
messageParameters)
+    val sqlState = errorReader.getSqlState(errorClass)
+    val displaySqlState = if (sqlState == null) "" else s" SQLSTATE: $sqlState"
     val displayQueryContext = (if (context.isEmpty) "" else "\n") + context
     val prefix = if (errorClass.startsWith("_LEGACY_ERROR_")) "" else 
s"[$errorClass] "
-    s"$prefix$displayMessage$displayQueryContext"
+    s"$prefix$displayMessage$displaySqlState$displayQueryContext"

Review Comment:
   I disagree. SQLSTATE does not help you read the message. It's 5 random 
alpha-numeric.



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