You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by Soumyava Das <so...@imply.io> on 2022/04/11 18:27:12 UTC

Planning Question

Hi,

I have a question for you.

During a transformation while planning, if we have a faulty transformation
that cannot build the query properly, is it fine if I ignore it with the
premise that the transformation can be deemed invalid and the assumption is
that calcite will find another plan as it continues exploring ?

Thanks,
Somu

Re: Planning Question

Posted by Julian Hyde <jh...@gmail.com>.
Jess is correct that a rule is allowed to no-op, but how to no-op is different for two kinds of rules.

Converter rules can produce 0 or 1 successors, and therefore no-op by returning null from their implementation of the method

  @Nullable RelNode ConverterRule.convert(RelNode)

Regular rules are allowed to produce 0, 1 or more successors, and therefore the API is different. The method of interest is

  void RelRule.onMatch(RelOptRuleCall call)

Implementations of that method invoke call.transformTo(RelNode) with each successor, and calling that method 0 times is a no-op.

Julian


> On Apr 11, 2022, at 12:00 PM, Jess Balint <jb...@gmail.com> wrote:
> 
> You can return null in your rule implementation if the transformation
> cannot produce a valid plan. If this is not clearly the answer to what
> you're asking, please share an example or some details about what you're
> attempting to do.
> 
> Jess
> 
> On Mon, Apr 11, 2022 at 1:29 PM Soumyava Das <so...@imply.io> wrote:
> 
>> Hi,
>> 
>> I have a question for you.
>> 
>> During a transformation while planning, if we have a faulty transformation
>> that cannot build the query properly, is it fine if I ignore it with the
>> premise that the transformation can be deemed invalid and the assumption is
>> that calcite will find another plan as it continues exploring ?
>> 
>> Thanks,
>> Somu
>> 


Re: Planning Question

Posted by Jess Balint <jb...@gmail.com>.
You can return null in your rule implementation if the transformation
cannot produce a valid plan. If this is not clearly the answer to what
you're asking, please share an example or some details about what you're
attempting to do.

Jess

On Mon, Apr 11, 2022 at 1:29 PM Soumyava Das <so...@imply.io> wrote:

> Hi,
>
> I have a question for you.
>
> During a transformation while planning, if we have a faulty transformation
> that cannot build the query properly, is it fine if I ignore it with the
> premise that the transformation can be deemed invalid and the assumption is
> that calcite will find another plan as it continues exploring ?
>
> Thanks,
> Somu
>