diff --git a/kyuubi-common/src/test/scala/org/apache/kyuubi/operation/SparkQueryTests.scala b/kyuubi-common/src/test/scala/org/apache/kyuubi/operation/SparkQueryTests.scala index 654d4afad57..dde47c77171 100644 --- a/kyuubi-common/src/test/scala/org/apache/kyuubi/operation/SparkQueryTests.scala +++ b/kyuubi-common/src/test/scala/org/apache/kyuubi/operation/SparkQueryTests.scala @@ -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))) } } diff --git a/kyuubi-server/src/test/scala/org/apache/kyuubi/server/mysql/MySQLSparkQuerySuite.scala b/kyuubi-server/src/test/scala/org/apache/kyuubi/server/mysql/MySQLSparkQuerySuite.scala index 272619cb981..393f3a8eaf8 100644 --- a/kyuubi-server/src/test/scala/org/apache/kyuubi/server/mysql/MySQLSparkQuerySuite.scala +++ b/kyuubi-server/src/test/scala/org/apache/kyuubi/server/mysql/MySQLSparkQuerySuite.scala @@ -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))) } }