Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
}
}

Expand Down