Stephen0421 opened a new pull request, #9272:
URL: https://github.com/apache/paimon/pull/9272

   ### Purpose
   
   `HiveCatalog.dropPartitions` uses `removePartitionsExistsInOtherBranches` to 
keep a Hive metastore partition when another branch still has it. For chain 
tables and `scan-fallback-branch` tables, `switchToBranch` keeps the original 
fallback, so `newScan().listPartitions()` merged snapshot/delta (or fallback) 
data into the target branch. Dropping a partition from snapshot/delta therefore 
treated that data as still present on main, and the HMS partition was never 
deleted.
   
   This change lists partitions on the physical branch only 
(`FallbackReadFileStoreTable.wrapped()` after `switchToBranch`). HMS is dropped 
when no other physical branch still has the partition, and kept when one does.
   
   ### Test
   
   - `HiveCatalogTest#testDropPartitionsOnChainTableDoesNotSkipHmsByFallback`
     - Drop from snapshot when only snapshot has the partition → HMS is dropped
     - Drop from snapshot while delta still has it → HMS is kept
     - Drop from delta after snapshot is gone → HMS is dropped
     - Drop from main when only main has it → HMS is dropped
     - Drop from main while snapshot still has it → HMS is kept
   - 
`HiveCatalogTest#testDropPartitionsOnFallbackBranchTableDoesNotSkipHmsByFallback`
     - Same physical-vs-fallback behavior for `scan-fallback-branch`


-- 
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