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/14 07:03:24 UTC

[GitHub] [spark] itholic opened a new pull request, #38646: [SPARK-41131][SQL] Improve error message for `UNRESOLVED_MAP_KEY.WITHOUT_SUGGESTION`

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

   ### What changes were proposed in this pull request?
   
   This PR proposes to improve error message for `UNRESOLVED_MAP_KEY.WITHOUT_SUGGESTION`.
   
   
   ### Why are the changes needed?
   
   Printing the single quotes in error message as an example would more helpful for users, and we don't need 'please' in the error message. See https://spark.apache.org/error-message-guidelines.html more detail.
   
   
   ### Does this PR introduce _any_ user-facing change?
   
   Minor error message improvement.
   
   From
   ```
   Cannot resolve column col1 as a map key. If the key is a string literal, please add single quotes around it.
   ```
   
   To
   ```
   Cannot resolve column col1 as a map key. If the key is a string literal, add single quotes around it: 'col1'.
   ```
   
   
   ### How was this patch tested?
   
   The existing CI should pass.
   


-- 
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] itholic commented on a diff in pull request #38646: [SPARK-41131][SQL] Improve error message for `UNRESOLVED_MAP_KEY.WITHOUT_SUGGESTION`

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


##########
core/src/main/resources/error/error-classes.json:
##########
@@ -1044,7 +1044,7 @@
   },
   "UNRESOLVED_MAP_KEY" : {
     "message" : [
-      "Cannot resolve column <objectName> as a map key. If the key is a string literal, please add single quotes around it."
+      "Cannot resolve column <objectName> as a map key. If the key is a string literal, add single quotes around it: '<object_name>'."

Review Comment:
   Oh... I see.
   
   Just updated the PR description.
   
   Maybe we can just remove the example in the error message since the printing message like  ``` '`a`' ``` could confuse ??



-- 
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 #38646: [SPARK-41131][SQL] Improve error message for `UNRESOLVED_MAP_KEY.WITHOUT_SUGGESTION`

Posted by GitBox <gi...@apache.org>.
MaxGekk closed pull request #38646: [SPARK-41131][SQL] Improve error message for `UNRESOLVED_MAP_KEY.WITHOUT_SUGGESTION`
URL: https://github.com/apache/spark/pull/38646


-- 
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] itholic commented on a diff in pull request #38646: [SPARK-41131][SQL] Improve error message for `UNRESOLVED_MAP_KEY.WITHOUT_SUGGESTION`

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


##########
core/src/main/resources/error/error-classes.json:
##########
@@ -1044,7 +1044,7 @@
   },
   "UNRESOLVED_MAP_KEY" : {
     "message" : [
-      "Cannot resolve column <objectName> as a map key. If the key is a string literal, please add single quotes around it."
+      "Cannot resolve column <objectName> as a map key. If the key is a string literal, add single quotes around it: '<object_name>'."

Review Comment:
   Oh... I see.
   
   Just updated the PR description.
   
   Maybe we can just remove the example in the error message ??



-- 
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 #38646: [SPARK-41131][SQL] Improve error message for `UNRESOLVED_MAP_KEY.WITHOUT_SUGGESTION`

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


##########
core/src/main/resources/error/error-classes.json:
##########
@@ -1044,7 +1044,7 @@
   },
   "UNRESOLVED_MAP_KEY" : {
     "message" : [
-      "Cannot resolve column <objectName> as a map key. If the key is a string literal, please add single quotes around it."
+      "Cannot resolve column <objectName> as a map key. If the key is a string literal, add single quotes around it: '<object_name>'."

Review Comment:
   1. I don't see that we pass `object_name`. Maybe, `objectName`?
   2. We quite `objectName` by back ticks, and how it will looks like ```'`a`'```?



-- 
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] itholic commented on a diff in pull request #38646: [SPARK-41131][SQL] Improve error message for `UNRESOLVED_MAP_KEY.WITHOUT_SUGGESTION`

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


##########
core/src/main/resources/error/error-classes.json:
##########
@@ -1044,7 +1044,7 @@
   },
   "UNRESOLVED_MAP_KEY" : {
     "message" : [
-      "Cannot resolve column <objectName> as a map key. If the key is a string literal, please add single quotes around it."
+      "Cannot resolve column <objectName> as a map key. If the key is a string literal, add single quotes around it: '<object_name>'."

Review Comment:
   Oh... I see.
   
   Maybe we can just remove the example in the error message.
   
   Updated PR description as well.



-- 
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] itholic commented on a diff in pull request #38646: [SPARK-41131][SQL] Improve error message for `UNRESOLVED_MAP_KEY.WITHOUT_SUGGESTION`

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


##########
core/src/main/resources/error/error-classes.json:
##########
@@ -1044,7 +1044,7 @@
   },
   "UNRESOLVED_MAP_KEY" : {
     "message" : [
-      "Cannot resolve column <objectName> as a map key. If the key is a string literal, please add single quotes around it."
+      "Cannot resolve column <objectName> as a map key. If the key is a string literal, add single quotes around it: '<object_name>'."

Review Comment:
   Sounds good. Just updated!



-- 
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 #38646: [SPARK-41131][SQL] Improve error message for `UNRESOLVED_MAP_KEY.WITHOUT_SUGGESTION`

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


##########
core/src/main/resources/error/error-classes.json:
##########
@@ -1044,7 +1044,7 @@
   },
   "UNRESOLVED_MAP_KEY" : {
     "message" : [
-      "Cannot resolve column <objectName> as a map key. If the key is a string literal, please add single quotes around it."
+      "Cannot resolve column <objectName> as a map key. If the key is a string literal, add single quotes around it: '<object_name>'."

Review Comment:
   > Maybe we can just remove the example in the error message
   
   ok. Let's remove the example. You can show which quotes to add:
   ```
         "Cannot resolve column <objectName> as a map key. If the key is a string literal, add the single quotes '' around 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 pull request #38646: [SPARK-41131][SQL] Improve error message for `UNRESOLVED_MAP_KEY.WITHOUT_SUGGESTION`

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

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


-- 
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] itholic commented on pull request #38646: [SPARK-41131][SQL] Improve error message for `UNRESOLVED_MAP_KEY.WITHOUT_SUGGESTION`

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

   cc @srielau @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