Keep aggregation in Calcite consistent with current PPL behavior#3405
Merged
LantaoJin merged 7 commits intoopensearch-project:feature/calcite-enginefrom Mar 11, 2025
Merged
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() |
Collaborator
There was a problem hiding this comment.
When will we go into this branch? Seems we always pass an alias RexCall here.
Member
Author
There was a problem hiding this comment.
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( |
Collaborator
There was a problem hiding this comment.
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>
qianheng-aws
approved these changes
Mar 11, 2025
9ff34e2
into
opensearch-project:feature/calcite-engine
5 of 13 checks passed
penghuo
pushed a commit
to penghuo/os-sql
that referenced
this pull request
Mar 12, 2025
…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>
7 tasks
penghuo
pushed a commit
that referenced
this pull request
Jun 16, 2025
* 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>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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.