This is an automated email from the ASF dual-hosted git repository.
maxgekk 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 8c164c075d8 [SPARK-37888][SQL][TESTS][FOLLOWUP] Don't check the
`Created By` field in `DESCRIBE TABLE` tests
8c164c075d8 is described below
commit 8c164c075d8ae41216e7ddf93a5f29b7900b4a95
Author: Max Gekk <[email protected]>
AuthorDate: Wed Jul 27 08:27:05 2022 +0500
[SPARK-37888][SQL][TESTS][FOLLOWUP] Don't check the `Created By` field in
`DESCRIBE TABLE` tests
### What changes were proposed in this pull request?
In the PR, I propose to do not check the field `Created By` in tests that
check output of the `DESCRIBE TABLE` command.
### Why are the changes needed?
The field `Created By` depends on the current Spark version, for instance
`Spark 3.4.0-SNAPSHOT`. Apparently, the tests that check the field depend on
Spark version. The changes are needed to avoid dependency from Spark version,
and to don't change the tests when bumping Spark version.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
By running the modified tests:
```
$ build/sbt -Phive-2.3 -Phive-thriftserver "test:testOnly
*DescribeTableSuite"
```
Closes #37299 from MaxGekk/unify-describe-table-tests-followup.
Authored-by: Max Gekk <[email protected]>
Signed-off-by: Max Gekk <[email protected]>
---
.../org/apache/spark/sql/execution/command/v1/DescribeTableSuite.scala | 3 +--
.../apache/spark/sql/hive/execution/command/DescribeTableSuite.scala | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git
a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/DescribeTableSuite.scala
b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/DescribeTableSuite.scala
index f8e53fee723..da4eab13afb 100644
---
a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/DescribeTableSuite.scala
+++
b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/DescribeTableSuite.scala
@@ -189,7 +189,7 @@ class DescribeTableSuite extends DescribeTableSuiteBase
with CommandSuiteBase {
("data_type", StringType),
("comment", StringType)))
QueryTest.checkAnswer(
- descriptionDf.filter("col_name != 'Created Time'"),
+ descriptionDf.filter("!(col_name in ('Created Time', 'Created By'))"),
Seq(
Row("data", "string", null),
Row("id", "bigint", null),
@@ -202,7 +202,6 @@ class DescribeTableSuite extends DescribeTableSuiteBase
with CommandSuiteBase {
Row("Database", "ns", ""),
Row("Table", "table", ""),
Row("Last Access", "UNKNOWN", ""),
- Row("Created By", "Spark 3.4.0-SNAPSHOT", ""),
Row("Type", "EXTERNAL", ""),
Row("Provider", getProvider(), ""),
Row("Comment", "this is a test table", ""),
diff --git
a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/command/DescribeTableSuite.scala
b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/command/DescribeTableSuite.scala
index 00adb377f04..c12d236f4b6 100644
---
a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/command/DescribeTableSuite.scala
+++
b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/command/DescribeTableSuite.scala
@@ -58,7 +58,7 @@ class DescribeTableSuite extends v1.DescribeTableSuiteBase
with CommandSuiteBase
("comment", StringType)))
QueryTest.checkAnswer(
// Filter out 'Table Properties' to don't check `transient_lastDdlTime`
- descriptionDf.filter("col_name != 'Created Time' and col_name !=
'Table Properties'"),
+ descriptionDf.filter("!(col_name in ('Created Time', 'Table
Properties', 'Created By'))"),
Seq(
Row("data", "string", null),
Row("id", "bigint", null),
@@ -72,7 +72,6 @@ class DescribeTableSuite extends v1.DescribeTableSuiteBase
with CommandSuiteBase
Row("Table", "table", ""),
Row(TableCatalog.PROP_OWNER.capitalize, Utils.getCurrentUserName(),
""),
Row("Last Access", "UNKNOWN", ""),
- Row("Created By", "Spark 3.4.0-SNAPSHOT", ""),
Row("Type", "EXTERNAL", ""),
Row("Provider", getProvider(), ""),
Row("Comment", "this is a test table", ""),
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]