-
Notifications
You must be signed in to change notification settings - Fork 1.4k
perf: Improve expr to subfield filters #15361
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?
perf: Improve expr to subfield filters #15361
Conversation
✅ Deploy Preview for meta-velox canceled.
|
ab6aac8 to
d8824ad
Compare
d8824ad to
1daf10f
Compare
| const core::TypedExprPtr& expr, | ||
| core::ExpressionEvaluator*); | ||
| core::ExpressionEvaluator* evaluator, | ||
| bool negated = false); |
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.
It looks like this PR may combine multiple changes. Some might be optimizations that do not change behavior, others are API changes. Would it be possible to split these into separate PRs and add tests for newly introduced functionality?
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.
This doesn't change API
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.
This just add recursive case, it can be implemented as separate recursive function in anonymous namespace, but why? So I think api wasn't changed
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.
This function is exposed in the header file, hence, I assume it is public API. It used to have 2 parameters, now it has 3. This seems like a change. If we do not expect users to specify the 3rd argument, then we should remove it and add a helper function to .cpp file.
I see this API wasn't documented before. Would you help document 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.
This function is exposed in the header file, hence, I assume it is public API. It used to have 2 parameters, now it has 3. This seems like a change.
It's has default value, so it's not changed, it's extended.
I see this API wasn't documented before. Would you help document it?
ok
1daf10f to
1645bdc
Compare
| return std::make_unique<common::BigintMultiRange>( | ||
| std::move(newRanges), false); | ||
| } catch (...) { | ||
| // Found overlapping ranges, fall back to MultiRange. |
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.
Log some WARNING here
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.
It's not warning? We just didn't write code that merge overlapping ranges, it doesn't mean something wrong with user request
| bool conjunction = call->name() == "and"; | ||
| if (conjunction || call->name() == "or") { | ||
| if (call->inputs().empty()) { | ||
| return {}; |
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.
Always true/false
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.
It's wrong, I made comment why.
| return bigintOr( | ||
| asUniquePtr<common::BigintRange>(std::move(a)), | ||
| asUniquePtr<common::BigintRange>(std::move(b))); | ||
| VELOX_DCHECK_NOT_NULL(a); |
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.
The change on makeOrFilter probably should be a separate PR
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.
I don't have a lot of time for this PR.
I made this in my free time, just because it was easy to fix and looks overall better.
What can we do with this?
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.
@MBkkt Maybe you can try to find someone else who'd be interested in picking up this work. Otherwise, may have to abandon.
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.
@mbasmanova I created the issue #15426
If you think better to have code with all these flaws there's nothing else what I can do without allocating additional time on this.
|
|
||
| std::unique_ptr<common::Filter> lessThanFilter = | ||
| makeLessThanFilter(valueExpr, evaluator); | ||
| switch (value->typeKind()) { |
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.
The change on makeNotEqualFilter is another PR
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.
I don't have a lot of time for this PR.
I made this in my free time, just because it was easy to fix and looks overall better.
What can we do with this?
f341c39 to
8703b32
Compare
a1db486 to
af87b76
Compare
What is done?
Different handling of
"and","or","not"Different
makeOrUse real
notEqualin more casesWhy is it good?
See Axiom tpch q19
Before
After