voonhous commented on issue #7663:
URL: https://github.com/apache/hudi/issues/7663#issuecomment-1381263841
Not sure if this is the correct approach , but should we prevent users from
dropping a partition if there's a pending table service action on partition
path?
```java
// ensure that there are no pending inflight clustering/compaction
operations involving this partition
SyncableFileSystemView fileSystemView = (SyncableFileSystemView)
table.getSliceView();
List<String> partitionPathsWithPendingInflightTableServiceActions = Stream
.concat(fileSystemView.getPendingCompactionOperations(),
fileSystemView.getPendingLogCompactionOperations())
.map(op -> op.getRight().getPartitionPath())
.distinct()
.collect(Collectors.toList());
partitionPathsWithPendingInflightTableServiceActions.addAll(
fileSystemView.getFileGroupsInPendingClustering()
.map(x -> x.getKey().getPartitionPath())
.collect(Collectors.toList()));
if
(partitions.stream().anyMatch(partitionPathsWithPendingInflightTableServiceActions::contains))
{
throw new HoodieDeletePartitionException("Failed to drop partitions for
commit time [" + instantTime + "]. "
+ "Please ensure that there are no pending table service actions
(clustering/compaction) for the "
+ "partitions to be deleted: " + partitions);
}
```
--
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]