heye1005 opened a new issue, #7792:
URL: https://github.com/apache/paimon/issues/7792

   ### Search before asking
   
   - [x] I searched in the [issues](https://github.com/apache/paimon/issues) 
and found nothing similar.
   
   
   ### Motivation
   
   ## Search before asking
   
   - [x] I had searched in the 
[issues](https://github.com/apache/paimon/issues) and found no similar issues.
   
   ## Motivation
   
   `PartitionsRead.withFilter` and `FilesRead.withFilter` are currently no-op
   stubs marked `// TODO`. As a result, predicates on system tables such as
   `SELECT * FROM t$files WHERE schema_id = 0` rely entirely on the upstream
   engine to filter the result, even though the source could prune rows
   much earlier.
   
   ## Solution
   
   Apply the predicate as a post-filter on the materialized row before 
projection.
   
   For `FilesRead`, leaves referencing `partition` / `bucket` / `level` need to
   be stripped because they are already pushed down by `FilesScan` — 
re-evaluating
   them on the materialized row may throw ClassCastException due to type 
mismatch
   (e.g. a String literal vs the BinaryString in the row).
   
   `PartitionsRead` keeps the predicate as-is because `PartitionsScan` does not
   push anything down and `PartitionsTable` schema does not contain `bucket`
   / `level` columns.
   
   POC ready (already implemented locally with tests, will open PR once 
assigned).
   
   ## Anything else?
   
   No.
   
   ## Are you willing to submit a PR?
   
   - [x] I'm willing to submit a PR!
   
   
   ### Solution
   
   _No response_
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [ ] I'm willing to submit a PR!


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