You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Incorrect results with parquet filtering pushdown enabled #4005
I wonder if this relates to pushing down an empty projection, it is possible there is a bug there, I don't remember seeing a test in arrow-rs for this.
Ok so the bug is that DatafusionArrowPredicate is assuming that ProjectionMask is order preserving, and so is not remapping the columns before passing them to PhysicalExpr. In reality ProjectionMask is not order preserving, and so the batch passed to ArrowPredicate::evaluate has columns in the order of the file's schema. In the case of this query, this results in it evaluating the predicates against the wrong columns, resulting in no rows that pass the predicate.
You can see this, by reordering the predicates in the query
select count(*) from foo where pod = 'aqcathnxqsphdhgjtgvxsfyiwbmhlmg' OR container = 'backend_container_0';
+-----------------+
| COUNT(UInt8(1)) |
+-----------------+
| 39982 |
+-----------------+
1 row in set. Query took 0.107 seconds.
Activity
tustvold commentedon Oct 29, 2022
I wonder if this relates to pushing down an empty projection, it is possible there is a bug there, I don't remember seeing a test in arrow-rs for this.
Edit: Sadly not 😢
Edit Edit: I think I have found it
tustvold commentedon Oct 29, 2022
Ok so the bug is that
DatafusionArrowPredicateis assuming thatProjectionMaskis order preserving, and so is not remapping the columns before passing them toPhysicalExpr. In realityProjectionMaskis not order preserving, and so the batch passed toArrowPredicate::evaluatehas columns in the order of the file's schema. In the case of this query, this results in it evaluating the predicates against the wrong columns, resulting in no rows that pass the predicate.You can see this, by reordering the predicates in the query
This is likely also the issue behind #4006
Project columns within DatafusionArrowPredicate (apache#4005) (apache…
Fix predicate pushdown bugs: project columns within DatafusionArrowPr…
alamb commentedon Oct 31, 2022
Thank you for debugging / fixing this @tustvold
Fix predicate pushdown bugs: project columns within DatafusionArrowPr…
Fix predicate pushdown bugs: project columns within DatafusionArrowPr…