MaxGekk commented on code in PR #44093:
URL: https://github.com/apache/spark/pull/44093#discussion_r1429065647
##########
common/utils/src/main/resources/error/error-classes.json:
##########
@@ -1975,6 +1981,12 @@
},
"sqlState" : "42K0E"
},
+ "INVALID_NAME_PARAMETERIZED_QUERY_ALL_PARAMETERS_MUST_BE_NAMED" : {
Review Comment:
This is too long, please, make it shorter. For instance:
`MISSED_PARAMETER_NAME`
##########
sql/core/src/test/scala/org/apache/spark/sql/errors/QueryParsingErrorsSuite.scala:
##########
@@ -32,6 +32,33 @@ class QueryParsingErrorsSuite extends QueryTest with
SharedSparkSession with SQL
intercept[ParseException](sql(sqlText).collect())
}
+ test("EXEC_IMMEDIATE_DUPLICATE_ARGUMENT_ALIASES: duplicate aliases provided
in using statement") {
+ val query = "EXECUTE IMMEDIATE 'SELECT 1707 WHERE ? = 1' USING 1 as first"
+
+ ", 2 as first, 3 as second, 4 as second, 5 as third"
+ checkError(
+ exception = parseException(query),
+ errorClass = "EXEC_IMMEDIATE_DUPLICATE_ARGUMENT_ALIASES",
+ parameters = Map("aliases" -> "`second`, `first`"),
+ context = ExpectedContext(
+ query,
+ start = 0,
+ stop = 109)
+ )
+ }
+
+ test("PARSE_SYNTAX_ERROR: Execute immediate syntax error with INTO
specified") {
+ val query = "EXECUTE IMMEDIATE 'SELCT 1707 WHERE ? = 1' INTO a USING 1"
+ checkError(
+ exception = parseException(query),
+ errorClass = "PARSE_SYNTAX_ERROR",
+ parameters = Map("error" -> "'SELCT'", "hint" -> ""),
+ context = ExpectedContext(
+ start = 0,
+ stop = 56,
+ fragment = "EXECUTE IMMEDIATE 'SELCT 1707 WHERE ? = 1' INTO a USING 1")
Review Comment:
Seems like it can be substituted by `query`, can't be?
##########
common/utils/src/main/resources/error/error-classes.json:
##########
@@ -2157,6 +2169,12 @@
],
"sqlState" : "42602"
},
+ "INVALID_QUERY_BOTH_POSITIONAL_AND_NAMED_PARAMETERS_PRESENT" : {
Review Comment:
Please, make it shorter, like `MIXED_QUERY_PARAMETERS`
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]