[ 
https://issues.apache.org/jira/browse/IGNITE-18688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17719397#comment-17719397
 ] 

Andrey Mashenkov edited comment on IGNITE-18688 at 5/4/23 3:31 PM:
-------------------------------------------------------------------

Assume, there is a plan 
{code:java}
Project<-Filter<-TableScan
{code}
The test expects that both Project and Filter will be merged with the 
TableScan, but the planner can't do that with the only rules 
ProjectScanMergeRule and FilterScanMergeRule.
This is how Volcano planner works in Calcite, it takes Project and apply all 
the rules in can, then do the same with Filter and so on... at last it will 
have a rel-subsets like 
{code:java}
Project<-[Filter, FilteredTableScan]<-TableScan
{code}
So, actually, it just merge filter with table. Because it will never back to 
rel-subset with the Project node, after rel-subset was marked as optimized and 
planner was switched to the rel-subset with Filter node.

Seems, the reason, why this test ever pass is the rule was applied twice: in 
HEP and CBO planners.




was (Author: amashenkov):
Assume, there is a plan 
{code:java}
Project<-Filter<-TableScan
{code}
The test expects that both Project and Filter will be merged with the 
TableScan, but the planner can't do that with the only rules 
ProjectScanMergeRule and FilterScanMergeRule.
This is how Volcano planner works in Calcite, it takes Project and apply all 
the rules in can, then do the same with Filter and so on... at last it will 
have a rel-subsets like 
{code:java}
Project<-[Filter, FilteredTableScan]<-TableScan
{code}
So, actually, it just merge filter with table. Because it will never back to 
rel-subset with the Project node, after rel-subset was marked as optimized and 
planner was switched to the rel-subset with Filter node.

Seems, the reason, why this test ever pass is the rule was applied twice.



> Sql. Filter and Project are not merged to TableScan
> ---------------------------------------------------
>
>                 Key: IGNITE-18688
>                 URL: https://issues.apache.org/jira/browse/IGNITE-18688
>             Project: Ignite
>          Issue Type: Bug
>          Components: sql
>            Reporter: Konstantin Orlov
>            Assignee: Andrey Mashenkov
>            Priority: Major
>              Labels: ignite-3
>
> After IGNITE-18213 the test 
> {{org.apache.ignite.internal.sql.engine.planner.ProjectFilterScanMergePlannerTest#testFilterProjectFilterMerge}}
>  start to fail. Need to investigate and fix the problem.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to