fix: Allow merging OR-ed bigint single value ranges #15738
+334
−7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
Since BIGINT ranges can sometimes be converted to values filters (i.e. if all the range filters are single value), sequential merging of several BIGINT ranges can cause a generic MultiRange filter to be created, which cannot be evaluated.
e.g.
(id = 100 OR id = 200 OR id = 300)is converted by HiveConnectorUtil::extractFiltersFromRemainingFilter in the following stages:
The filter is instead merged into a generic MultiRange filter with bigint ranges, which cannot be evaluated:
It appeared intentional that the generic MultiRange cannot support BigintRange evaluation, since there is a BigintMultiRange for that purpose. But an alternate fix could be to add evaluation support for bigint to MultiRange
Instead of converting to a MultiRange, merge logic should have explicit handling for BIGINT value filters so it can handle these gracefully
Also adding support for the following negative filters:
Differential Revision: D88789308