-
Notifications
You must be signed in to change notification settings - Fork 163
Support nested aggregation when calcite enabled #3696
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Lantao Jin <ltjin@amazon.com>
CI failure is not related to this PR. It caused by opensearch-project/OpenSearch#18124 |
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.
QQ: I recall we didn't support nested field type in V2 engine, right? Did we add it to Calcite or this is only for pushdown? Ref: #52
Nested field maps to I believe we also can support nested aggregation in v2 but the fixing will be complex by my trying. Now I have no idea how to pass the For pushdown disabled, I think we need additional effort to correct the aggregation behavior. So I add a TODO in code. Or find a way to throw an exception. |
The value of nested field in PPL is incorrect. Seems we will only show the first element of that nested fields while it's actually an inner field of an array of object. That's why it will calculate wrong results if no push down.
DSL:
PPL:
|
Thanks, please let me know why we just return first element? Let me try to change this logic first. |
Perhaps I know the reason now. I update above code to
but it doesn't work since we flatten the schema (mapping): sql/opensearch/src/main/java/org/opensearch/sql/opensearch/data/type/OpenSearchDataType.java Lines 294 to 296 in 5eb2e5b
For example |
This PR is stalled because it has been open for 30 days with no activity. |
Description
Support nested aggregation in PPL only when calcite enabled.
With this PR, follow PPL query is able to execute a nested aggregation query.
And it equals the DSL
Deprecated implementation for SQL: #2814
Limitation:
Related Issues
PR partially resolves #2813 and #2529, and #2739
Check List
--signoff
.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.