-
Notifications
You must be signed in to change notification settings - Fork 1.4k
fix: Avoid throw exception in toSubfieldFilter #15359
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 |
|---|---|---|
|
|
@@ -536,8 +536,16 @@ std::pair<common::Subfield, std::unique_ptr<common::Filter>> toSubfieldFilter( | |
| if (auto call = asCall(expr.get())) { | ||
| if (call->name() == "or") { | ||
| auto left = toSubfieldFilter(call->inputs()[0], evaluator); | ||
| if (!left.second) { | ||
| return {}; | ||
| } | ||
| auto right = toSubfieldFilter(call->inputs()[1], evaluator); | ||
| VELOX_CHECK(left.first == right.first); | ||
| if (!right.second) { | ||
| return {}; | ||
| } | ||
| if (left.first != right.first) { | ||
|
Contributor
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. Let's make sure to add tests for this logic. |
||
| return {}; | ||
| } | ||
| return { | ||
| std::move(left.first), | ||
| makeOrFilter(std::move(left.second), std::move(right.second))}; | ||
|
|
@@ -559,8 +567,7 @@ std::pair<common::Subfield, std::unique_ptr<common::Filter>> toSubfieldFilter( | |
| return std::make_pair(std::move(subfield), std::move(filter)); | ||
| } | ||
| } | ||
| VELOX_UNSUPPORTED( | ||
| "Unsupported expression for range filter: {}", expr->toString()); | ||
| return {}; | ||
|
Contributor
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. It might be clearer to change return type to std::optional and return std::nullptr.
Collaborator
Author
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. I think it's worse. |
||
| } | ||
|
|
||
| } // namespace facebook::velox::exec | ||
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 wonder if we should remove the logic for handling "or"... I don't think Axiom expects that logic.