This is an automated email from the ASF dual-hosted git repository.
yao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push:
new 714699ba73c6 [SPARK-47911][SQL][FOLLOWUP] Enable binary format tests
in ThriftServerQueryTestSuite
714699ba73c6 is described below
commit 714699ba73c65f768450e3c0c2581a1b05400f59
Author: Kent Yao <[email protected]>
AuthorDate: Thu Jun 20 15:02:47 2024 +0800
[SPARK-47911][SQL][FOLLOWUP] Enable binary format tests in
ThriftServerQueryTestSuite
### What changes were proposed in this pull request?
This PR enables binary format tests in ThriftServerQueryTestSuite
### Why are the changes needed?
improve test coverage
### Does this PR introduce _any_ user-facing change?
no
### How was this patch tested?
new tests
### Was this patch authored or co-authored using generative AI tooling?
no
Closes #47028 from yaooqinn/SPARK-47911-F.
Authored-by: Kent Yao <[email protected]>
Signed-off-by: Kent Yao <[email protected]>
---
.../src/test/resources/sql-tests/inputs/binary.sql | 2 +-
.../resources/sql-tests/inputs/binary_base64.sql | 2 +-
.../resources/sql-tests/inputs/binary_basic.sql | 2 +-
.../test/resources/sql-tests/inputs/binary_hex.sql | 2 +-
.../sql-tests/inputs/binary_hex_discrete.sql | 2 +-
.../thriftserver/ThriftServerQueryTestSuite.scala | 22 ++++++++++------------
6 files changed, 15 insertions(+), 17 deletions(-)
diff --git a/sql/core/src/test/resources/sql-tests/inputs/binary.sql
b/sql/core/src/test/resources/sql-tests/inputs/binary.sql
index 8e9e90872374..8cd33eccaaf0 100644
--- a/sql/core/src/test/resources/sql-tests/inputs/binary.sql
+++ b/sql/core/src/test/resources/sql-tests/inputs/binary.sql
@@ -1,4 +1,4 @@
---SET spark.sql.binaryOutputStyle=UTF8;
+--SET spark.sql.binaryOutputStyle=UTF8
SELECT X'';
SELECT X'4561736F6E2059616F20323031382D31312D31373A31333A33333A3333';
diff --git a/sql/core/src/test/resources/sql-tests/inputs/binary_base64.sql
b/sql/core/src/test/resources/sql-tests/inputs/binary_base64.sql
index 3fc59d131225..853eedd51773 100644
--- a/sql/core/src/test/resources/sql-tests/inputs/binary_base64.sql
+++ b/sql/core/src/test/resources/sql-tests/inputs/binary_base64.sql
@@ -1,3 +1,3 @@
--IMPORT binary.sql
---SET spark.sql.binaryOutputStyle=BASE64;
+--SET spark.sql.binaryOutputStyle=BASE64
diff --git a/sql/core/src/test/resources/sql-tests/inputs/binary_basic.sql
b/sql/core/src/test/resources/sql-tests/inputs/binary_basic.sql
index 20edbf5a3bd8..1a5b64bdf7e0 100644
--- a/sql/core/src/test/resources/sql-tests/inputs/binary_basic.sql
+++ b/sql/core/src/test/resources/sql-tests/inputs/binary_basic.sql
@@ -1,4 +1,4 @@
--IMPORT binary.sql
---SET spark.sql.binaryOutputStyle=BASIC;
+--SET spark.sql.binaryOutputStyle=BASIC
diff --git a/sql/core/src/test/resources/sql-tests/inputs/binary_hex.sql
b/sql/core/src/test/resources/sql-tests/inputs/binary_hex.sql
index a237d7a252ca..7863da737a72 100644
--- a/sql/core/src/test/resources/sql-tests/inputs/binary_hex.sql
+++ b/sql/core/src/test/resources/sql-tests/inputs/binary_hex.sql
@@ -1,3 +1,3 @@
--IMPORT binary.sql
---SET spark.sql.binaryOutputStyle=HEX;
+--SET spark.sql.binaryOutputStyle=HEX
diff --git
a/sql/core/src/test/resources/sql-tests/inputs/binary_hex_discrete.sql
b/sql/core/src/test/resources/sql-tests/inputs/binary_hex_discrete.sql
index ba7796ca4e2f..282a7634cbc5 100644
--- a/sql/core/src/test/resources/sql-tests/inputs/binary_hex_discrete.sql
+++ b/sql/core/src/test/resources/sql-tests/inputs/binary_hex_discrete.sql
@@ -1,3 +1,3 @@
--IMPORT binary.sql
---SET spark.sql.binaryOutputStyle=HEX_DISCRETE;
+--SET spark.sql.binaryOutputStyle=HEX_DISCRETE
diff --git
a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/ThriftServerQueryTestSuite.scala
b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/ThriftServerQueryTestSuite.scala
index 627e5c4950a9..026b2388c593 100644
---
a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/ThriftServerQueryTestSuite.scala
+++
b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/ThriftServerQueryTestSuite.scala
@@ -103,11 +103,7 @@ class ThriftServerQueryTestSuite extends SQLQueryTestSuite
with SharedThriftServ
// SPARK-42921
"timestampNTZ/datetime-special-ansi.sql",
// SPARK-47264
- "collations.sql",
- "binary_hex.sql",
- "binary_hex_discrete.sql",
- "binary_basic.sql",
- "binary_base64.sql"
+ "collations.sql"
)
override def runQueries(
@@ -135,13 +131,15 @@ class ThriftServerQueryTestSuite extends
SQLQueryTestSuite with SharedThriftServ
}
// Run the SQL queries preparing them for comparison.
- val outputs: Seq[QueryTestOutput] = queries.map { sql =>
- val (_, output) = handleExceptions(getNormalizedResult(statement, sql))
- // We might need to do some query canonicalization in the future.
- ExecutionOutput(
- sql = sql,
- schema = Some(""),
- output = output.mkString("\n").replaceAll("\\s+$", ""))
+ val outputs: Seq[QueryTestOutput] = withSQLConf(configSet: _*) {
+ queries.map { sql =>
+ val (_, output) = handleExceptions(getNormalizedResult(statement,
sql))
+ // We might need to do some query canonicalization in the future.
+ ExecutionOutput(
+ sql = sql,
+ schema = Some(""),
+ output = output.mkString("\n").replaceAll("\\s+$", ""))
+ }
}
// Read back the golden file.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]