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/11/18 06:07:41 UTC

[GitHub] [spark] panbingkun opened a new pull request, #38707: [SPARK-41176][SQL] Assign a name to the error class _LEGACY_ERROR_TEMP_1042

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

   ### What changes were proposed in this pull request?
   In the PR, I propose to assign a name to the error class _LEGACY_ERROR_TEMP_1042.
   
   ### Why are the changes needed?
   Proper names of error classes should improve user experience with Spark SQL.
   
   ### 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] MaxGekk closed pull request #38707: [SPARK-41176][SQL] Assign a name to the error class _LEGACY_ERROR_TEMP_1042

Posted by GitBox <gi...@apache.org>.
MaxGekk closed pull request #38707: [SPARK-41176][SQL] Assign a name to the error class _LEGACY_ERROR_TEMP_1042
URL: https://github.com/apache/spark/pull/38707


-- 
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 #38707: [SPARK-41176][SQL] Assign a name to the error class _LEGACY_ERROR_TEMP_1042

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

   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 a diff in pull request #38707: [SPARK-41176][SQL] Assign a name to the error class _LEGACY_ERROR_TEMP_1042

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


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala:
##########
@@ -637,13 +637,13 @@ private[sql] object QueryCompilationErrors extends QueryErrorsBase {
   }
 
   def invalidFunctionArgumentsError(
-      name: String, expectedInfo: String, actualNumber: Int): Throwable = {
+      name: String, expectedNum: String, actualNum: Int): Throwable = {
     new AnalysisException(
-      errorClass = "_LEGACY_ERROR_TEMP_1042",
+      errorClass = "FUNCTION_WRONG_NUM_ARGS",
       messageParameters = Map(
-        "name" -> name,
-        "expectedInfo" -> expectedInfo,
-        "actualNumber" -> actualNumber.toString))
+        "functionName" -> name,

Review Comment:
   Please, wrap `functionName` by `toSQLId()`.



-- 
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 #38707: [SPARK-41176][SQL] Assign a name to the error class _LEGACY_ERROR_TEMP_1042

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


##########
core/src/main/resources/error/error-classes.json:
##########
@@ -490,6 +490,11 @@
       "The operation <statement> is not allowed on the <objectType>: <objectName>"
     ]
   },
+  "FUNCTION_WRONG_NUM_ARGS" : {

Review Comment:
   @cloud-fan @srielau Are you ok with the name or maybe just `WRONG_NUM_ARGS`? Later we will merge `DATATYPE_MISMATCH.WRONG_NUM_ARGS` into 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] srielau commented on a diff in pull request #38707: [SPARK-41176][SQL] Assign a name to the error class _LEGACY_ERROR_TEMP_1042

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


##########
core/src/main/resources/error/error-classes.json:
##########
@@ -490,6 +490,11 @@
       "The operation <statement> is not allowed on the <objectType>: <objectName>"
     ]
   },
+  "FUNCTION_WRONG_NUM_ARGS" : {

Review Comment:
   WRONG_NUM_ARGs is fine. If we want to keep a longer name I'd prefer ROUTINE over FUNCTIOn for future proofing.



-- 
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 #38707: [SPARK-41176][SQL] Assign a name to the error class _LEGACY_ERROR_TEMP_1042

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


##########
core/src/main/resources/error/error-classes.json:
##########
@@ -490,6 +490,11 @@
       "The operation <statement> is not allowed on the <objectType>: <objectName>"
     ]
   },
+  "FUNCTION_WRONG_NUM_ARGS" : {

Review Comment:
   @panbingkun Please, rename it to `WRONG_NUM_ARGS`.



-- 
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 #38707: [SPARK-41176][SQL] Assign a name to the error class _LEGACY_ERROR_TEMP_1042

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


##########
core/src/main/resources/error/error-classes.json:
##########
@@ -490,6 +490,11 @@
       "The operation <statement> is not allowed on the <objectType>: <objectName>"
     ]
   },
+  "FUNCTION_WRONG_NUM_ARGS" : {

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] MaxGekk commented on pull request #38707: [SPARK-41176][SQL] Assign a name to the error class _LEGACY_ERROR_TEMP_1042

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

   +1, LGTM. Merging to master.
   Thank you, @panbingkun and @srielau 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