wwj6591812 commented on code in PR #4339:
URL: https://github.com/apache/paimon/pull/4339#discussion_r1803409048


##########
paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/PaimonPartitionManagement.scala:
##########
@@ -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) {
+            metastoreClient = clientFactory.create()
+            toPaimonPartitions(rows).foreach(metastoreClient.deletePartition)
+          }
+

Review Comment:
   delete excess blank line



##########
paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/PaimonPartitionManagement.scala:
##########
@@ -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

Review Comment:
   sync



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to