Skip to content

Commit 18b9bd9

Browse files
panbingkunMaxGekk
authored andcommitted
[SPARK-43945][SQL][TESTS] Fix bug for SQLQueryTestSuite when run on local env
### What changes were proposed in this pull request? The pr aims to fix bug for SQLQueryTestSuite when run on local env. When SQLQueryTestSuite runs `identifier-clause.sql` in various different environments, the statement `DESCRIBE SCHEMA IDENTIFIER('id' || 'ent')` will generate different `Owner` values. Currently, this value(`runner`) is OK when runs on GA, but it will fail on local. In order to be compatible with the results of various different environments, the `Owner` value is removed for comparison. ### Why are the changes needed? Fix bugs and compatibility. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? - Manually test. - Pass GA. Closes #41431 from panbingkun/fix_SQLQueryTestSuite_run_on_local. Authored-by: panbingkun <pbk1982@gmail.com> Signed-off-by: Max Gekk <max.gekk@gmail.com>
1 parent c3b6270 commit 18b9bd9

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

sql/core/src/test/resources/sql-tests/results/identifier-clause.sql.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ Catalog Name spark_catalog
535535
Comment some comment
536536
Location [not included in comparison]/{warehouse_dir}/someloc
537537
Namespace Name ident
538-
Owner runner
538+
Owner [not included in comparison]
539539

540540

541541
-- !query

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ trait SQLQueryTestHelper extends Logging {
4949
.replaceAll("Created By.*", s"Created By $notIncludedMsg")
5050
.replaceAll("Created Time.*", s"Created Time $notIncludedMsg")
5151
.replaceAll("Last Access.*", s"Last Access $notIncludedMsg")
52+
.replaceAll("Owner\t.*", s"Owner\t$notIncludedMsg")
5253
.replaceAll("Partition Statistics\t\\d+", s"Partition Statistics\t$notIncludedMsg")
5354
.replaceAll("CTERelationDef \\d+,", s"CTERelationDef xxxx,")
5455
.replaceAll("CTERelationRef \\d+,", s"CTERelationRef xxxx,")

0 commit comments

Comments
 (0)