You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by ul...@apache.org on 2022/06/28 01:11:18 UTC
[incubator-kyuubi] branch master updated: [KYUUBI #2949] Flaky test: execute statement - analysis exception
This is an automated email from the ASF dual-hosted git repository.
ulyssesyou pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-kyuubi.git
The following commit(s) were added to refs/heads/master by this push:
new 994dc6ce8 [KYUUBI #2949] Flaky test: execute statement - analysis exception
994dc6ce8 is described below
commit 994dc6ce849f4502e2a9060cc4e5246967eb03d3
Author: Fu Chen <cf...@gmail.com>
AuthorDate: Tue Jun 28 09:11:06 2022 +0800
[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 <cf...@gmail.com>
Signed-off-by: ulysses-you <ul...@apache.org>
---
.../test/scala/org/apache/kyuubi/operation/SparkQueryTests.scala | 7 +++++--
.../org/apache/kyuubi/server/mysql/MySQLSparkQuerySuite.scala | 7 +++++--
2 files changed, 10 insertions(+), 4 deletions(-)
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 654d4afad..dde47c771 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 272619cb9..393f3a8ea 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)))
}
}