Skip to content

ORC-971: [C++] Fix LESS_THAN_EQUALS doesn't handle the case when minValue equals to maxValue#883

Merged
dongjoon-hyun merged 1 commit intoapache:mainfrom
stiga-huang:fix-le-bug
Aug 26, 2021
Merged

ORC-971: [C++] Fix LESS_THAN_EQUALS doesn't handle the case when minValue equals to maxValue#883
dongjoon-hyun merged 1 commit intoapache:mainfrom
stiga-huang:fix-le-bug

Conversation

@stiga-huang
Copy link
Contributor

What changes were proposed in this pull request?

When evaluating the LESS_THAN_EQUALS predicates, the case that has identical minValue and maxValue is not handled correctly. E.g. predicate "x <= 15" on a range [15, 15] should get YES or YES_NULL results. But what we currently get is YES_NO or YES_NO_NULL. This patch fixes evaluatePredicateRange() to handle this case.

Why are the changes needed?

Described above.

How was this patch tested?

Added unit tests in c++/test/TestPredicateLeaf.cc

@github-actions github-actions bot added the CPP label Aug 26, 2021
Copy link
Member

@wgtmac wgtmac left a comment

Choose a reason for hiding this comment

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

LGTM +1

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

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

+1, LGTM. Thank you, @stiga-huang and @wgtmac .
Merged to main/1.7

@dongjoon-hyun dongjoon-hyun merged commit 1438ef6 into apache:main Aug 26, 2021
dongjoon-hyun pushed a commit that referenced this pull request Aug 26, 2021
…alue equals to maxValue (#883)

### What changes were proposed in this pull request?

When evaluating the LESS_THAN_EQUALS predicates, the case that has identical minValue and maxValue is not handled correctly. E.g. predicate "x <= 15" on a range [15, 15] should get YES or YES_NULL results. But what we currently get is YES_NO or YES_NO_NULL. This patch fixes evaluatePredicateRange() to handle this case.

### Why are the changes needed?

Described above.

### How was this patch tested?

Added unit tests in c++/test/TestPredicateLeaf.cc

(cherry picked from commit 1438ef6)
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants