Skip to content

Issue 3269 Fix incorrect OR evaluation when multiples ORs are optimized to IN #3339

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

Merged
merged 2 commits into from
Oct 10, 2018

Conversation

liuyimin-bytedance
Copy link
Contributor

#3269 In this case when multiple equality evaluation are bundled into one IN set evaluation, since tuple_function is generated from optimizer, it doesn't have a proper range which is later used as indexation key for prepared set.
Add fake range for tuple ASTFunction generated by Optimizer so that prepared set indexation works correctly.

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

/// Get range min/max from all literals x1...xN, which will be used as tuple_functions' range
if (min_range_first == nullptr || min_range_first > operands[1]->range.first)
min_range_first = operands[1]->range.first;
if (max_range_second < operands[1]->range.second)
Copy link
Member

Choose a reason for hiding this comment

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

@alexey-milovidov alexey-milovidov merged commit 34bd856 into ClickHouse:master Oct 10, 2018
@alexey-milovidov
Copy link
Member

Thank you!

PS. Maybe we should get rid of AST range and use something other for prepared sets indexation.

@alexey-milovidov
Copy link
Member

Please add a test in separate PR.

@alexey-milovidov
Copy link
Member

Why don't add a test?

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

Successfully merging this pull request may close these issues.

2 participants