public class DeletePartitionUtils extends Object
| Constructor and Description |
|---|
DeletePartitionUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
checkForPendingTableServiceActions(HoodieTable table,
List<String> partitionsToDrop)
Check if there are any pending table service actions (requested + inflight) on a table affecting the partitions to
be dropped.
|
public static void checkForPendingTableServiceActions(HoodieTable table, List<String> partitionsToDrop)
This check is to prevent a drop-partition from proceeding should a partition have a table service action in the pending stage. If this is allowed to happen, the filegroup that is an input for a table service action, might also be a candidate for being replaced. As such, when the table service action and drop-partition commits are committed, there will be two commits replacing a single filegroup.
For example, a timeline might have an execution order as such: 000.replacecommit.requested (clustering filegroup_1 + filegroup_2 -> filegroup_3) 001.replacecommit.requested, 001.replacecommit.inflight, 0001.replacecommit (drop_partition to replace filegroup_1) 000.replacecommit.inflight (clustering is executed now) 000.replacecommit (clustering completed) For an execution order as shown above, 000.replacecommit and 001.replacecommit will both flag filegroup_1 to be replaced. This will cause downstream duplicate key errors when a map is being constructed.
table - Table to perform validation onpartitionsToDrop - List of partitions to dropCopyright © 2023 The Apache Software Foundation. All rights reserved.