generated from amazon-archives/__template_Custom
-
Notifications
You must be signed in to change notification settings - Fork 186
Fix #5150: Fix dedup aggregation pushdown nullifying renamed fields #5192
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
Open
opensearchpplteam
wants to merge
4
commits into
opensearch-project:main
Choose a base branch
from
opensearchpplteam:fix/issue-5150
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
6eb5ac5
Fix #5150: Fix dedup aggregation pushdown nullifying renamed fields
opensearchpplteam d82a0a1
Trigger CI rerun for flaky Java 25 integration test
opensearchpplteam e9a24ad
Address review feedback for #5192: document field mapping limitations
opensearchpplteam e8a2e3a
Address review: assert real values in YAML REST tests for #5150
opensearchpplteam File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
78 changes: 78 additions & 0 deletions
78
integ-test/src/yamlRestTest/resources/rest-api-spec/test/issues/5150.yml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| setup: | ||
| - do: | ||
| indices.create: | ||
| index: test_5150 | ||
| - do: | ||
| query.settings: | ||
| body: | ||
| transient: | ||
| plugins.calcite.enabled : true | ||
|
|
||
| - do: | ||
| bulk: | ||
| index: test_5150 | ||
| refresh: true | ||
| body: | ||
| - '{"index": {}}' | ||
| - '{"category":"X","value":100}' | ||
| - '{"index": {}}' | ||
| - '{"category":"X","value":200}' | ||
| - '{"index": {}}' | ||
| - '{"category":"Y","value":300}' | ||
| - '{"index": {}}' | ||
| - '{"category":"Y","value":400}' | ||
|
|
||
| --- | ||
| teardown: | ||
| - do: | ||
| query.settings: | ||
| body: | ||
| transient: | ||
| plugins.calcite.enabled : false | ||
|
|
||
| --- | ||
| "5150: Rename non-dedup field then dedup retains renamed values": | ||
| - skip: | ||
| features: | ||
| - headers | ||
| - allowed_warnings | ||
| - do: | ||
| allowed_warnings: | ||
| - 'Loading the fielddata on the _id field is deprecated and will be removed in future versions. If you require sorting or aggregating on this field you should also include the id in the body of your documents, and map this field as a keyword field that has [doc_values] enabled' | ||
| headers: | ||
| Content-Type: 'application/json' | ||
| ppl: | ||
| body: | ||
| query: source=test_5150 | rename value as val | dedup category | sort category | fields category, val | ||
|
|
||
| - match: { total: 2 } | ||
| - match: { schema: [{"name": "category", "type": "string"}, {"name": "val", "type": "bigint"}] } | ||
| - length: { datarows: 2 } | ||
| - match: { datarows.0.0: "X" } | ||
| - match: { datarows.0.1: 100 } | ||
| - match: { datarows.1.0: "Y" } | ||
| - match: { datarows.1.1: 300 } | ||
|
|
||
| --- | ||
| "5150: Eval new field then dedup on different field retains eval values": | ||
| - skip: | ||
| features: | ||
| - headers | ||
| - allowed_warnings | ||
| - do: | ||
| allowed_warnings: | ||
| - 'Loading the fielddata on the _id field is deprecated and will be removed in future versions. If you require sorting or aggregating on this field you should also include the id in the body of your documents, and map this field as a keyword field that has [doc_values] enabled' | ||
| headers: | ||
| Content-Type: 'application/json' | ||
| ppl: | ||
| body: | ||
| query: source=test_5150 | eval doubled = value * 2 | dedup category | sort category | fields category, value, doubled | ||
|
|
||
| - match: { total: 2 } | ||
| - length: { datarows: 2 } | ||
| - match: { datarows.0.0: "X" } | ||
| - match: { datarows.0.1: 100 } | ||
| - match: { datarows.0.2: 200 } | ||
| - match: { datarows.1.0: "Y" } | ||
| - match: { datarows.1.1: 300 } | ||
| - match: { datarows.1.2: 600 } |
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
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
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
Oops, something went wrong.
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.
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.
The field name mapping is applied only in the multi-row return path (the
elsebranch at line 140). ThereturnSingleValuepath (used by ARG_MAX/ARG_MIN pushdown) andreturnMergeValuepath skip mapping entirely. If those paths are ever used with renamed fields via a future pushdown rule, they would have the same null-value bug. Worth confirming this is an intentional scope limitation for now, or if those branches should also apply the mapping defensively.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.
Confirmed this is intentional. The returnSingleValue and returnMergeValue paths use agg.getName() as the map key (not field names), so field name mapping is irrelevant for those paths. Added a clarifying comment in the code explaining why mapping is only applied in the multi-row return path.