Skip to content

Commit

Permalink
[SPARK-41131][SQL] Improve error message for `UNRESOLVED_MAP_KEY.WITH…
Browse files Browse the repository at this point in the history
…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 <[email protected]>
Signed-off-by: Max Gekk <[email protected]>
  • Loading branch information
itholic authored and beliefer committed Dec 18, 2022
1 parent 3ce9a07 commit dbdae7f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/resources/error/error-classes.json
Original file line number Diff line number Diff line change
Expand Up @@ -1157,7 +1157,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 the single quotes '' around it."
],
"subClass" : {
"WITHOUT_SUGGESTION" : {
Expand Down

0 comments on commit dbdae7f

Please sign in to comment.