Skip to content
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

Sort values before the search #11809

Open
rui-mo opened this issue Dec 10, 2024 · 1 comment
Open

Sort values before the search #11809

rui-mo opened this issue Dec 10, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@rui-mo
Copy link
Collaborator

rui-mo commented Dec 10, 2024

Description

I notice unexpected result for testing range when values are not sorted.

velox/velox/type/Filter.cpp

Lines 1089 to 1092 in 386fed7

auto lo = std::lower_bound(
nonNegated_->values().begin(), nonNegated_->values().end(), min);
auto hi = std::lower_bound(
nonNegated_->values().begin(), nonNegated_->values().end(), max);

It appears that values are not meant to be pre-sorted as the parameter of 'NegatedBigintValuesUsingHashTable', based on the implementation of 'ExprToSubfieldFilterParser::makeInFilter'. I believe that sorting values before searching with 'lower_bound' will resolve this problem. If this is the case, I'd be happy to open a fix for it.

@rui-mo rui-mo added the enhancement New feature or request label Dec 10, 2024
@rui-mo
Copy link
Collaborator Author

rui-mo commented Dec 10, 2024

@Yuhta Would you help share your thoughts? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant