-
Notifications
You must be signed in to change notification settings - Fork 181
Keep aggregation in Calcite consistent with current PPL behavior #3405
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
Keep aggregation in Calcite consistent with current PPL behavior #3405
Conversation
Signed-off-by: Lantao Jin <ltjin@amazon.com>
Signed-off-by: Lantao Jin <ltjin@amazon.com>
Signed-off-by: Lantao Jin <ltjin@amazon.com>
Signed-off-by: Lantao Jin <ltjin@amazon.com>
Signed-off-by: Lantao Jin <ltjin@amazon.com>
| } else if (node.getKind() == SqlKind.AS) { | ||
| return Optional.of((RexLiteral) ((RexCall) node).getOperands().get(1)); | ||
| } else if (node instanceof RexCall call) { | ||
| return call.getOperands().stream() |
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.
When will we go into this branch? Seems we always pass an alias RexCall here.
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 by clause in PPL stats command, RexCall branch is useless. But I prefer to add this branch as a general method in ExtendedRexBuilder.
| } | ||
|
|
||
| /** TODO sort with aliased list will not work, so we add this converting */ | ||
| private List<RexNode> removeAliasForSort( |
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.
How about change function name to analyzeAliasForSort? It seems not a process of removing but analyzing or column resolving.
Signed-off-by: Lantao Jin <ltjin@amazon.com>
Signed-off-by: Lantao Jin <ltjin@amazon.com>
9ff34e2
into
opensearch-project:feature/calcite-engine
…nsearch-project#3405) * Keep aggregation in Calcite consistent with current PPL behavior Signed-off-by: Lantao Jin <ltjin@amazon.com> * remove unrelated code Signed-off-by: Lantao Jin <ltjin@amazon.com> * revert some code Signed-off-by: Lantao Jin <ltjin@amazon.com> * fix issue 3404 Signed-off-by: Lantao Jin <ltjin@amazon.com> * add more tests Signed-off-by: Lantao Jin <ltjin@amazon.com> * address comments Signed-off-by: Lantao Jin <ltjin@amazon.com> * add more tests Signed-off-by: Lantao Jin <ltjin@amazon.com> --------- Signed-off-by: Lantao Jin <ltjin@amazon.com>
* Keep aggregation in Calcite consistent with current PPL behavior Signed-off-by: Lantao Jin <ltjin@amazon.com> * remove unrelated code Signed-off-by: Lantao Jin <ltjin@amazon.com> * revert some code Signed-off-by: Lantao Jin <ltjin@amazon.com> * fix issue 3404 Signed-off-by: Lantao Jin <ltjin@amazon.com> * add more tests Signed-off-by: Lantao Jin <ltjin@amazon.com> * address comments Signed-off-by: Lantao Jin <ltjin@amazon.com> * add more tests Signed-off-by: Lantao Jin <ltjin@amazon.com> --------- Signed-off-by: Lantao Jin <ltjin@amazon.com> Signed-off-by: xinyual <xinyual@amazon.com>
Description
renamecommand with Calcite.All unit tests in ppl/src/test/java/org/opensearch/sql/ppl/calcite succeed in local
./gradlew :integ-test:integTest --tests '*Calcite*IT'passed in localRelated Issues
Resolves #3403, #3404
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.