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/21 02:37:08 UTC

[GitHub] [spark] panbingkun opened a new pull request, #38730: [SPARK-41181][SQL] Migrate the map options errors onto error classes

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

   ### What changes were proposed in this pull request?
   The pr aims to migrate the map options errors onto error classes.
   
   ### 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] AmplabJenkins commented on pull request #38730: [SPARK-41181][SQL] Migrate the map options errors onto error classes

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

   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 closed pull request #38730: [SPARK-41181][SQL] Migrate the map options errors onto error classes

Posted by GitBox <gi...@apache.org>.
MaxGekk closed pull request #38730: [SPARK-41181][SQL] Migrate the map options errors onto error classes
URL: https://github.com/apache/spark/pull/38730


-- 
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 #38730: [SPARK-41181][SQL] Migrate the map options errors onto error classes

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

   @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 #38730: [SPARK-41181][SQL] Migrate the map options errors onto error classes

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

   > @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] MaxGekk commented on a diff in pull request #38730: [SPARK-41181][SQL] Migrate the map options errors onto error classes

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


##########
core/src/main/resources/error/error-classes.json:
##########
@@ -730,6 +730,23 @@
       "The <joinType> JOIN with LATERAL correlation is not allowed because an OUTER subquery cannot correlate to its join partner. Remove the LATERAL correlation or use an INNER JOIN, or LEFT OUTER JOIN instead."
     ]
   },
+  "INVALID_OPTIONS" : {
+    "message" : [
+      "Invalid options:"
+    ],
+    "subClass" : {
+      "NON_STRING_TYPE" : {
+        "message" : [
+          "A type of keys and values in map() must be string, but got <map>."

Review Comment:
   nit: `map` -> `mapType`



##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala:
##########
@@ -1013,13 +1013,13 @@ private[sql] object QueryCompilationErrors extends QueryErrorsBase {
 
   def keyValueInMapNotStringError(m: CreateMap): Throwable = {
     new AnalysisException(
-      errorClass = "_LEGACY_ERROR_TEMP_1095",
-      messageParameters = Map("map" -> m.dataType.catalogString))
+      errorClass = "INVALID_OPTIONS.NON_STRING_TYPE",
+      messageParameters = Map("map" -> toSQLType(m.dataType)))
   }
 
   def nonMapFunctionNotAllowedError(): Throwable = {

Review Comment:
   Be sure the names are consistent. not or non



##########
core/src/main/resources/error/error-classes.json:
##########
@@ -730,6 +730,23 @@
       "The <joinType> JOIN with LATERAL correlation is not allowed because an OUTER subquery cannot correlate to its join partner. Remove the LATERAL correlation or use an INNER JOIN, or LEFT OUTER JOIN instead."
     ]
   },
+  "INVALID_OPTIONS" : {
+    "message" : [
+      "Invalid options:"
+    ],
+    "subClass" : {
+      "NON_STRING_TYPE" : {
+        "message" : [
+          "A type of keys and values in map() must be string, but got <map>."
+        ]
+      },
+      "NOT_MAP_FUNCTION" : {
+        "message" : [
+          "Must use a map() function for options."

Review Comment:
   ```suggestion
             "Must use the `map()` function for options."
   ```



##########
core/src/main/resources/error/error-classes.json:
##########
@@ -730,6 +730,23 @@
       "The <joinType> JOIN with LATERAL correlation is not allowed because an OUTER subquery cannot correlate to its join partner. Remove the LATERAL correlation or use an INNER JOIN, or LEFT OUTER JOIN instead."
     ]
   },
+  "INVALID_OPTIONS" : {
+    "message" : [
+      "Invalid options:"
+    ],
+    "subClass" : {
+      "NON_STRING_TYPE" : {
+        "message" : [
+          "A type of keys and values in map() must be string, but got <map>."
+        ]
+      },
+      "NOT_MAP_FUNCTION" : {

Review Comment:
   Why not `NON_MAP_FUNCTION`?



-- 
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 #38730: [SPARK-41181][SQL] Migrate the map options errors onto error classes

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

   +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