You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "panbingkun (via GitHub)" <gi...@apache.org> on 2023/05/20 03:13:21 UTC

[GitHub] [spark] panbingkun opened a new pull request, #41241: [SPARK-43597][SQL] Assign a name to the error class _LEGACY_ERROR_TEMP_0017

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

   ### What changes were proposed in this pull request?
   The pr aims to assign a name to the error class _LEGACY_ERROR_TEMP_0017.
   
   ### Why are the changes needed?
   The changes improve the error framework.
   
   ### Does this PR introduce _any_ user-facing change?
   No.
   
   ### How was this patch tested?
   Pass GA.


-- 
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 #41241: [SPARK-43597][SQL] Assign a name to the error class _LEGACY_ERROR_TEMP_0017

Posted by "panbingkun (via GitHub)" <gi...@apache.org>.
panbingkun commented on code in PR #41241:
URL: https://github.com/apache/spark/pull/41241#discussion_r1200088024


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryParsingErrors.scala:
##########
@@ -188,8 +188,11 @@ private[sql] object QueryParsingErrors extends QueryErrorsBase {
       ctx)
   }
 
-  def invalidEscapeStringError(ctx: PredicateContext): Throwable = {
-    new ParseException(errorClass = "_LEGACY_ERROR_TEMP_0017", ctx)
+  def invalidEscapeStringError(invalidEscape: String, ctx: PredicateContext): Throwable = {
+    new ParseException(
+      errorClass = "INVALID_ESC",
+      messageParameters = Map("invalidEscape" -> toSQLConf(invalidEscape)),

Review Comment:
   This is done.



-- 
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 closed pull request #41241: [SPARK-43597][SQL] Assign a name to the error class _LEGACY_ERROR_TEMP_0017

Posted by "MaxGekk (via GitHub)" <gi...@apache.org>.
MaxGekk closed pull request #41241: [SPARK-43597][SQL] Assign a name to the error class _LEGACY_ERROR_TEMP_0017
URL: https://github.com/apache/spark/pull/41241


-- 
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 #41241: [SPARK-43597][SQL] Assign a name to the error class _LEGACY_ERROR_TEMP_0017

Posted by "MaxGekk (via GitHub)" <gi...@apache.org>.
MaxGekk commented on code in PR #41241:
URL: https://github.com/apache/spark/pull/41241#discussion_r1199700522


##########
core/src/main/resources/error/error-classes.json:
##########
@@ -904,6 +904,11 @@
     ],
     "sqlState" : "42K05"
   },
+  "INVALID_ESC" : {
+    "message" : [
+      "Invalid escape string. Escape string must contain only one character."

Review Comment:
   Could you show the invalid string in the error message, please:
   ```suggestion
         "Found an invalid escape string: <invalidEscape>. The escape string must contain only one character."
   ```



-- 
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 #41241: [SPARK-43597][SQL] Assign a name to the error class _LEGACY_ERROR_TEMP_0017

Posted by "MaxGekk (via GitHub)" <gi...@apache.org>.
MaxGekk commented on code in PR #41241:
URL: https://github.com/apache/spark/pull/41241#discussion_r1200040672


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryParsingErrors.scala:
##########
@@ -188,8 +188,11 @@ private[sql] object QueryParsingErrors extends QueryErrorsBase {
       ctx)
   }
 
-  def invalidEscapeStringError(ctx: PredicateContext): Throwable = {
-    new ParseException(errorClass = "_LEGACY_ERROR_TEMP_0017", ctx)
+  def invalidEscapeStringError(invalidEscape: String, ctx: PredicateContext): Throwable = {
+    new ParseException(
+      errorClass = "INVALID_ESC",
+      messageParameters = Map("invalidEscape" -> toSQLConf(invalidEscape)),

Review Comment:
   Please, wrap `invalidEscape` as a string literal using:
   ```suggestion
         messageParameters = Map("invalidEscape" -> toSQLValue(invalidEscape, StringType)),
   ```



-- 
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 #41241: [SPARK-43597][SQL] Assign a name to the error class _LEGACY_ERROR_TEMP_0017

Posted by "MaxGekk (via GitHub)" <gi...@apache.org>.
MaxGekk commented on PR #41241:
URL: https://github.com/apache/spark/pull/41241#issuecomment-1557839597

   +1, LGTM. Merging to master.
   Thank you, @panbingkun.


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