New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-41131][SQL] Improve error message for UNRESOLVED_MAP_KEY.WITHOUT_SUGGESTION
#38646
Conversation
@@ -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>'." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I don't see that we pass
object_name
. Maybe,objectName
? - We quite
objectName
by back ticks, and how it will looks like'`a`'
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 ??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. Just updated!
+1, LGTM. Merging to master. |
…OUT_SUGGESTION` ### 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. ``` ### How was this patch tested? The existing CI should pass. Closes apache#38646 from itholic/SPARK-41131. Authored-by: itholic <haejoon.lee@databricks.com> Signed-off-by: Max Gekk <max.gekk@gmail.com>
…OUT_SUGGESTION` ### 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. ``` ### How was this patch tested? The existing CI should pass. Closes apache#38646 from itholic/SPARK-41131. Authored-by: itholic <haejoon.lee@databricks.com> Signed-off-by: Max Gekk <max.gekk@gmail.com>
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
To
How was this patch tested?
The existing CI should pass.