[KYUUBI #2949] Flaky test: execute statement - analysis exception

### _Why are the changes needed?_

to close #2949

Unquoted the function name  in the error `SECOND_FUNCTION_ARGUMENT_NOT_INTEGER` since Spark-3.4.0, for more details, see https://github.com/apache/spark/pull/36693

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [ ] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #2950 from cfmcgrady/kyuubi-2949.

Closes #2949

4d4da0ba [Fu Chen] fix

Authored-by: Fu Chen <cfmcgrady@gmail.com>
Signed-off-by: ulysses-you <ulyssesyou@apache.org>
This commit is contained in:
Fu Chen 2022-06-28 09:11:06 +08:00 committed by ulysses-you
parent c8f18f0001
commit 994dc6ce84
No known key found for this signature in database
GPG Key ID: 4C500BC62D576766
2 changed files with 10 additions and 4 deletions

View File

@ -323,13 +323,16 @@ trait SparkQueryTests extends HiveJDBCTestHelper {
test("execute statement - analysis exception") {
val sql = "select date_sub(date'2011-11-11', '1.2')"
val errors = Set(
"The second argument of 'date_sub' function needs to be an integer.",
// unquoted since Spark-3.4, see https://github.com/apache/spark/pull/36693
"The second argument of date_sub function needs to be an integer.")
withJdbcStatement() { statement =>
val e = intercept[SQLException] {
statement.executeQuery(sql)
}
assert(e.getMessage
.contains("The second argument of 'date_sub' function needs to be an integer."))
assert(errors.exists(msg => e.getMessage.contains(msg)))
}
}

View File

@ -249,13 +249,16 @@ class MySQLSparkQuerySuite extends WithKyuubiServer with MySQLJDBCTestHelper {
test("execute statement - analysis exception") {
val sql = "select date_sub(date'2011-11-11', '1.2')"
val errors = Set(
"The second argument of 'date_sub' function needs to be an integer.",
// unquoted since Spark-3.4, see https://github.com/apache/spark/pull/36693
"The second argument of date_sub function needs to be an integer.")
withJdbcStatement() { statement =>
val e = intercept[SQLException] {
statement.executeQuery(sql)
}
assert(e.getMessage
.contains("The second argument of 'date_sub' function needs to be an integer."))
assert(errors.exists(msg => e.getMessage.contains(msg)))
}
}