Skip to content
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] Support spark DropPartition with sync metastore #4339

Merged
merged 11 commits into from
Oct 17, 2024

Conversation

xuzifu666
Copy link
Member

Purpose

Linked issue: close #xxx
Currently after paimon spark drop partition not sync to metastore like flink(#3411), this pr is aim to support it.

Tests

API and Format

Documentation

try {
commit.dropPartitions(partitions.toSeq.asJava, BatchWriteBuilder.COMMIT_IDENTIFIER)
// syn to metastore with delete partitions
Copy link
Contributor

Choose a reason for hiding this comment

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

sync

metastoreClient = clientFactory.create()
toPaimonPartitions(rows).foreach(metastoreClient.deletePartition)
}

Copy link
Contributor

Choose a reason for hiding this comment

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

delete excess blank line

@xuzifu666
Copy link
Member Author

@wwj6591812 Thanks, had addressed

try {
commit.dropPartitions(partitions.toSeq.asJava, BatchWriteBuilder.COMMIT_IDENTIFIER)
// sync to metastore with delete partitions
if (clientFactory != null) {
Copy link
Contributor

@JingsongLi JingsongLi Oct 17, 2024

Choose a reason for hiding this comment

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

should check metastore.partitioned-table. (Please add case for disabled metastore.partitioned-table table too)

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes,had added a check for metastore.partitioned-table and case. Thanks @JingsongLi

try {
commit.dropPartitions(partitions.toSeq.asJava, BatchWriteBuilder.COMMIT_IDENTIFIER)
// sync to metastore with delete partitions
if (clientFactory != null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Also for createPartitions.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor

@JingsongLi JingsongLi left a comment

Choose a reason for hiding this comment

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

+1

@JingsongLi JingsongLi merged commit aeffc89 into apache:master Oct 17, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants