-
Notifications
You must be signed in to change notification settings - Fork 180
Support nested aggregation when calcite enabled #4979
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>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
| protected Function0<CalcitePrepare> createPrepareFactory() { | ||
| return OpenSearchPrepareImpl::new; |
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.
After upgraded to 1.41. this method was not called any more, change it to createPrepare()
|
|
||
| @Override | ||
| protected PreparedResult implement(RelRoot root) { | ||
| Hook.PLAN_BEFORE_IMPLEMENTATION.run(root); |
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 hook was called twice for non-full-scannable plan
| HintStrategyTable.builder() | ||
| .hintStrategy( | ||
| "stats_args", | ||
| "agg_args", |
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.
rename stats_args to agg_args since aggregation was not only happens in stats command.
| curl -sS -H 'Content-Type: application/json' \ | ||
| -X POST localhost:9200/_plugins/_ppl/_explain?format=extended \ | ||
| -d '{"query" : "source=state_country | where age>30"}' | ||
| -d '{"query" : "source=state_country | head 10 | where age>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.
avoid whole-plan-pushdown
| if (result.getCause() == null) { | ||
| if (result.getSuppressed().length > 0) { | ||
| return result.getSuppressed()[0]; | ||
| } |
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.
For some exception without cause (root exception), the actual root cause may be attached in its suppressed cause.
| return new OpenSearchErrorMessage(exception, exception.status().getStatus()); | ||
| } | ||
| return new ErrorMessage(e, status); | ||
| return new ErrorMessage(cause, status); |
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.
Prefer to display the root cause instead of wrapping exception.
Description
Refactor #3696
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
Resolves #4949, #2813 and #2529, and #2739
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.