Skip to content

Conversation

@qianheng-aws
Copy link
Collaborator

@qianheng-aws qianheng-aws commented Feb 28, 2025

Description

In the previous implementation, we push down project/filter into OpenSearchProjectIndexScanRule without any updating on its digest, which uniquely identifies a RelNode. This causes an equivalent issue with the nodes of CalciteOpenSearchIndexScan and makes the different RelSets in the optimizer mess up inaccurately.

This PR fixes this issue by overriding the explainTerms method to reflect PushDownContext in its final computed digest. And enable the push down by default in our settings, since all tests work fine the feature.

./gradlew :integ-test:integTest --tests '*Calcite*IT' succeed locally.

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: Heng Qian <qianheng@amazon.com>
@LantaoJin LantaoJin merged commit 37df1bf into opensearch-project:feature/calcite-engine Feb 28, 2025
6 of 13 checks passed
@LantaoJin
Copy link
Member

LantaoJin commented Feb 28, 2025

CalcitePPLJoinIT. testComplexAntiJoin
CalcitePPLJoinIT. testComplexCrossJoin
CalcitePPLJoinIT. testComplexInnerJoin
CalcitePPLJoinIT. testComplexLeftJoin
CalcitePPLJoinIT. testComplexRightJoin
CalcitePPLJoinIT. testComplexSemiJoin
CalcitePPLJoinIT. testJoinTwoColumnsAndDisjointFilters
CalcitePPLJoinIT. testJoinWithCondition
CalcitePPLJoinIT. testJoinWithTwoJoinConditions
CalcitePPLJoinIT. testNonEquiJoin

These ITs failed after merged this PR.
Some IT failed with Caused by: OpenSearchStatusException[OpenSearch exception [type=parsing_exception, reason=[terms] unknown token [END_ARRAY] after [country]]]
And others IT failed with different output ordering (may not a problem if we accept the the result without ordering) @qianheng-aws

@qianheng-aws
Copy link
Collaborator Author

CalcitePPLJoinIT. testComplexAntiJoin
CalcitePPLJoinIT. testComplexCrossJoin
CalcitePPLJoinIT. testComplexInnerJoin
CalcitePPLJoinIT. testComplexLeftJoin
CalcitePPLJoinIT. testComplexRightJoin
CalcitePPLJoinIT. testComplexSemiJoin
CalcitePPLJoinIT. testJoinTwoColumnsAndDisjointFilters
CalcitePPLJoinIT. testJoinWithCondition
CalcitePPLJoinIT. testJoinWithTwoJoinConditions
CalcitePPLJoinIT. testNonEquiJoin

These ITs failed after merged this PR. Some IT failed with Caused by: OpenSearchStatusException[OpenSearch exception [type=parsing_exception, reason=[terms] unknown token [END_ARRAY] after [country]]] And others IT failed with different output ordering (may not a problem if we accept the the result without ordering) @qianheng-aws

Seems PredicateAnalyzer has problem on support expression OR. Create a new issue to track this here #3368

penghuo pushed a commit to penghuo/os-sql that referenced this pull request Mar 12, 2025
Signed-off-by: Heng Qian <qianheng@amazon.com>
penghuo pushed a commit that referenced this pull request Jun 16, 2025
Signed-off-by: Heng Qian <qianheng@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