Repository navigation
feat(parquet): add statistics-based row group filtering #956
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,6 +21,7 @@ | |
|
|
||
| #include "iceberg/expression/binder.h" | ||
| #include "iceberg/expression/expression_visitor.h" | ||
| #include "iceberg/expression/rewrite_not.h" | ||
| #include "iceberg/schema.h" | ||
| #include "iceberg/util/macros.h" | ||
|
|
||
|
|
@@ -140,6 +141,7 @@ Result<std::unique_ptr<Evaluator>> Evaluator::Make(const Schema& schema, | |
| std::shared_ptr<Expression> unbound, | ||
| bool case_sensitive) { | ||
| ICEBERG_ASSIGN_OR_RAISE(auto bound_expr, Binder::Bind(schema, unbound, case_sensitive)); | ||
| ICEBERG_ASSIGN_OR_RAISE(bound_expr, RewriteNot::Visit(bound_expr)); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For non-equal UUIDs, So for |
||
| return std::unique_ptr<Evaluator>(new Evaluator(std::move(bound_expr))); | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two evaluators now disagree on the same row.
Suppose a file uses
identity(key)partitioning. Its partition value is null, and it contains this row:The filter is
NOT(key < 100) OR value = 5.Evaluatorrewrites the filter tokey >= 100 OR value = 5. Both checks return false for this row, so the row does not match.ResidualEvaluatorstill checks the original filter:key < 100returns false for the null partition value.NOT(false)becomes true.true OR value = 5becomes true for the whole file.This drops the
value = 5condition. If file statistics cannot reject the file, the reader gets atrueresidual. Any later filter using that residual will keep the row, even thoughEvaluatorrejects it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, thanks!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm. the rewrite expr doesn't seem to be the right place.
The evaluator class is the general expression evaluator, it should not rewrite not unconditionally? I think in the java side, the Evaluator just accept the unbound expr as it is, the corresponding caller, or metrics evaluator or xx evaluator rewrite not necessary.