Skip to content

Conversation

@MaxGekk
Copy link
Member

@MaxGekk MaxGekk commented Dec 16, 2020

What changes were proposed in this pull request?

Throw NoSuchPartitionsException from ALTER TABLE .. DROP PARTITION for not existing partitions of a table in V1 Hive external catalog.

Why are the changes needed?

The behaviour of Hive external catalog deviates from V1/V2 in-memory catalogs that throw NoSuchPartitionsException. To improve user experience with Spark SQL, it would be better to throw the same exception.

Does this PR introduce any user-facing change?

Yes, the command throws NoSuchPartitionsException instead of the general exception AnalysisException.

How was this patch tested?

By running new UT via:

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

Authored-by: Max Gekk max.gekk@gmail.com
Signed-off-by: HyukjinKwon gurwls223@apache.org
(cherry picked from commit 3dfdcf4)
Signed-off-by: Max Gekk max.gekk@gmail.com

…atalog.dropPartitions()

Throw `NoSuchPartitionsException` from `ALTER TABLE .. DROP TABLE` for not existing partitions of a table in V1 Hive external catalog.

The behaviour of Hive external catalog deviates from V1/V2 in-memory catalogs that throw `NoSuchPartitionsException`. To improve user experience with Spark SQL, it would be better to throw the same exception.

Yes, the command throws `NoSuchPartitionsException` instead of the general exception `AnalysisException`.

By running tests for `ALTER TABLE .. DROP PARTITION`:
```
$ build/sbt -Phive-2.3 -Phive-thriftserver "test:testOnly *AlterTableDropPartitionSuite"
```

Closes apache#30778 from MaxGekk/hive-drop-partition-exception.

Authored-by: Max Gekk <max.gekk@gmail.com>
Signed-off-by: HyukjinKwon <gurwls223@apache.org>
(cherry picked from commit 3dfdcf4)
Signed-off-by: Max Gekk <max.gekk@gmail.com>
@MaxGekk MaxGekk changed the title [SPARK-33788][SQL][3.1] Throw NoSuchPartitionsException from HiveExternalCatalog.dropPartitions() [SPARK-33788][SQL][3.1][3.0] Throw NoSuchPartitionsException from HiveExternalCatalog.dropPartitions() Dec 16, 2020
@MaxGekk MaxGekk changed the title [SPARK-33788][SQL][3.1][3.0] Throw NoSuchPartitionsException from HiveExternalCatalog.dropPartitions() [SPARK-33788][SQL][3.1][3.0][2.4] Throw NoSuchPartitionsException from HiveExternalCatalog.dropPartitions() Dec 16, 2020
@github-actions github-actions bot added the SQL label Dec 16, 2020
@SparkQA
Copy link

SparkQA commented Dec 16, 2020

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

@SparkQA
Copy link

SparkQA commented Dec 16, 2020

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

@SparkQA
Copy link

SparkQA commented Dec 16, 2020

Test build #132882 has finished for PR 30802 at commit e86eeab.

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

HyukjinKwon pushed a commit that referenced this pull request Dec 16, 2020
…m HiveExternalCatalog.dropPartitions()

### What changes were proposed in this pull request?
Throw `NoSuchPartitionsException` from `ALTER TABLE .. DROP TABLE` for not existing partitions of a table in V1 Hive external catalog.

### Why are the changes needed?
The behaviour of Hive external catalog deviates from V1/V2 in-memory catalogs that throw `NoSuchPartitionsException`. To improve user experience with Spark SQL, it would be better to throw the same exception.

### Does this PR introduce _any_ user-facing change?
Yes, the command throws `NoSuchPartitionsException` instead of the general exception `AnalysisException`.

### How was this patch tested?
By running new UT via:
```
$ build/sbt -Phive -Phive-thriftserver "test:testOnly *HiveDDLSuite"
```

Authored-by: Max Gekk <max.gekkgmail.com>
Signed-off-by: HyukjinKwon <gurwls223apache.org>
(cherry picked from commit 3dfdcf4)
Signed-off-by: Max Gekk <max.gekkgmail.com>

Closes #30802 from MaxGekk/hive-drop-partition-exception-3.1.

Authored-by: Max Gekk <max.gekk@gmail.com>
Signed-off-by: HyukjinKwon <gurwls223@apache.org>
HyukjinKwon pushed a commit that referenced this pull request Dec 16, 2020
…m HiveExternalCatalog.dropPartitions()

### What changes were proposed in this pull request?
Throw `NoSuchPartitionsException` from `ALTER TABLE .. DROP TABLE` for not existing partitions of a table in V1 Hive external catalog.

### Why are the changes needed?
The behaviour of Hive external catalog deviates from V1/V2 in-memory catalogs that throw `NoSuchPartitionsException`. To improve user experience with Spark SQL, it would be better to throw the same exception.

### Does this PR introduce _any_ user-facing change?
Yes, the command throws `NoSuchPartitionsException` instead of the general exception `AnalysisException`.

### How was this patch tested?
By running new UT via:
```
$ build/sbt -Phive -Phive-thriftserver "test:testOnly *HiveDDLSuite"
```

Authored-by: Max Gekk <max.gekkgmail.com>
Signed-off-by: HyukjinKwon <gurwls223apache.org>
(cherry picked from commit 3dfdcf4)
Signed-off-by: Max Gekk <max.gekkgmail.com>

Closes #30802 from MaxGekk/hive-drop-partition-exception-3.1.

Authored-by: Max Gekk <max.gekk@gmail.com>
Signed-off-by: HyukjinKwon <gurwls223@apache.org>
@HyukjinKwon
Copy link
Member

Merged to branch-3.1, branch-3.0 and branch-2.4.

HyukjinKwon pushed a commit that referenced this pull request Dec 16, 2020
…m HiveExternalCatalog.dropPartitions()

### What changes were proposed in this pull request?
Throw `NoSuchPartitionsException` from `ALTER TABLE .. DROP TABLE` for not existing partitions of a table in V1 Hive external catalog.

### Why are the changes needed?
The behaviour of Hive external catalog deviates from V1/V2 in-memory catalogs that throw `NoSuchPartitionsException`. To improve user experience with Spark SQL, it would be better to throw the same exception.

### Does this PR introduce _any_ user-facing change?
Yes, the command throws `NoSuchPartitionsException` instead of the general exception `AnalysisException`.

### How was this patch tested?
By running new UT via:
```
$ build/sbt -Phive -Phive-thriftserver "test:testOnly *HiveDDLSuite"
```

Authored-by: Max Gekk <max.gekkgmail.com>
Signed-off-by: HyukjinKwon <gurwls223apache.org>
(cherry picked from commit 3dfdcf4)
Signed-off-by: Max Gekk <max.gekkgmail.com>

Closes #30802 from MaxGekk/hive-drop-partition-exception-3.1.

Authored-by: Max Gekk <max.gekk@gmail.com>
Signed-off-by: HyukjinKwon <gurwls223@apache.org>
@MaxGekk MaxGekk deleted the hive-drop-partition-exception-3.1 branch February 19, 2021 15:04
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.

3 participants