Skip to content

Commit 5bbbc6c

Browse files
vladimirg-dbdongjoon-hyun
authored andcommitted
[SPARK-48072][SQL][TESTS] Improve SQLQuerySuite test output - use === instead of sameElements for Arrays
### What changes were proposed in this pull request? Improve test output for the actual query to be printed alongside of expected ### Why are the changes needed? To reduce confusion later ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? `testOnly org.apache.spark.sql.SQLQuerySuite -- -z SPARK-47939` `testOnly org.apache.spark.sql.SQLQuerySuite -- -z SPARK-37965` `testOnly org.apache.spark.sql.SQLQuerySuite -- -z SPARK-27442` ### Was this patch authored or co-authored using generative AI tooling? No Closes #46318 from vladimirg-db/vladimirg-db/improve-test-output-for-sql-query-suite. Authored-by: Vladimir Golubev <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
1 parent 2f31d05 commit 5bbbc6c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4399,8 +4399,8 @@ class SQLQuerySuite extends QueryTest with SharedSparkSession with AdaptiveSpark
43994399
checkAnswer(df,
44004400
Row(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) ::
44014401
Row(2, 4, 6, 8, 10, 12, 14, 16, 18, 20) :: Nil)
4402-
assert(df.schema.names.sameElements(
4403-
Array("max(t)", "max(t", "=", "\n", ";", "a b", "{", ".", "a.b", "a")))
4402+
assert(df.schema.names ===
4403+
Array("max(t)", "max(t", "=", "\n", ";", "a b", "{", ".", "a.b", "a"))
44044404
checkAnswer(df.select("`max(t)`", "`a b`", "`{`", "`.`", "`a.b`"),
44054405
Row(1, 6, 7, 8, 9) :: Row(2, 12, 14, 16, 18) :: Nil)
44064406
checkAnswer(df.where("`a.b` > 10"),
@@ -4418,8 +4418,8 @@ class SQLQuerySuite extends QueryTest with SharedSparkSession with AdaptiveSpark
44184418
checkAnswer(df,
44194419
Row(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11) ::
44204420
Row(2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22) :: Nil)
4421-
assert(df.schema.names.sameElements(
4422-
Array("max(t)", "max(t", "=", "\n", ";", "a b", "{", ".", "a.b", "a", ",")))
4421+
assert(df.schema.names ===
4422+
Array("max(t)", "max(t", "=", "\n", ";", "a b", "{", ".", "a.b", "a", ","))
44234423
checkAnswer(df.select("`max(t)`", "`a b`", "`{`", "`.`", "`a.b`"),
44244424
Row(1, 6, 7, 8, 9) :: Row(2, 12, 14, 16, 18) :: Nil)
44254425
checkAnswer(df.where("`a.b` > 10"),
@@ -4754,7 +4754,7 @@ class SQLQuerySuite extends QueryTest with SharedSparkSession with AdaptiveSpark
47544754
df.collect()
47554755
.map(_.getString(0))
47564756
.map(_.replaceAll("#[0-9]+", "#N"))
4757-
.sameElements(Array(plan.stripMargin))
4757+
=== Array(plan.stripMargin)
47584758
)
47594759

47604760
checkQueryPlan(

0 commit comments

Comments
 (0)