chenjian2664 commented on code in PR #10959:
URL: https://github.com/apache/paimon/pull/10959#discussion_r4451802783


##########
paimon-core/src/main/java/org/apache/paimon/operation/RawFileSplitRead.java:
##########
@@ -146,6 +150,13 @@ public SplitRead<InternalRow> withReadType(RowType 
readRowType) {
     public RawFileSplitRead withFilter(Predicate predicate) {
         if (predicate != null) {
             this.filters = splitAnd(predicate);
+            if (rowTrackingEnabled) {
+                // Row ids and sequence numbers may only be in the file meta, 
not in the file.
+                List<Predicate> pushed =
+                        excludePredicateWithFields(filters, 
ROW_TRACKING_FIELD_NAMES);

Review Comment:
   Agreed, thanks for the reproducer. `excludePredicateWithFields` drops a 
conjunct only when every field it references is excluded, so a mixed input like 
`SUBSTRING(s, _ROW_ID, 1)` stayed pushed down. I added 
`PredicateBuilder.excludePredicateReferencingFields`, which drops a conjunct 
when it references any of the given fields. The file reader and the scan-side 
stats filter both use it now, so they apply the same rule. A mixed conjunct is 
now marked residual and also disables the early TopN and limit. 
`excludePredicateWithFields` keeps its current behavior for its other callers. 
The new test covers the transform, the schema change and `LIMIT 1` together.



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