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/10/18 09:27:17 UTC

[GitHub] [spark] panbingkun opened a new pull request, #38299: [SPARK-40756][SQL] Migrate type check failures of string expressions onto error classes

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

   ### What changes were proposed in this pull request?
   This pr replace TypeCheckFailure by DataTypeMismatch in type checks in the string expressions, includes:
   - A.regexpExpressions.scala (RegExpReplace)
   - B.stringExpressions.scala (Etl)
   
   ### Why are the changes needed?
   Migration onto error classes unifies Spark SQL error messages.
   
   
   ### Does this PR introduce _any_ user-facing change?
   Yes. The PR changes user-facing error messages.
   
   ### How was this patch tested?
   1.Add new UT
   2.Update existed UT
   3.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 #38299: [SPARK-40756][SQL] Migrate type check failures of string expressions onto error classes

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


##########
core/src/main/resources/error/error-classes.json:
##########
@@ -248,11 +248,21 @@
           "The <exprName> must not be null"
         ]
       },
+      "UNEXPECTED_NUM_PARAMS" : {

Review Comment:
   ok



-- 
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 #38299: [SPARK-40756][SQL] Migrate type check failures of string expressions onto error classes

Posted by GitBox <gi...@apache.org>.
MaxGekk closed pull request #38299: [SPARK-40756][SQL] Migrate type check failures of string expressions onto error classes
URL: https://github.com/apache/spark/pull/38299


-- 
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 #38299: [SPARK-40756][SQL] Migrate type check failures of string expressions onto error classes

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

   +1, LGTM. Merging to master.
   Thank you, @panbingkun and @LuciferYang for review.


-- 
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 #38299: [SPARK-40756][SQL] Migrate type check failures of string expressions onto error classes

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


##########
core/src/main/resources/error/error-classes.json:
##########
@@ -248,11 +248,21 @@
           "The <exprName> must not be null"
         ]
       },
+      "UNEXPECTED_NUM_PARAMS" : {

Review Comment:
   Can I change it to:
   "WRONG_NUM_PARAMS" : {
           "message" : [
             "The < functionName > requires < num > arguments (actual number = < actualNum >)"
           ]
         }
   



-- 
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 #38299: [SPARK-40756][SQL] Migrate type check failures of string expressions onto error classes

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


##########
core/src/main/resources/error/error-classes.json:
##########
@@ -248,11 +248,21 @@
           "The <exprName> must not be null"
         ]
       },
+      "UNEXPECTED_NUM_PARAMS" : {

Review Comment:
   Can I change it to:
   `
   "WRONG_NUM_PARAMS" : {
           "message" : [
             "The <functionName> requires <expectedNum> arguments (actual number = <actualNum>)"
           ]
         }
   `



-- 
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 #38299: [SPARK-40756][SQL] Migrate type check failures of string expressions onto error classes

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


##########
core/src/main/resources/error/error-classes.json:
##########
@@ -248,11 +248,21 @@
           "The <exprName> must not be null"
         ]
       },
+      "UNEXPECTED_NUM_PARAMS" : {

Review Comment:
   Can I change it to:
   "WRONG_NUM_PARAMS" : {
           "message" : [
             "The <functionName> requires <num> arguments (actual number = <actualNum>)"
           ]
         }
   



-- 
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 #38299: [SPARK-40756][SQL] Migrate type check failures of string expressions onto error classes

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

   After https://github.com/apache/spark/pull/38319, I will continue do 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 #38299: [SPARK-40756][SQL] Migrate type check failures of string expressions onto error classes

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

   > @panbingkun Could you resolve conflicts, please.
   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] panbingkun commented on pull request #38299: [SPARK-40756][SQL] Migrate type check failures of string expressions onto error classes

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

   cc @MaxGekk 


-- 
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 #38299: [SPARK-40756][SQL] Migrate type check failures of string expressions onto error classes

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


##########
core/src/main/resources/error/error-classes.json:
##########
@@ -248,11 +248,21 @@
           "The <exprName> must not be null"
         ]
       },
+      "UNEXPECTED_NUM_PARAMS" : {

Review Comment:
   It seems it is similar to `WRONG_NUM_PARAMS`. Could you re-use the existing one or improve it.



##########
core/src/main/resources/error/error-classes.json:
##########
@@ -248,11 +248,21 @@
           "The <exprName> must not be null"
         ]
       },
+      "UNEXPECTED_NUM_PARAMS" : {
+        "message" : [
+          "The <functionName> requires at least <num> arguments."
+        ]
+      },
       "UNEXPECTED_STATIC_METHOD" : {
         "message" : [
           "cannot find a static method <methodName> that matches the argument types in <className>"
         ]
       },
+      "UNEXPECTED_VALUE" : {

Review Comment:
   Can't you re-use `VALUE_OUT_OF_RANGE`?



-- 
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] LuciferYang commented on a diff in pull request #38299: [SPARK-40756][SQL] Migrate type check failures of string expressions onto error classes

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


##########
core/src/main/resources/error/error-classes.json:
##########
@@ -248,11 +248,21 @@
           "The <exprName> must not be null"
         ]
       },
+      "UNEXPECTED_NUM_PARAMS" : {

Review Comment:
   I think we can make `WRONG_NUM_PARAMS` more general



-- 
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 #38299: [SPARK-40756][SQL] Migrate type check failures of string expressions onto error classes

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


##########
core/src/main/resources/error/error-classes.json:
##########
@@ -248,11 +248,21 @@
           "The <exprName> must not be null"
         ]
       },
+      "UNEXPECTED_NUM_PARAMS" : {

Review Comment:
   Please, open a separate PR and change the error template. I would change it to:
   ```json
         "WRONG_NUM_PARAMS" : {
           "message" : [
             "The <functionName> requires <expectedNum> parameters but the actual number is <actualNum>."
           ]
         }
   ```



-- 
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 #38299: [SPARK-40756][SQL] Migrate type check failures of string expressions onto error classes

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

   @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 a diff in pull request #38299: [SPARK-40756][SQL] Migrate type check failures of string expressions onto error classes

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


##########
core/src/main/resources/error/error-classes.json:
##########
@@ -248,11 +248,21 @@
           "The <exprName> must not be null"
         ]
       },
+      "UNEXPECTED_NUM_PARAMS" : {
+        "message" : [
+          "The <functionName> requires at least <num> arguments."
+        ]
+      },
       "UNEXPECTED_STATIC_METHOD" : {
         "message" : [
           "cannot find a static method <methodName> that matches the argument types in <className>"
         ]
       },
+      "UNEXPECTED_VALUE" : {

Review Comment:
   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] panbingkun commented on a diff in pull request #38299: [SPARK-40756][SQL] Migrate type check failures of string expressions onto error classes

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


##########
core/src/main/resources/error/error-classes.json:
##########
@@ -248,11 +248,21 @@
           "The <exprName> must not be null"
         ]
       },
+      "UNEXPECTED_NUM_PARAMS" : {

Review Comment:
   Can I change it to:
   `
   "WRONG_NUM_PARAMS" : {
           "message" : [
             "The <functionName> requires <expectedNum> arguments (actual number = <actualNum>)"
           ]
         }
   `
   ?



-- 
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 #38299: [SPARK-40756][SQL] Migrate type check failures of string expressions onto error classes

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

   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