Weijun-H commented on code in PR #19136:
URL: https://github.com/apache/datafusion/pull/19136#discussion_r2616197453
##########
datafusion/datasource-parquet/src/opener.rs:
##########
@@ -176,6 +187,17 @@ impl FileOpener for ParquetOpener {
// We'll also check this after every record batch we read,
// and if at some point we are able to prove we can prune the file
using just the file level statistics
// we can end the stream early.
+ if !constant_columns.is_empty() {
+ predicate = predicate
+ .map(|expr| {
+ if is_dynamic_physical_expr(&expr) {
Review Comment:
We need to skip rewriting dynamic predicates. `DynamicFilterPhysicalExpr`
keeps its own remapped children so updates can later rebind to each file’s
schema; if we rewrite it with per-file constants here, we stash those constants
in `remapped_children` and any later update turns into that constant (and leaks
across files sharing the same dynamic filter), breaking dynamic pruning.
Non-dynamic predicates are safe to rewrite because they don’t carry shared
mutable state.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]