Hi Aitozi,

All Calcite's built-in operators (including Spool) have a single parent so
I don't fully understand what you mean by "parent components".

What exactly do you expect to see in the rule match? Can you provide some
concrete examples?

In order to get the parent of the spool operator I guess you would have to
create a rule with the following supplier:

withOperandSupplier(b0 -> b0.operand(RelNode.class).oneInput(b1 ->
b1.operand(Spool.class).anyInputs()))

Best,
Stamatis

On Sun, Mar 12, 2023 at 5:07 PM Aitozi <gjying1...@gmail.com> wrote:

> It seems for a specific rule: CommonRelSubExprRule, the HepPlanner will
> inject the parent nodes. I will try on this.
>
> Best,
> Aitozi
>
> Aitozi <gjying1...@gmail.com> 于2023年3月12日周日 09:26写道:
>
> > Hi
> >     Recently, I've been conducting research on how to maximize the
> > potential of Spool for CTE reuse optimization. My goal is to streamline
> the
> > push down process and filters across all consumer nodes. However, I have
> > encountered a roadblock as the current rule pattern fails to accurately
> > describe the  structure of Spool and its parent components. So, in the
> rule
> > match we can not see the structure as a whole. Would greatly appreciate
> any
> > guidance or insights on this topic.
> >
> > Thanks,
> > Aitozi
> >
>

Reply via email to