-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Fix NPE when indexing unparseable/missing numeric values when sortFacts=false #4509
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -199,13 +199,16 @@ public int compareUnsortedEncodedKeyComponents(Float lhs, Float rhs) | |
| @Override | ||
| public boolean checkUnsortedEncodedKeyComponentsEqual(Float lhs, Float rhs) | ||
| { | ||
| if (lhs == null) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could use Objects.equals() |
||
| return rhs == null; | ||
| } | ||
| return lhs.equals(rhs); | ||
| } | ||
|
|
||
| @Override | ||
| public int getUnsortedEncodedKeyComponentHashCode(Float key) | ||
| { | ||
| return key.hashCode(); | ||
| return key == null ? 0 : key.hashCode(); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could use Objects.hashCode() |
||
| } | ||
|
|
||
| @Override | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -199,13 +199,16 @@ public int compareUnsortedEncodedKeyComponents(Long lhs, Long rhs) | |
| @Override | ||
| public boolean checkUnsortedEncodedKeyComponentsEqual(Long lhs, Long rhs) | ||
| { | ||
| if (lhs == null) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same |
||
| return rhs == null; | ||
| } | ||
| return lhs.equals(rhs); | ||
| } | ||
|
|
||
| @Override | ||
| public int getUnsortedEncodedKeyComponentHashCode(Long key) | ||
| { | ||
| return key.hashCode(); | ||
| return key == null ? 0 : key.hashCode(); | ||
| } | ||
|
|
||
| @Override | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why null checks are needed in checkUnsortedEncodedKeyComponentsEqual() and checkUnsortedEncodedKeyComponentHashCode(), since you added it here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nulls could still appear in TimeAndDims for numeric fields when the input row is missing those columns completely, you can see an example in
testNullDimensionTransform()inincremental/IncrementalIndexTest