-
Notifications
You must be signed in to change notification settings - Fork 148
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
[Calcite Engine] Push down project and filter operator into index scan #3327
[Calcite Engine] Push down project and filter operator into index scan #3327
Conversation
Signed-off-by: Heng Qian <qianheng@amazon.com>
Signed-off-by: Heng Qian <qianheng@amazon.com>
core/src/main/java/org/opensearch/sql/executor/QueryService.java
Outdated
Show resolved
Hide resolved
.../main/java/org/opensearch/sql/opensearch/planner/physical/OpenSearchFilterIndexScanRule.java
Show resolved
Hide resolved
.../main/java/org/opensearch/sql/opensearch/planner/physical/OpenSearchFilterIndexScanRule.java
Outdated
Show resolved
Hide resolved
.../main/java/org/opensearch/sql/opensearch/planner/physical/OpenSearchFilterIndexScanRule.java
Outdated
Show resolved
Hide resolved
opensearch/src/main/java/org/opensearch/sql/opensearch/request/PredicateAnalyzer.java
Outdated
Show resolved
Hide resolved
opensearch/src/main/java/org/opensearch/sql/opensearch/request/PredicateAnalyzer.java
Show resolved
Hide resolved
...main/java/org/opensearch/sql/opensearch/planner/physical/OpenSearchProjectIndexScanRule.java
Show resolved
Hide resolved
...main/java/org/opensearch/sql/opensearch/planner/physical/OpenSearchProjectIndexScanRule.java
Outdated
Show resolved
Hide resolved
...main/java/org/opensearch/sql/opensearch/planner/physical/OpenSearchProjectIndexScanRule.java
Show resolved
Hide resolved
...main/java/org/opensearch/sql/opensearch/planner/physical/OpenSearchProjectIndexScanRule.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Heng Qian <qianheng@amazon.com>
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.
Thx!
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.
Thanks for the changes! Btw, do we have a high level diagram for Calcite integration? Just want to learn and get more context. As I understand, we're trying to adapt v2 OS domain classes to Calcite connector, right?
}; | ||
} | ||
|
||
public boolean pushDownFilter(Filter filter) { |
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 assumes the given filter can be fully pushed down?
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.
If analyze exception occurs in PredicateAnalyzer, it will return false and won't push down this filter.
In v2 engine, will there any other case except aggregation block filter push down?
Signed-off-by: Heng Qian <qianheng@amazon.com>
This RFC should be the root issue and should have the overview: #3229 |
cb103d7
into
opensearch-project:feature/calcite-engine
@qianheng-aws seems many ITs fail with this PR in my local.
could you add at least two tests to verify each PR in future:
|
Description
Push down project and filter operator into index scan. This PR includes change:
OpenSearchIndex
change to use its specific scan operator,CalciteOpenSearchIndexScan
RelRunners
to do execution since the current implementation ofCalciteOpenSearchIndexScan
does not require a "schema" as context.OpenSearchFilterIndexScanRule
andOpenSearchProjectIndexScanRule
to do filter/project operator push down.PredicateAnalyzer
to buildQueryBuilder
for filter condition.Related Issues
Part Resolves #3331
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.