[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:
parent
c8f18f0001
commit
994dc6ce84
@ -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)))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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)))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user