You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by Tal Glanzman <ta...@gmail.com> on 2020/03/12 17:00:06 UTC

planning error

Hi!

This is my first message here, I hope it's the correct place to ask these
kind of questions.

I am trying to use calcite as a framework for a system which should create
an optimized execution plan, for a given query and schema - with no
execution

My plan is to create an adapter with converter rules for each of the
relevant Logical Nodes, so they will be transformed to Nodes within my
specific domain (afterwards to further optimize using additional rules and
costs)

Among others, i get the error
- *org.apache.calcite.plan.RelOptPlanner$CannotPlanException: There are not
enough rules to produce a node with desired properties:
convention=LimeConvention, sort=[]. All the inputs have relevant nodes,
however the cost is still infinite.*
From what i understand from the planning message is that my nodes aren't
connecting through the whole expression (?)

Have tried to mimic how Cassandra and Pig define the systems but with no
luck. My end goal is to have a relational expression, only with my own
terms in it.

Any help is very much appreciated!

The project can be found at
https://github.com/tglanz/limestone/tree/master/core
and the planning visualization
https://github.com/tglanz/limestone/blob/master/core/assets/q2-optimizer.svg

Re: planning error

Posted by Tal Glanzman <ta...@gmail.com>.
Thank you for the quick response, have just tried your solution and it
worked like a charm.

Thanks!

<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon>
Virus-free.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Thu, Mar 12, 2020 at 10:09 AM Vladimir Sitnikov <
sitnikov.vladimir@gmail.com> wrote:

> Hi,
>
> The problem is ProjectLimeRel should have **lime** rel as input,
> however now it has LogicalFilter as an input.
>
> The issue is caused by the following line:
>
> https://github.com/tglanz/limestone/blob/master/core/src/main/java/org/tglanz/limestone/rules/LogicalProjectConverterRule.java#L29
>
> You probably need to replace source.getInput() with something like
> convert(source.getInput(),
> source.getInput().getTraitSet().replace(LimeConvention.INSTANCE))
>
> See
>
> https://github.com/apache/calcite/blob/bc2d7e1ce0ff0a2193df2ce6e59d5501766bbca5/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableProjectRule.java#L45
>
> Vladimir
>

Re: planning error

Posted by Vladimir Sitnikov <si...@gmail.com>.
Hi,

The problem is ProjectLimeRel should have **lime** rel as input,
however now it has LogicalFilter as an input.

The issue is caused by the following line:
https://github.com/tglanz/limestone/blob/master/core/src/main/java/org/tglanz/limestone/rules/LogicalProjectConverterRule.java#L29

You probably need to replace source.getInput() with something like
convert(source.getInput(),
source.getInput().getTraitSet().replace(LimeConvention.INSTANCE))

See
https://github.com/apache/calcite/blob/bc2d7e1ce0ff0a2193df2ce6e59d5501766bbca5/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableProjectRule.java#L45

Vladimir