Fix IS DISTINCT FROM for decimals with precision > 18#13668
Fix IS DISTINCT FROM for decimals with precision > 18#13668mbasmanova merged 1 commit intoprestodb:masterfrom
Conversation
|
@ptkool , thanks for catching the bug and adding a fix. Couple of observations
|
|
@ajaygeorge The issue is actually with decimal values with precision > 18, not 19.
Note that this issue only occurs when reading decimal values from a table and Presto creates instances of |
ajaygeorge
left a comment
There was a problem hiding this comment.
LGTM.
you might need to update Release Notes in the PR since this is a user impacting change.
Also please update the issue description in #13667 to reflect that the issue is for precision > 18
Adding @cemcayiroglu and @mbasmanova who can help review and merge this.
mbasmanova
left a comment
There was a problem hiding this comment.
@ptkool Michael, looks good. Thanks for fixing this issue. Please squash the commits and make commit message clearer. Perhaps, Fix IS DISTINCT FROM for long decimals.
There was a problem hiding this comment.
- don't use a1, a2, etc. variables names; here, I'd just inline arr1 and arr2
- static import distinctBlockPositionLongLong
@Test
public void testIsDistinctFrom()
{
Block left = new Int128ArrayBlock(1, Optional.empty(), new long[] {112L, 0L});
Block right = new Int128ArrayBlock(1, Optional.empty(), new long[] {185L, 0L});
assertFalse(distinctBlockPositionLongLong(left, 0, left, 0));
assertTrue(distinctBlockPositionLongLong(left, 0, right, 0));
}
45a4ca9 to
a7fb354
Compare
mbasmanova
left a comment
There was a problem hiding this comment.
@ptkool Looks good. Please remove the following from commit message
Add new test
Clean up based on feedback
a7fb354 to
6f212b3
Compare
|
@ptkool Michael, I noticed that you updated the PR, but commit message didn't change. You need to use |
|
@mbasmanova Commit message has been updated. Can you review this again? |
|
@ptkool Hmm... I don't see commit message updated. Here is what I see. |
6f212b3 to
aa170b8
Compare
aa170b8 to
cea8be9
Compare
|
@mbasmanova Commit message has been fixed. |
|
@ptkool Thank you for the contribution. |


The current logic in method
distinctBlockPositionLongLongcompares the left value to itself. This PR corrects this by assigning the proper values torightLowandrightHigh.Fixes #13667.