From dbdae7fece39a4aa51aa394e8487fee7f2460bd9 Mon Sep 17 00:00:00 2001 From: itholic Date: Wed, 23 Nov 2022 17:28:56 +0300 Subject: [PATCH] [SPARK-41131][SQL] Improve error message for `UNRESOLVED_MAP_KEY.WITHOUT_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 #38646 from itholic/SPARK-41131. Authored-by: itholic Signed-off-by: Max Gekk --- core/src/main/resources/error/error-classes.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/resources/error/error-classes.json b/core/src/main/resources/error/error-classes.json index 5bac5ae71f20d..f2e7783efdd24 100644 --- a/core/src/main/resources/error/error-classes.json +++ b/core/src/main/resources/error/error-classes.json @@ -1157,7 +1157,7 @@ }, "UNRESOLVED_MAP_KEY" : { "message" : [ - "Cannot resolve column as a map key. If the key is a string literal, please add single quotes around it." + "Cannot resolve column as a map key. If the key is a string literal, add the single quotes '' around it." ], "subClass" : { "WITHOUT_SUGGESTION" : {