[BugFix] Fix bin/chart NPE with null values (#5174)#24
Closed
qianheng-aws wants to merge 2 commits intorefactor/dedupe-reusable-workflowfrom
Closed
[BugFix] Fix bin/chart NPE with null values (#5174)#24qianheng-aws wants to merge 2 commits intorefactor/dedupe-reusable-workflowfrom
qianheng-aws wants to merge 2 commits intorefactor/dedupe-reusable-workflowfrom
Conversation
…pensearch-project#5269) (opensearch-project#5293) When querying across indices with conflicting field mappings (boolean vs text), numeric values like 0 were not coerced to boolean, causing "node must be a boolean, found NUMBER" error. Added numeric handling to parseBooleanValue() consistent with ObjectContent.booleanValue(). Signed-off-by: Heng Qian <qianheng@amazon.com>
The bin bucket functions (SpanBucketFunction, MinspanBucketFunction, RangeBucketFunction) declared a non-nullable VARCHAR return type via ReturnTypes.VARCHAR_2000, even though they return null for null inputs. This caused Calcite's optimizer to remove IS NOT NULL filters as trivially true, allowing null group keys to reach the Enumerable aggregation's TreeMap, which crashed with NPE in compareTo. Fix the return type to be nullable using FORCE_NULLABLE, so the null-filtering logic in visitAggregation works correctly. Also add nullsLast to chart command sorts as a defensive measure. Signed-off-by: Heng Qian <qianheng@amazon.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
binthenchartwith null values in the binned fieldFORCE_NULLABLEso null-filtering in visitAggregation works correctlynullsLastto chart command sorts as a defensive measureResolves opensearch-project#5174
Test plan