Skip to content

Commit 6ab7f9c

Browse files
sundapengclaude
andcommitted
[core] Fix null partition value mismatch in PartitionsTable filterByPredicate
filterByPredicate used raw p.spec().get(key) which renders null as literal "null", while toRow substitutes null with defaultPartitionName. This caused predicate pushdown to fail matching null-valued partitions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1116648 commit 6ab7f9c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

paimon-core/src/main/java/org/apache/paimon/table/system/PartitionsTable.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,7 @@ private List<Partition> filterByPredicate(
429429
return partitions;
430430
}
431431
List<String> partitionKeys = fileStoreTable.partitionKeys();
432+
String defaultPartitionName = fileStoreTable.coreOptions().partitionDefaultName();
432433
return partitions.stream()
433434
.filter(
434435
p -> {
@@ -437,9 +438,10 @@ private List<Partition> filterByPredicate(
437438
if (i > 0) {
438439
sb.append("/");
439440
}
441+
String value = p.spec().get(partitionKeys.get(i));
440442
sb.append(partitionKeys.get(i))
441443
.append("=")
442-
.append(p.spec().get(partitionKeys.get(i)));
444+
.append(value == null ? defaultPartitionName : value);
443445
}
444446
return partitionPredicate.test(
445447
GenericRow.of(BinaryString.fromString(sb.toString())));

0 commit comments

Comments
 (0)