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

Ruben Q L commented on CALCITE-3916:
------------------------------------

Thanks for checking [~hyuan], grosso modo the situation is as follows:
I have an IndexScan operator which can perform an scan with filter and/or sort 
within. With a certain rule, the first IndexScan is created with a filter 
inside:
{{Filter + Scan => IndexScan[id 38, filter]}}

Then, the method "passThrough" is called on this IndexScan38. The required 
traiset contains a collation, so a new IndexScan is created (using 38 as 
"base"), ending up with IndexScan45, which contains the filter and sort 
(collation):
{{createdSortedIndexScan(IndexScan38, collation) => IndexScan[id 45, filter, 
collation]}}

Since "passThrough" requires also ENUMERABLE Convention, and my IndexScan 
operator belongs to a different one, this method returns a 
MyConventionToEnumerableConverter(with IndexScan45 inside).

The {{ClassCastException}} is thrown when this IndexScan45 is tried to be cast 
as RelSubset inside {{TopDownRuleDriver#getOptimizeInputTask}}.

> Support cascades style top-down driven rule apply
> -------------------------------------------------
>
>                 Key: CALCITE-3916
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3916
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>            Reporter: Haisheng Yuan
>            Assignee: Jinpeng Wu
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.24.0
>
>          Time Spent: 15.5h
>  Remaining Estimate: 0h
>
> Apply rules by leaf RelSet -> root RelSet order. For every RelNode in a 
> RelSet, rule is matched and applied sequentially. No RuleQueue and 
> DeferringRuleCall is needed anymore. This will make space pruning and rule 
> mutual exclusivity check possible.
> Rule that use AbstractConverter as operand is an exception, to keep backward 
> compatibility, this kind of rule still needs top-down apply.
> This should be done after CALCITE-3896.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to