[BugFix] Fix bin/chart NPE with null values (#5174)#25
Closed
qianheng-aws wants to merge 17 commits intorefactor/dedupe-reusable-workflowfrom
Closed
[BugFix] Fix bin/chart NPE with null values (#5174)#25qianheng-aws wants to merge 17 commits intorefactor/dedupe-reusable-workflowfrom
qianheng-aws wants to merge 17 commits intorefactor/dedupe-reusable-workflowfrom
Conversation
Implements a 3-workflow system using claude-code-action with Bedrock OIDC: - claude-dedupe-issues.yml: detects duplicates on new issues via Claude - auto-close-duplicates.yml: daily cron closes flagged issues after 3 days - remove-autoclose-on-activity.yml: removes autoclose label on human comment Signed-off-by: Heng Qian <qianheng@amazon.com>
Signed-off-by: Heng Qian <qianheng@amazon.com>
- Detected duplicates now get `duplicate` label instead of `autoclose` - Auto-close workflow looks for `duplicate` label - After closing, adds `autoclose` label - Human comment removes `duplicate` label to prevent auto-closure - Fix state_reason to `duplicate` - Change grace period to 1 hour for testing Signed-off-by: Heng Qian <qianheng@amazon.com>
- Add backfill-duplicate-comments.yml to scan historical issues for duplicates - Add thumbs-down instruction to duplicate detection comment Signed-off-by: Heng Qian <qianheng@amazon.com>
- Detected duplicates now get `duplicate` label instead of `autoclose` - Auto-close workflow looks for `duplicate` label - After closing, adds `autoclose` label - Human comment removes `duplicate` label to prevent auto-closure - Fix state_reason to `duplicate` - Change grace period to 1 hour for testing Signed-off-by: Heng Qian <qianheng@amazon.com>
- Add backfill-duplicate-comments.yml to scan historical issues for duplicates - Add thumbs-down instruction to duplicate detection comment Signed-off-by: Heng Qian <qianheng@amazon.com>
Signed-off-by: Heng Qian <qianheng@amazon.com>
- Remove unnecessary allowed_non_write_users from dedupe workflow - Pass workflow inputs via env vars to prevent JS injection in backfill - Use bash array for REPO_FLAG to prevent word splitting in shell script Signed-off-by: Heng Qian <qianheng@amazon.com>
Backfill workflow dispatches dedupe via API as github-actions[bot], which requires explicit allowlisting in claude-code-action. Signed-off-by: Heng Qian <qianheng@amazon.com>
- Remove unnecessary allowed_non_write_users from dedupe workflow - Pass workflow inputs via env vars to prevent JS injection in backfill - Use bash array for REPO_FLAG to prevent word splitting in shell script Signed-off-by: Heng Qian <qianheng@amazon.com>
Backfill workflow dispatches dedupe via API as github-actions[bot], which requires explicit allowlisting in claude-code-action. Signed-off-by: Heng Qian <qianheng@amazon.com>
…kflow Signed-off-by: Heng Qian <qianheng@amazon.com>
Read from repo variable DUPLICATE_GRACE_DAYS (default 7) instead of hardcoded 3 days for both auto-close workflow and comment script. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…7 days) Replace hardcoded 1-hour test value on main with configurable DUPLICATE_GRACE_DAYS repo variable, defaulting to 7 days. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Heng Qian <qianheng@amazon.com>
Only consider issues with lower issue numbers as potential originals, and exclude issues already labeled duplicate from search results. 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>
Owner
Author
Decision LogRoot Cause: Bin bucket functions (SpanBucketFunction, MinspanBucketFunction, RangeBucketFunction) declared Approach: Two-part fix:
Alternatives Rejected:
Pitfalls:
Things to Watch:
|
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.
Description
Fix NullPointerException when using
binthenchartwith null values in the binned field.Root cause: The bin bucket functions (
SpanBucketFunction,MinspanBucketFunction,RangeBucketFunction) declared a non-nullableVARCHAR(2000)return type viaReturnTypes.VARCHAR_2000, even though they returnnullfor null inputs. This caused Calcite's optimizer to remove theIS NOT NULLfilters (added byvisitAggregation'snonNullGroupMasklogic) as trivially true, allowing null group keys to reach the Enumerable aggregation'sTreeMap, which crashed with NPE incompareTo.Fix:
ReturnTypes.VARCHAR_2000.andThen(SqlTypeTransforms.FORCE_NULLABLE)so that the null-filtering logic invisitAggregationworks correctlynullsLastto chart command sort operations as a defensive measureRelated Issues
Resolves opensearch-project#5174
Check List
-s)spotlessCheckpassed