Skip to content
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-50154][SQL] Assign appropriate error condition for _LEGACY_ERROR_TEMP_0043: INVALID_RESET_COMMAND_FORMAT #48689

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions common/utils/src/main/resources/error/error-conditions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2984,6 +2984,12 @@
],
"sqlState" : "22023"
},
"INVALID_RESET_COMMAND_FORMAT" : {
"message" : [
"Expected format is 'RESET' or 'RESET key'. If you want to include special characters in key, please use quotes, e.g., RESET `key`."
],
"sqlState" : "42000"
},
"INVALID_SAVE_MODE" : {
"message" : [
"The specified save mode <mode> is invalid. Valid save modes include \"append\", \"overwrite\", \"ignore\", \"error\", \"errorifexists\", and \"default\"."
Expand Down Expand Up @@ -5800,11 +5806,6 @@
"It is not allowed to add catalog/namespace prefix <quoted> to the table name in CACHE TABLE AS SELECT."
]
},
"_LEGACY_ERROR_TEMP_0043" : {
"message" : [
"Expected format is 'RESET' or 'RESET key'. If you want to include special characters in key, please use quotes, e.g., RESET `key`."
]
},
"_LEGACY_ERROR_TEMP_0045" : {
"message" : [
"Invalid time zone displacement value."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ private[sql] object QueryParsingErrors extends DataTypeErrorsBase {
}

def unexpectedFormatForResetConfigurationError(ctx: ResetConfigurationContext): Throwable = {
new ParseException(errorClass = "_LEGACY_ERROR_TEMP_0043", ctx)
new ParseException(errorClass = "INVALID_RESET_COMMAND_FORMAT", ctx)
}

def intervalValueOutOfRangeError(input: String, ctx: IntervalContext): Throwable = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ class SparkSqlParserSuite extends AnalysisTest with SharedSparkSession {
val sql1 = "RESET spark.sql.key1 key2"
checkError(
exception = parseException(sql1),
condition = "_LEGACY_ERROR_TEMP_0043",
condition = "INVALID_RESET_COMMAND_FORMAT",
parameters = Map.empty,
context = ExpectedContext(
fragment = sql1,
Expand All @@ -262,7 +262,7 @@ class SparkSqlParserSuite extends AnalysisTest with SharedSparkSession {
val sql2 = "RESET spark. sql.key1 key2"
checkError(
exception = parseException(sql2),
condition = "_LEGACY_ERROR_TEMP_0043",
condition = "INVALID_RESET_COMMAND_FORMAT",
parameters = Map.empty,
context = ExpectedContext(
fragment = sql2,
Expand All @@ -272,7 +272,7 @@ class SparkSqlParserSuite extends AnalysisTest with SharedSparkSession {
val sql3 = "RESET spark.sql.key1 key2 key3"
checkError(
exception = parseException(sql3),
condition = "_LEGACY_ERROR_TEMP_0043",
condition = "INVALID_RESET_COMMAND_FORMAT",
parameters = Map.empty,
context = ExpectedContext(
fragment = sql3,
Expand All @@ -282,7 +282,7 @@ class SparkSqlParserSuite extends AnalysisTest with SharedSparkSession {
val sql4 = "RESET spark: sql:key"
checkError(
exception = parseException(sql4),
condition = "_LEGACY_ERROR_TEMP_0043",
condition = "INVALID_RESET_COMMAND_FORMAT",
parameters = Map.empty,
context = ExpectedContext(
fragment = sql4,
Expand All @@ -292,7 +292,7 @@ class SparkSqlParserSuite extends AnalysisTest with SharedSparkSession {
val sql5 = "RESET spark .sql.key"
checkError(
exception = parseException(sql5),
condition = "_LEGACY_ERROR_TEMP_0043",
condition = "INVALID_RESET_COMMAND_FORMAT",
parameters = Map.empty,
context = ExpectedContext(
fragment = sql5,
Expand All @@ -302,7 +302,7 @@ class SparkSqlParserSuite extends AnalysisTest with SharedSparkSession {
val sql6 = "RESET spark : sql:key"
checkError(
exception = parseException(sql6),
condition = "_LEGACY_ERROR_TEMP_0043",
condition = "INVALID_RESET_COMMAND_FORMAT",
parameters = Map.empty,
context = ExpectedContext(
fragment = sql6,
Expand All @@ -312,7 +312,7 @@ class SparkSqlParserSuite extends AnalysisTest with SharedSparkSession {
val sql7 = "RESET spark.sql: key"
checkError(
exception = parseException(sql7),
condition = "_LEGACY_ERROR_TEMP_0043",
condition = "INVALID_RESET_COMMAND_FORMAT",
parameters = Map.empty,
context = ExpectedContext(
fragment = sql7,
Expand All @@ -322,7 +322,7 @@ class SparkSqlParserSuite extends AnalysisTest with SharedSparkSession {
val sql8 = "RESET spark.sql .key"
checkError(
exception = parseException(sql8),
condition = "_LEGACY_ERROR_TEMP_0043",
condition = "INVALID_RESET_COMMAND_FORMAT",
parameters = Map.empty,
context = ExpectedContext(
fragment = sql8,
Expand All @@ -332,7 +332,7 @@ class SparkSqlParserSuite extends AnalysisTest with SharedSparkSession {
val sql9 = "RESET spark.sql : key"
checkError(
exception = parseException(sql9),
condition = "_LEGACY_ERROR_TEMP_0043",
condition = "INVALID_RESET_COMMAND_FORMAT",
parameters = Map.empty,
context = ExpectedContext(
fragment = sql9,
Expand Down