Skip to content

HIVE-28911: Improve SEARCH expansion to exploit <> operator#6503

Open
rubenada wants to merge 3 commits into
apache:masterfrom
rubenada:HIVE-28911
Open

HIVE-28911: Improve SEARCH expansion to exploit <> operator#6503
rubenada wants to merge 3 commits into
apache:masterfrom
rubenada:HIVE-28911

Conversation

@rubenada
Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Improve SEARCH expansion to exploit <> operator.
SEARCH operator can be used to represent many types of range predicates including the inequality operator (<>).
For example d_dom <> 10 and d_dom <> 20 can be represented as SEARCH($9, Sarg[(-∞..10), (10..20), (20..+∞)]).
Currently, after SEARCH expansion the following expression will be generated: OR(<($9, 10), >($9, 20), AND(>($9, 10), <($9, 20))); with the proposed change we shall get the original (and simpler) AND(<>($9, 10), <>($9, 20)).

Why are the changes needed?

Exploit the inequality operator when expanding ranges to generate simpler and slightly more efficient expressions.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Unit test added.

@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants