-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Changes from 3 commits
4df21ff
a05e9f4
803b456
09ee90c
91fb0e9
535cb16
bab7e45
8b5b244
3b7878a
a85518b
9da0ca5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,10 +69,21 @@ trait PaimonPartitionManagement extends SupportsAtomicPartitionManagement { | |
case fileStoreTable: FileStoreTable => | ||
val partitions = toPaimonPartitions(rows).map(_.asInstanceOf[JMap[String, String]]) | ||
val commit: FileStoreCommit = fileStoreTable.store.newCommit(UUID.randomUUID.toString) | ||
var metastoreClient: MetastoreClient = null | ||
val clientFactory = fileStoreTable.catalogEnvironment().metastoreClientFactory | ||
try { | ||
commit.dropPartitions(partitions.toSeq.asJava, BatchWriteBuilder.COMMIT_IDENTIFIER) | ||
// syn to metastore with delete partitions | ||
if (clientFactory != null) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should check There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
metastoreClient = clientFactory.create() | ||
toPaimonPartitions(rows).foreach(metastoreClient.deletePartition) | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. delete excess blank line |
||
} finally { | ||
commit.close() | ||
if (metastoreClient != null) { | ||
metastoreClient.close() | ||
} | ||
} | ||
true | ||
|
||
|
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.
sync