Skip to content

Conversation

@imback82
Copy link
Contributor

What changes were proposed in this pull request?

  1. Move DESCRIBE DATABASE/NAMESPACE parsing tests to DescribeNamespaceParserSuite.
  2. Put common DESCRIBE NAMESPACE tests into one trait org.apache.spark.sql.execution.command. DescribeNamespaceSuiteBase, and put datasource specific tests to the v1.DescribeNamespaceSuite and v2.DescribeNamespaceSuite.

The changes follow the approach of #30287.

Why are the changes needed?

  1. The unification will allow to run common DESCRIBE NAMESPACE tests for both DSv1/Hive DSv1 and DSv2
  2. We can detect missing features and differences between DSv1 and DSv2 implementations.

Does this PR introduce any user-facing change?

No

How was this patch tested?

Existing unit tests and new tests.

@github-actions github-actions bot added the SQL label Oct 17, 2021
@SparkQA
Copy link

SparkQA commented Oct 17, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/48811/

@imback82
Copy link
Contributor Author

cc @cloud-fan @MaxGekk

@SparkQA
Copy link

SparkQA commented Oct 17, 2021

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/48811/

@SparkQA
Copy link

SparkQA commented Oct 17, 2021

Test build #144332 has finished for PR 34305 at commit d44f56e.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • trait CommandTestUtils extends SQLTestUtils
  • abstract class DDLSuite extends QueryTest with CommandTestUtils
  • class DescribeNamespaceParserSuite extends AnalysisTest
  • trait DescribeNamespaceSuiteBase extends QueryTest with DDLCommandTestUtils with CommandTestUtils
  • trait DescribeNamespaceSuiteBase extends command.DescribeNamespaceSuiteBase
  • class DescribeNamespaceSuite extends command.DescribeNamespaceSuiteBase with CommandSuiteBase

@SparkQA
Copy link

SparkQA commented Oct 24, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/49039/

@SparkQA
Copy link

SparkQA commented Oct 24, 2021

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/49039/

@SparkQA
Copy link

SparkQA commented Oct 25, 2021

Test build #144568 has finished for PR 34305 at commit 2640444.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.


assert(message.contains(s"$notFoundMsgPrefix '$ns' not found"))

sql(s"DROP NAMESPACE IF EXISTS $catalog.$ns")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to test DROP NAMESPACE here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is testing whether IF EXISTS is respected when the namespace doesn't exist (existing test). Do we still want to remove it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, it should belong to DropNamespaceSuite if we have one.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK seems we don't have existing tests cover this case. Let's add it back with a TODO to move it to DropNameSpaceSuite in the future when we have one.

test("describe namespace") {
val sql1 = "DESCRIBE NAMESPACE EXTENDED a.b"
val sql2 = "DESCRIBE NAMESPACE a.b"
val sql3 = "DESCRIBE NAMESPACE cat.`database`"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's test that DESCRIBE DATABASE, DESCRIBE SCHEMA also work

@SparkQA
Copy link

SparkQA commented Oct 25, 2021

Test build #144583 has finished for PR 34305 at commit cecd0a6.

  • This patch fails Scala style tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Oct 25, 2021

Kubernetes integration test unable to build dist.

exiting with code: 1
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/49054/

@SparkQA
Copy link

SparkQA commented Oct 25, 2021

Test build #144595 has started for PR 34305 at commit a8820ab.

@imback82
Copy link
Contributor Author

retest this please

@SparkQA
Copy link

SparkQA commented Oct 26, 2021

Test build #144624 has started for PR 34305 at commit a8820ab.

@SparkQA
Copy link

SparkQA commented Oct 26, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/49094/

@SparkQA
Copy link

SparkQA commented Oct 26, 2021

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/49094/

@imback82
Copy link
Contributor Author

@cloud-fan
Copy link
Contributor

thanks, merging to master!

@cloud-fan cloud-fan closed this in d2aeba6 Oct 27, 2021
cloud-fan pushed a commit that referenced this pull request Nov 17, 2021
### What changes were proposed in this pull request?

1. Move SHOW TBLPROPERTIES parsing tests to `ShowTblPropertiesParserSuite`.
2. Define the class `command.ShowTblPropertiesSuiteBase` that is parent of `v1.ShowTblPropertiesSuiteBase` and `v2.ShowTblPropertiesSuite`.
3. Define the class `v1.ShowTblPropertiesSuiteBase` that is parent of `v1.ShowTblPropertiesSuite` and `hive.execution.command.ShowTblPropertiesSuite`.
4. move test case from `DataSourceV2SQLSessionCatalogSuite` to `command.ShowTblPropertiesSuiteBase` to run for V2/V1/HIVE V1
5. move some test case from `HiveCommandSuite` to `command.ShowTblPropertiesSuiteBase`
6. move some test case from `HiveCommandSuite` to `v1.ShowTblPropertiesSuiteBase ` to run for V1/HIVE V1
7. Add two test case for `v1.ShowTblPropertiesSuite ` for view.

The changes follow the approach of [#30287](#30287) [#34305](#34305)

### Why are the changes needed?
1. The unification will allow to run common `SHOW TBLPROPERTIES` tests for both DSv1/Hive DSv1 and DSv2
2. We can detect missing features and differences between DSv1 and DSv2 implementations.

### Does this PR introduce _any_ user-facing change?
No

### How was this patch tested?
By running v1/v2 and Hive v1 ShowTblPropertiesSuite:

$  build/sbt -Phive-2.3 -Phive-thriftserver "test:testOnly *ShowTblPropertiesSuite"

Closes #34476 from Peng-Lei/SPARK-37195.

Authored-by: PengLei <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>
cloud-fan pushed a commit that referenced this pull request Jan 13, 2022
### What changes were proposed in this pull request?
unify test case:

1. Move the testcase from `DDLParserSuite.scala` to `ShowCreateTableParserSuite.scala`.
2. Move the testcase from `DataSourceV2SQLSuite` to `v2.ShowCreateTableSuite`.
    If the test case also work with V1/Hive, then move to ShowCreateTableSuiteBase
3. Move the testcase from  `sql/ShowCreateTableSuite.scala` to `v1.ShowCreateTableSuite`
    If the test case also work with Hive, then move to `v1.ShowCreateTableSuiteBase`
    If the test case also work with V2/Hive, then move to `ShowCreateTableSuiteBase`
4. Move the testcase from `HiveShowCreateTableSuite` to `hive.ShowCreateTableSuite`
    If the test case also work with V1/V2, then move to `ShowCreateTableSuiteBase`
    If the test case also work with V1, then move to `v1.ShowCreateTableSuiteBase`
5. Use `getShowCreateDDL` instead of `checkCreateTable` to check the result.

fix diff behavior:

1. Add one space after `create table xxx` for the command `SHOW CREATE TABLE AS SERDE` to unify the output.
2. Add one space after `OPTIONS` for v2 command `SHOW CREATE TABLE` to unify the output.

The changes follow the approach of [#30287](#30287) [#34305](#34305)

### Why are the changes needed?

1. The unification will allow to run common `SHOW CREATE TABLE` tests for both DSv1/Hive DSv1 and DSv2
2. We can detect missing features and differences between DSv1 and DSv2 implementations.

### Does this PR introduce _any_ user-facing change?
No

### How was this patch tested?
$  build/sbt -Phive-2.3 -Phive-thriftserver "test:testOnly *ShowCreateTableSuite"

Closes #34719 from Peng-Lei/SPARK-37381.

Authored-by: PengLei <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>
dchvn pushed a commit to dchvn/spark that referenced this pull request Jan 19, 2022
### What changes were proposed in this pull request?
unify test case:

1. Move the testcase from `DDLParserSuite.scala` to `ShowCreateTableParserSuite.scala`.
2. Move the testcase from `DataSourceV2SQLSuite` to `v2.ShowCreateTableSuite`.
    If the test case also work with V1/Hive, then move to ShowCreateTableSuiteBase
3. Move the testcase from  `sql/ShowCreateTableSuite.scala` to `v1.ShowCreateTableSuite`
    If the test case also work with Hive, then move to `v1.ShowCreateTableSuiteBase`
    If the test case also work with V2/Hive, then move to `ShowCreateTableSuiteBase`
4. Move the testcase from `HiveShowCreateTableSuite` to `hive.ShowCreateTableSuite`
    If the test case also work with V1/V2, then move to `ShowCreateTableSuiteBase`
    If the test case also work with V1, then move to `v1.ShowCreateTableSuiteBase`
5. Use `getShowCreateDDL` instead of `checkCreateTable` to check the result.

fix diff behavior:

1. Add one space after `create table xxx` for the command `SHOW CREATE TABLE AS SERDE` to unify the output.
2. Add one space after `OPTIONS` for v2 command `SHOW CREATE TABLE` to unify the output.

The changes follow the approach of [apache#30287](apache#30287) [apache#34305](apache#34305)

### Why are the changes needed?

1. The unification will allow to run common `SHOW CREATE TABLE` tests for both DSv1/Hive DSv1 and DSv2
2. We can detect missing features and differences between DSv1 and DSv2 implementations.

### Does this PR introduce _any_ user-facing change?
No

### How was this patch tested?
$  build/sbt -Phive-2.3 -Phive-thriftserver "test:testOnly *ShowCreateTableSuite"

Closes apache#34719 from Peng-Lei/SPARK-37381.

Authored-by: PengLei <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants