Skip to content

Conversation

@LantaoJin
Copy link
Member

@LantaoJin LantaoJin commented Mar 7, 2025

Description

Core Syntax: Implement ppl scalar subquery command 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' succeed in local

Related Issues

Resolves #3361

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • New functionality has javadoc added.
  • New functionality has a user manual doc added.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff.
  • Public documentation issue/PR created.

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.

Signed-off-by: Lantao Jin <ltjin@amazon.com>
if (expr instanceof Compare c) {
return containsScalarSubquery(c.getLeft()) || containsScalarSubquery(c.getRight());
}
return false;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we support more cases than Not, Let and Compare?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, addressed in latest commit, please check it again

Signed-off-by: Lantao Jin <ltjin@amazon.com>

private boolean containsExistsSubquery(Object condition) {
if (condition instanceof ExistsSubquery) {
private boolean containsExistsSubquery(Node expr) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about combining this 2 flags together? Will we use them separately in specific cases?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Signed-off-by: Lantao Jin <ltjin@amazon.com>
@LantaoJin
Copy link
Member Author

Merging to dev branch to unblock others, cc @penghuo to async review.

@LantaoJin LantaoJin merged commit a07c2cd into opensearch-project:feature/calcite-engine Mar 7, 2025
4 of 13 checks passed
penghuo pushed a commit to penghuo/os-sql that referenced this pull request Mar 12, 2025
…t#3392)

* Implement ppl scalar subquery command with Calcite

Signed-off-by: Lantao Jin <ltjin@amazon.com>

* more general subquery checker

Signed-off-by: Lantao Jin <ltjin@amazon.com>

* support correlated IN subquery

Signed-off-by: Lantao Jin <ltjin@amazon.com>

---------

Signed-off-by: Lantao Jin <ltjin@amazon.com>
penghuo pushed a commit that referenced this pull request Jun 16, 2025
* Implement ppl scalar subquery command with Calcite

Signed-off-by: Lantao Jin <ltjin@amazon.com>

* more general subquery checker

Signed-off-by: Lantao Jin <ltjin@amazon.com>

* support correlated IN subquery

Signed-off-by: Lantao Jin <ltjin@amazon.com>

---------

Signed-off-by: Lantao Jin <ltjin@amazon.com>
Signed-off-by: xinyual <xinyual@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

calcite calcite migration releated

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants