You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/05/26 01:08:56 UTC

[GitHub] [spark] panbingkun opened a new pull request, #36676: [SPARK-38700][SQL][3.3] Use error classes in the execution errors of save mode

panbingkun opened a new pull request, #36676:
URL: https://github.com/apache/spark/pull/36676

   ### What changes were proposed in this pull request?
   Migrate the following errors in QueryExecutionErrors:
    
   * unsupportedSaveModeError -> UNSUPPORTED_SAVE_MODE
   
   ### Why are the changes needed?
   Porting execution errors of unsupported saveMode to new error framework.
    
   ### Does this PR introduce _any_ user-facing change?
   No
   
   ### How was this patch tested?
   Add new UT.


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

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


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


[GitHub] [spark] panbingkun commented on pull request #36676: [SPARK-38700][SQL][3.3] Use error classes in the execution errors of save mode

Posted by GitBox <gi...@apache.org>.
panbingkun commented on PR #36676:
URL: https://github.com/apache/spark/pull/36676#issuecomment-1153032032

   ping @MaxGekk, I have finished it


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

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


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


[GitHub] [spark] MaxGekk commented on a diff in pull request #36676: [SPARK-38700][SQL][3.3] Use error classes in the execution errors of save mode

Posted by GitBox <gi...@apache.org>.
MaxGekk commented on code in PR #36676:
URL: https://github.com/apache/spark/pull/36676#discussion_r895141657


##########
core/src/main/scala/org/apache/spark/ErrorInfo.scala:
##########
@@ -61,13 +77,25 @@ private[spark] object SparkThrowableHelper {
       queryContext: String = ""): String = {
     val errorInfo = errorClassToInfoMap.getOrElse(errorClass,
       throw new IllegalArgumentException(s"Cannot find error class '$errorClass'"))
+    val (displayClass, displayMessageParameters, displayFormat) = if (errorInfo.subClass.isEmpty) {
+      (errorClass, messageParameters, errorInfo.messageFormat)
+    } else {
+      val subClass = errorInfo.subClass.get
+      val subErrorClass = messageParameters.head
+      val errorSubInfo = subClass.getOrElse(subErrorClass,
+        throw new IllegalArgumentException(s"Cannot find sub error class '$subErrorClass'"))
+      (errorClass + "." + subErrorClass, messageParameters.tail,
+        errorInfo.messageFormat + " " + errorSubInfo.messageFormat)
+    }
+    val displayMessage = String.format(
+      displayFormat.replaceAll("<[a-zA-Z0-9_-]+>", "%s"),
+      displayMessageParameters : _*)
     val displayQueryContext = if (queryContext.isEmpty) {

Review Comment:
   Could you not include the changes into the PR. If you you changes strongly require them, let's don't backport it.



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

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


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


[GitHub] [spark] panbingkun commented on pull request #36676: [SPARK-38700][SQL][3.3] Use error classes in the execution errors of save mode

Posted by GitBox <gi...@apache.org>.
panbingkun commented on PR #36676:
URL: https://github.com/apache/spark/pull/36676#issuecomment-1138033400

   master branch pr: https://github.com/apache/spark/pull/36350
   @MaxGekk ping


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

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


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


[GitHub] [spark] panbingkun commented on a diff in pull request #36676: [SPARK-38700][SQL][3.3] Use error classes in the execution errors of save mode

Posted by GitBox <gi...@apache.org>.
panbingkun commented on code in PR #36676:
URL: https://github.com/apache/spark/pull/36676#discussion_r895178269


##########
core/src/main/scala/org/apache/spark/ErrorInfo.scala:
##########
@@ -61,13 +77,25 @@ private[spark] object SparkThrowableHelper {
       queryContext: String = ""): String = {
     val errorInfo = errorClassToInfoMap.getOrElse(errorClass,
       throw new IllegalArgumentException(s"Cannot find error class '$errorClass'"))
+    val (displayClass, displayMessageParameters, displayFormat) = if (errorInfo.subClass.isEmpty) {
+      (errorClass, messageParameters, errorInfo.messageFormat)
+    } else {
+      val subClass = errorInfo.subClass.get
+      val subErrorClass = messageParameters.head
+      val errorSubInfo = subClass.getOrElse(subErrorClass,
+        throw new IllegalArgumentException(s"Cannot find sub error class '$subErrorClass'"))
+      (errorClass + "." + subErrorClass, messageParameters.tail,
+        errorInfo.messageFormat + " " + errorSubInfo.messageFormat)
+    }
+    val displayMessage = String.format(
+      displayFormat.replaceAll("<[a-zA-Z0-9_-]+>", "%s"),
+      displayMessageParameters : _*)
     val displayQueryContext = if (queryContext.isEmpty) {

Review Comment:
   ok, i will close it and open new pr for it!
   new pr: https://github.com/apache/spark/pull/36852



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

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


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


[GitHub] [spark] AmplabJenkins commented on pull request #36676: [SPARK-38700][SQL][3.3] Use error classes in the execution errors of save mode

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on PR #36676:
URL: https://github.com/apache/spark/pull/36676#issuecomment-1139648362

   Can one of the admins verify this patch?


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

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


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


[GitHub] [spark] MaxGekk commented on pull request #36676: [SPARK-38700][SQL][3.3] Use error classes in the execution errors of save mode

Posted by GitBox <gi...@apache.org>.
MaxGekk commented on PR #36676:
URL: https://github.com/apache/spark/pull/36676#issuecomment-1139660202

   @panbingkun Could you resolve conflicts, please.


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

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


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


[GitHub] [spark] panbingkun commented on pull request #36676: [SPARK-38700][SQL][3.3] Use error classes in the execution errors of save mode

Posted by GitBox <gi...@apache.org>.
panbingkun commented on PR #36676:
URL: https://github.com/apache/spark/pull/36676#issuecomment-1152262909

   > @panbingkun Could you resolve conflicts, please.
   
   sorry, I've been busy for the last two weeks, i will do it the weekend.


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

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


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


[GitHub] [spark] panbingkun closed pull request #36676: [SPARK-38700][SQL][3.3] Use error classes in the execution errors of save mode

Posted by GitBox <gi...@apache.org>.
panbingkun closed pull request #36676: [SPARK-38700][SQL][3.3] Use error classes in the execution errors of save mode
URL: https://github.com/apache/spark/pull/36676


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

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


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