-
Notifications
You must be signed in to change notification settings - Fork 28.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-33787][SQL] Allow partition purge for v2 tables #30886
Conversation
@cloud-fan @HyukjinKwon Could you, please, review this PR. |
Kubernetes integration test starting |
Kubernetes integration test starting |
Kubernetes integration test status success |
Kubernetes integration test status success |
Test build #133206 has finished for PR 30886 at commit
|
The failure #30886 (comment) is not related to PR's changes, I hope:
|
jenkins, retest this, please |
.../src/main/java/org/apache/spark/sql/connector/catalog/SupportsAtomicPartitionManagement.java
Show resolved
Hide resolved
* @throws UnsupportedOperationException If partition purging is not supported | ||
*/ | ||
boolean purgePartitions(InternalRow[] idents) | ||
throws NoSuchPartitionException, UnsupportedOperationException; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for backward compatibility, let's give a default implementation that fails.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For backward compatibility with what? The interface is not released as far as I know or I am wrong?
Test build #133204 has finished for PR 30886 at commit
|
Kubernetes integration test starting |
Kubernetes integration test status success |
Test build #133212 has finished for PR 30886 at commit
|
Test build #133224 has finished for PR 30886 at commit
|
### What changes were proposed in this pull request? This is a followup of #30267 Inspired by #30886, it's better to have 2 methods `def dropTable` and `def purgeTable`, than `def dropTable(ident)` and `def dropTable(ident, purge)`. ### Why are the changes needed? 1. make the APIs orthogonal. Previously, `def dropTable(ident, purge)` calls `def dropTable(ident)` and is a superset. 2. simplifies the catalog implementation a little bit. Now the `if (purge) ... else ...` check is done at the Spark side. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? existing tests Closes #30890 from cloud-fan/purgeTable. Authored-by: Wenchen Fan <wenchen@databricks.com> Signed-off-by: HyukjinKwon <gurwls223@apache.org>
This is a followup of #30267 Inspired by #30886, it's better to have 2 methods `def dropTable` and `def purgeTable`, than `def dropTable(ident)` and `def dropTable(ident, purge)`. 1. make the APIs orthogonal. Previously, `def dropTable(ident, purge)` calls `def dropTable(ident)` and is a superset. 2. simplifies the catalog implementation a little bit. Now the `if (purge) ... else ...` check is done at the Spark side. No. existing tests Closes #30890 from cloud-fan/purgeTable. Authored-by: Wenchen Fan <wenchen@databricks.com> Signed-off-by: HyukjinKwon <gurwls223@apache.org> (cherry picked from commit ec1560a) Signed-off-by: HyukjinKwon <gurwls223@apache.org>
thanks, merging to master! |
What changes were proposed in this pull request?
purgePartition()
/purgePartitions()
to the interfacesSupportsPartitionManagement
/SupportsAtomicPartitionManagement
.UnsupportedOperationException
.SupportsPartitionManagementSuite
/SupportsAtomicPartitionManagementSuite
.ALTER TABLE .. DROP PARTITION
tests for DS v1 and v2.Closes #30776
Closes #30821
Why are the changes needed?
Currently, the
PURGE
option that user can set inALTER TABLE .. DROP PARTITION
is completely ignored. We should pass this flag to the catalog implementation, so, the catalog should decide how to handle the flag.Does this PR introduce any user-facing change?
The changes can impact on behavior of
ALTER TABLE .. DROP PARTITION
for v2 tables.How was this patch tested?
By running the affected test suites, for instance: