Skip to content

Conversation

@MaxGekk
Copy link
Member

@MaxGekk MaxGekk commented Nov 7, 2020

What changes were proposed in this pull request?

In the PR, I propose to gather common SHOW TABLES tests into one trait org.apache.spark.sql.execution.command.ShowTablesSuite, and put datasource specific tests to the v1.ShowTablesSuite and v2.ShowTablesSuite. Also tests for parsing SHOW TABLES are extracted to ShowTablesParserSuite.

Why are the changes needed?

  • The unification will allow to run common SHOW TABLES tests for both DSv1 and DSv2
  • 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 new test suites:

  • org.apache.spark.sql.execution.command.v1.ShowTablesSuite
  • org.apache.spark.sql.execution.command.v2.ShowTablesSuite
  • ShowTablesParserSuite

@cloud-fan
Copy link
Contributor

thanks, merging to master!

@cloud-fan cloud-fan closed this in 1e2eeda Nov 11, 2020
cloud-fan pushed a commit that referenced this pull request Nov 13, 2020
### What changes were proposed in this pull request?
1. Create the separate test suite `org.apache.spark.sql.hive.execution.command.ShowTablesSuite`.
2. Re-use V1 SHOW TABLES tests added by #30287 in the Hive test suites.
3. Add new test case for the pattern `'table_name_1*|table_name_2*'` in the common test suite.

### Why are the changes needed?
To test V1 + common  SHOW TABLES tests in Hive.

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

### How was this patch tested?
By running v1/v2 and Hive v1 `ShowTablesSuite`:
```
$  build/sbt -Phive-2.3 -Phive-thriftserver "test:testOnly *ShowTablesSuite"
```

Closes #30340 from MaxGekk/show-tables-hive-tests.

Authored-by: Max Gekk <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>
cloud-fan pushed a commit that referenced this pull request Nov 16, 2020
### What changes were proposed in this pull request?
1. Move `SHOW PARTITIONS` parsing tests to `ShowPartitionsParserSuite`
2. Place Hive tests for `SHOW PARTITIONS` from `HiveCommandSuite` to the base test suite `v1.ShowPartitionsSuiteBase`. This will allow to run the tests w/ and w/o Hive.

The changes follow the approach of #30287.

### Why are the changes needed?
- The unification will allow to run common `SHOW PARTITIONS` tests for both DSv1 and Hive DSv1, DSv2
- 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:
- new test suites `build/sbt -Phive-2.3 -Phive-thriftserver "test:testOnly *ShowPartitionsSuite"`
- and old one `build/sbt -Phive-2.3 -Phive-thriftserver "test:testOnly org.apache.spark.sql.hive.execution.HiveCommandSuite"`

Closes #30377 from MaxGekk/unify-dsv1_v2-show-partitions-tests.

Authored-by: Max Gekk <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>
dongjoon-hyun pushed a commit that referenced this pull request Jan 5, 2021
…rceV2SQLSuite.scala

### What changes were proposed in this pull request?

After #30287, `runShowTablesSql()` in `DataSourceV2SQLSuite.scala` is no longer used. This PR removes the unused method.

### Why are the changes needed?

To remove unused method.

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

No

### How was this patch tested?

Existing test.

Closes #31022 from imback82/33382-followup.

Authored-by: Terry Kim <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
@MaxGekk MaxGekk deleted the unify-dsv1_v2-tests branch February 19, 2021 15:03
cloud-fan added a commit that referenced this pull request Oct 27, 2021
### 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.

Closes #34305 from imback82/migrate_desc_namespace.

Lead-authored-by: Terry Kim <[email protected]>
Co-authored-by: Wenchen Fan <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>
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 Nov 25, 2021
…tests

### What changes were proposed in this pull request?

1. Move `ALTER NAMESPACE ... SET LOCATION` parsing tests to `AlterNamespaceSetLocationParserSuite`.
2. Put common `ALTER NAMESPACE ... SET LOCATION` tests into one trait `org.apache.spark.sql.execution.command.AlterNamespaceSetLocationSuiteBase`, and put datasource specific tests to the `v1.AlterNamespaceSetLocationSuite` and `v2.AlterNamespaceSetLocationSuite`.

The changes follow the approach of #30287.

### Why are the changes needed?

1. The unification will allow to run common `ALTER NAMESPACE ... SET LOCATION` 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.

Closes #34610 from imback82/alter_namespace_set_loation_tests2.

Authored-by: Terry Kim <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>
cloud-fan pushed a commit that referenced this pull request Dec 7, 2021
### What changes were proposed in this pull request?
1. Move the `DROP NAMESPACE` parsing tests from `DDLParserSuite` to `DropNamespaceParserSuite`
2. Define the class `command.DropNamespaceSuiteBase` that is parent of `v1.DropNamespaceSuiteBase` and `v2.DropNamespaceSuite`.
3. Define the class `v1.DropNamespaceSuiteBase` that is parent of `v1.DropNamespaceSuite` and `hive.execution.command.DropNamespaceSuite`.
4. Place the v1 tests for `DROP NAMESPACE` from `DDLSuite` and v2 tests from `DataSourceV2SQLSuite` to the common trait `DropNamespaceSuiteBase`.
5. Move TODO test from `DescribeNamespaceSuiteBase` to `v1.DropNamespaceSuiteBase` and `v2.DropNamespaceSuite`

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

### Why are the changes needed?
1. The unification will allow to run common `DROP 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?
v1/v2 and Hive v1 DropNamespaceSuite:

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

Closes #34819 from dchvn/unify-drop-namespace-tests.

Authored-by: dch nguyen <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>
cloud-fan pushed a commit that referenced this pull request Dec 13, 2021
…S tests

### What changes were proposed in this pull request?

1. Move `ALTER NAMESPACE ... SET PROPERTIES` parsing tests to `AlterNamespaceSetPropertiesParserSuite`.
2. Put common `ALTER NAMESPACE ... SET PROPERTIES` tests into one trait `org.apache.spark.sql.execution.command.AlterNamespaceSetPropertiesSuiteBase`, and put datasource specific tests to the `v1.AlterNamespaceSetPropertiesSuite` and `v2.AlterNamespaceSetPropertiesSuite`.

The changes follow the approach of #30287.

### Why are the changes needed?

1. The unification will allow to run common `ALTER NAMESPACE ... SET PROPERTIES` 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.

Closes #34842 from imback82/alter_namespace_set_properties_tests.

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

1. Move `CREATE NAMESPACE` parsing tests to `CreateNamespaceParserSuite`.
2. Put common `CREATE NAMESPACE` tests into one trait `org.apache.spark.sql.execution.command.CreateNamespaceSuiteBase`, and put datasource specific tests to the `v1.CreateNamespaceSuite` and `v2.CreateNamespaceSuite`.

The changes follow the approach of #30287.

### Why are the changes needed?

1. The unification will allow to run common `CREATE 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.

Closes #35093 from imback82/v2_create_namespace.

Authored-by: Terry Kim <[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]>
MaxGekk added a commit that referenced this pull request Jun 21, 2022
### What changes were proposed in this pull request?
1. Move `DESCRIBE TABLE` parsing tests to `DescribeRelationParserSuite`.
2. Put common `DESCRIBE TABLE` tests into one trait `org.apache.spark.sql.execution.command.DescribeTableSuiteBase`, and put datasource specific tests to the `v1.DescribeTableSuite` and `v2.DescribeTableSuite`.

The changes follow the approach of #30287.

Closes #36671.

### Why are the changes needed?
1. The unification will allow to run common `DESCRIBE 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?
By running the modified test suites:
```
$ build/sbt "testOnly *DDLParserSuite"
$ build/sbt -Phive-2.3 -Phive-thriftserver "test:testOnly *HiveDDLSuite"
```
and new test suites:
```
$ build/sbt "sql/test:testOnly *DescribeTableParserSuite"
$ build/sbt -Phive-2.3 -Phive-thriftserver "test:testOnly *DescribeTableSuite"
```

Closes #36912 from MaxGekk/unify-describe-table-tests-4.

Authored-by: Max Gekk <[email protected]>
Signed-off-by: Max Gekk <[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