Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions velox/expression/ExprToSubfieldFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -536,8 +536,16 @@ std::pair<common::Subfield, std::unique_ptr<common::Filter>> toSubfieldFilter(
if (auto call = asCall(expr.get())) {
if (call->name() == "or") {
Copy link
Contributor

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.

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) {
Copy link
Contributor

Choose a reason for hiding this comment

The 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))};
Expand All @@ -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 {};
Copy link
Contributor

Choose a reason for hiding this comment

The 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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's worse.
What is semantics of nullptr filter in such case?

}

} // namespace facebook::velox::exec
Loading