-
Notifications
You must be signed in to change notification settings - Fork 180
Fix mapping after aggregation push down #4500
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
Conversation
Signed-off-by: Heng Qian <[email protected]>
Signed-off-by: Heng Qian <[email protected]>
|
can you update the |
| query: source=test | bin num bins=3 | stats count() by num | ||
|
|
||
| - match: { total: 2 } | ||
| - match: {"datarows": [[2, "10-20"], [1, "20-30"]]} |
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.
what's the result without this patch? is it a test about overwrite existing type? if yes, better to match the schema too.
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.
Corrected the issue link, #4115. It will throw exception without this PR
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.
Also add the schema verification in the commit acecdd1
| // of all niceties of all types. | ||
| this.typeMapping.putIfAbsent(field, typeMapping.get(field)); | ||
| } | ||
| this.typeMapping.putAll(typeMapping); |
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.
q: should we check Settings.Key.PPL_SYNTAX_LEGACY_PREFERRED first?
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.
This is a bug actually. We'd better always have this change despite of what this configuration is.
| // aggregation adds info about new columns to the factory, | ||
| // it is accepted without overwriting existing data. | ||
| public void factoryMappingsAreExtendableWithoutOverWrite() | ||
| // it will overwrite existing type to fix issue #4413. |
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.
what is the issue 4413? can you attach the link?
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.
Done
Signed-off-by: Heng Qian <[email protected]>
yuancu
left a comment
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.
LGTM. Can you link this PR to #3458 as well? It solves the mismatched type mapping when calcite is disabled.
|
The backport to To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/sql/backport-2.19-dev 2.19-dev
# Navigate to the new working tree
pushd ../.worktrees/sql/backport-2.19-dev
# Create a new branch
git switch --create backport/backport-4500-to-2.19-dev
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 9257889a17f7301523a586c91833fa8331f4ef73
# Push it to GitHub
git push --set-upstream origin backport/backport-4500-to-2.19-dev
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/sql/backport-2.19-devThen, create a pull request where the |
* Fix mapping after aggregation push down Signed-off-by: Heng Qian <[email protected]> * Fix IT and UT Signed-off-by: Heng Qian <[email protected]> * address comments Signed-off-by: Heng Qian <[email protected]> --------- Signed-off-by: Heng Qian <[email protected]> (cherry picked from commit 9257889) Signed-off-by: Heng Qian <[email protected]>
) * Fix mapping after aggregation push down (#4500) * Fix mapping after aggregation push down Signed-off-by: Heng Qian <[email protected]> * Fix IT and UT Signed-off-by: Heng Qian <[email protected]> * address comments Signed-off-by: Heng Qian <[email protected]> --------- Signed-off-by: Heng Qian <[email protected]> (cherry picked from commit 9257889) Signed-off-by: Heng Qian <[email protected]> * Fix compiling Signed-off-by: Heng Qian <[email protected]> --------- Signed-off-by: Heng Qian <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Simeon Widdis <[email protected]> Co-authored-by: Manasvini B S <[email protected]> Co-authored-by: opensearch-ci-bot <[email protected]> Co-authored-by: Louis Chu <[email protected]> Co-authored-by: Chen Dai <[email protected]> Co-authored-by: Mebsina <[email protected]> Co-authored-by: Yuanchun Shen <[email protected]> Co-authored-by: opensearch-trigger-bot[bot] <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Co-authored-by: Kai Huang <[email protected]> Co-authored-by: Peng Huo <[email protected]> Co-authored-by: Alexey Temnikov <[email protected]> Co-authored-by: Riley Jerger <[email protected]> Co-authored-by: Tomoyuki MORITA <[email protected]> Co-authored-by: Lantao Jin <[email protected]> Co-authored-by: Songkan Tang <[email protected]> Co-authored-by: qianheng <[email protected]> Co-authored-by: Simeon Widdis <[email protected]> Co-authored-by: Xinyuan Lu <[email protected]> Co-authored-by: Jialiang Liang <[email protected]> Co-authored-by: Peter Zhu <[email protected]> Co-authored-by: Vinay Krishna Pudyodu <[email protected]> Co-authored-by: expani <[email protected]> Co-authored-by: expani1729 <[email protected]> Co-authored-by: Vamsi Manohar <[email protected]> Co-authored-by: ritvibhatt <[email protected]> Co-authored-by: Xinyu Hao <[email protected]> Co-authored-by: Marc Handalian <[email protected]> Co-authored-by: Marc Handalian <[email protected]> Fix join type ambiguous issue when specify the join type with sql-like join criteria (opensearch-project#4474) Fix issue 4441 (opensearch-project#4449) Fix missing keywordsCanBeId (opensearch-project#4491) Fix the bug of explicit makeNullLiteral for UDT fields (opensearch-project#4475) Fix mapping after aggregation push down (opensearch-project#4500) Fix percentile bug (opensearch-project#4539) Fix JsonExtractAllFunctionIT failure (opensearch-project#4556) Fix sort push down into agg after project already pushed (opensearch-project#4546) Fix push down failure for min/max on derived field (opensearch-project#4572) Fix compile issue in main (opensearch-project#4608) Fix filter parsing failure on date fields with non-default format (opensearch-project#4616) Fix bin nested fields issue (opensearch-project#4606) Fix: Support Alias Fields in MIN, MAX, FIRST, LAST, and TAKE Aggregations (opensearch-project#4621) fix rename issue (opensearch-project#4670) Fixes for `Multisearch` and `Append` command (opensearch-project#4512) Fix asc/desc keyword behavior for sort command (opensearch-project#4651) Fix] Fix unexpected shift of extraction for `rex` with nested capture groups in named groups (opensearch-project#4641) Fix CVE-2025-48924 (opensearch-project#4665) Fix sub-fields accessing of generated structs (opensearch-project#4683) Fix] Incorrect Field Index Mapping in AVG to SUM/COUNT Conversion (opensearch-project#15)
Description
Allow type updating/overriding when pushing aggregation and it has derived fields with the same name as fields in source.
Also fix
WidthBucketFunctionto return correct type if the field is type of TIME/DATE/TIMESTAMP.Related Issues
Resolves #4115, #3458
Check List
--signoffor-s.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.