Skip to content

Commit a2d2a75

Browse files
authored
[spark] Push down partition filter when compactUnAwareBucketTable (#6663)
1 parent 5e1d4bf commit a2d2a75

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

paimon-spark/paimon-spark-common/src/main/java/org/apache/paimon/spark/procedure/CompactProcedure.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,12 @@ private void compactUnAwareBucketTable(
387387
compactionTasks = new ArrayList<>();
388388
}
389389
if (partitionIdleTime != null) {
390+
SnapshotReader snapshotReader = table.newSnapshotReader();
391+
if (partitionPredicate != null) {
392+
snapshotReader.withPartitionFilter(partitionPredicate);
393+
}
390394
Map<BinaryRow, Long> partitionInfo =
391-
table.newSnapshotReader().partitionEntries().stream()
395+
snapshotReader.partitionEntries().stream()
392396
.collect(
393397
Collectors.toMap(
394398
PartitionEntry::partition,

0 commit comments

Comments
 (0)