You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by Rui Wang <am...@apache.org> on 2019/11/08 18:04:47 UTC
Optimizer: All the inputs have relevant nodes, however the cost is
still infinite.
Hello community:
I am stuck an optimizer error while working on Calcite-3272. I am less
familiar with Calcite's optimizer and struggled to debug the following
error message. Is there some hints on what direction I should go? I can
also provide more information if that is helpful.
> java.sql.SQLException: Error while executing SQL "select * FROM
TABLE(TUMBLE(TABLE ORDERS, 'ROWTIME', INTERVAL '1' MINUTE))": There are not
enough rules to produce a node with desired properties:
convention=ENUMERABLE, sort=[]. All the inputs have relevant nodes, however
the cost is still infinite.
> Root: rel#26:Subset#2.ENUMERABLE.[]
> Original rel:
> LogicalProject(ROWTIME=[$0], ID=[$1], PRODUCT=[$2], UNITS=[$3],
wstart=[$4], wend=[$5]): rowcount = 100.0, cumulative cost =
{1.7976931348623157E308 rows, 1.7976931348623157E308 cpu,
1.7976931348623157E308 io}, id = 12
> LogicalTableFunctionScan(invocation=[TUMBLE($3, 'ROWTIME',
60000:INTERVAL MINUTE)], rowType=[RecordType(TIMESTAMP(0) ROWTIME, INTEGER
ID, VARCHAR(10) PRODUCT, INTEGER UNITS, TIMESTAMP(0) wstart, TIMESTAMP(0)
wend)]): rowcount = 100.0, cumulative cost = {1.7976931348623157E308 rows,
1.7976931348623157E308 cpu, 1.7976931348623157E308 io}, id = 10
> LogicalProject(ROWTIME=[$0], ID=[$1], PRODUCT=[$2], UNITS=[$3]):
rowcount = 100.0, cumulative cost = {200.0 rows, 501.0 cpu, 0.0 io}, id = 8
> LogicalTableScan(table=[[ORINOCO, ORDERS]]): rowcount = 100.0,
cumulative cost = {100.0 rows, 101.0 cpu, 0.0 io}, id = 2
-Rui
Re: Optimizer: All the inputs have relevant nodes, however the cost
is still infinite.
Posted by Rui Wang <am...@apache.org>.
Thanks Vladimir. I verified and the fix worked. Also thanks for your link!
I will create a JIRA and submit a patch.
-Rui
On Wed, Nov 13, 2019 at 10:10 AM Vladimir Sitnikov <
sitnikov.vladimir@gmail.com> wrote:
> I typically use http://www.webgraphviz.com/
>
> Try pasting digraph { ... } part of the exception there.
>
> Vladimir
>
Re: Optimizer: All the inputs have relevant nodes, however the cost
is still infinite.
Posted by Vladimir Sitnikov <si...@gmail.com>.
I typically use http://www.webgraphviz.com/
Try pasting digraph { ... } part of the exception there.
Vladimir
Re: Optimizer: All the inputs have relevant nodes, however the cost
is still infinite.
Posted by Rui Wang <am...@apache.org>.
Hi Vladimir,
Really thanks for your help checking the cause. I am new to Calcite
optimizer so wasn't able to figure out a way to debug the output of
optimizer.
I will verify your idea and also learn how to use Graphviz (I think you
were talking about this tool [1])
[1]: https://www.graphviz.org/
-Rui
On Wed, Nov 13, 2019 at 8:52 AM Xiening Dai <xn...@gmail.com> wrote:
> No, I didn’t get a chance. Thanks for diagnosing.
>
> > On Nov 13, 2019, at 7:55 AM, Vladimir Sitnikov <
> sitnikov.vladimir@gmail.com> wrote:
> >
> > Xiening,
> >
> > The bug is "obvious" when you open a Graphviz diagram.
> > Just wondering: have you tried?
> >
> > The issue is EnumerableTableFunctionScan consumes Subset#0.NONE.[0] as an
> > input, which is never implementable.
> >
> > The fix is trivial: EnumerableTableFunctionScanRule must convert inputs
> to
> > EnumerableConvention
> > (e.g. see how EnumerableProjectRule converts input to enumerable)
> >
> > So getInputs() should be replaced with convertList(rel.getInputs(),
> > EnumerableConvention.INSTANCE)
> > Can you please try that?
> >
> > Vladimir
>
>
Re: Optimizer: All the inputs have relevant nodes, however the cost
is still infinite.
Posted by Xiening Dai <xn...@gmail.com>.
No, I didn’t get a chance. Thanks for diagnosing.
> On Nov 13, 2019, at 7:55 AM, Vladimir Sitnikov <si...@gmail.com> wrote:
>
> Xiening,
>
> The bug is "obvious" when you open a Graphviz diagram.
> Just wondering: have you tried?
>
> The issue is EnumerableTableFunctionScan consumes Subset#0.NONE.[0] as an
> input, which is never implementable.
>
> The fix is trivial: EnumerableTableFunctionScanRule must convert inputs to
> EnumerableConvention
> (e.g. see how EnumerableProjectRule converts input to enumerable)
>
> So getInputs() should be replaced with convertList(rel.getInputs(),
> EnumerableConvention.INSTANCE)
> Can you please try that?
>
> Vladimir
Re: Re: Re: Optimizer: All the inputs have relevant nodes, however
the cost is still infinite.
Posted by Vladimir Sitnikov <si...@gmail.com>.
Xiening,
The bug is "obvious" when you open a Graphviz diagram.
Just wondering: have you tried?
The issue is EnumerableTableFunctionScan consumes Subset#0.NONE.[0] as an
input, which is never implementable.
The fix is trivial: EnumerableTableFunctionScanRule must convert inputs to
EnumerableConvention
(e.g. see how EnumerableProjectRule converts input to enumerable)
So getInputs() should be replaced with convertList(rel.getInputs(),
EnumerableConvention.INSTANCE)
Can you please try that?
Vladimir
Re: Re: Re: Optimizer: All the inputs have relevant nodes, however
the cost is still infinite.
Posted by Rui Wang <am...@apache.org>.
I found EnumerableTableFunctionScanRule and EnumerableTableFunctionScan are
not tested in unit tests in core (checked by code search in core/test). The
right approach seems to me now is add more tests and then gradually see if
I can narrow down the problem.
Are there recommended places that I should add more tests?
-Rui
On Fri, Nov 8, 2019 at 8:38 PM Rui Wang <ru...@google.com> wrote:
> Xiening - You can reproduce it by running CoreQuidemTest in [1].
>
>
> Haisheng - those enumerable rules all exist. My change in [1] shouldn't
> require implementing new enumerable rules.
>
>
>
> [1]: https://github.com/amaliujia/calcite/tree/rw-add_TVF_TUMBLE
>
> On Fri, Nov 8, 2019 at 12:04 PM Haisheng Yuan <h....@alibaba-inc.com>
> wrote:
>
>> Yes, looks like EnumerableTableFunctionScan doesn't override
>> computeSelfCost.
>>
>> - Haisheng
>>
>> ------------------------------------------------------------------
>> 发件人:Haisheng Yuan<h....@alibaba-inc.com>
>> 日 期:2019年11月09日 04:01:19
>> 收件人:Apache Calcite dev list<de...@calcite.apache.org>
>> 主 题:Re: Re: Optimizer: All the inputs have relevant nodes, however the
>> cost is still infinite.
>>
>> It is not surprising to get an infinitive cost, since the operators in
>> the plan are logical operators, which need to be converted to physical
>> operators to be costed. Did you try to add some implementation rules to the
>> rule set, e.g. EnumerableProjectRule, EnumerableTableFunctionScanRule, etc..
>>
>> - Haisheng
>>
>> ------------------------------------------------------------------
>> 发件人:Xiening Dai<xn...@gmail.com>
>> 日 期:2019年11月09日 03:35:03
>> 收件人:<de...@calcite.apache.org>
>> 主 题:Re: Optimizer: All the inputs have relevant nodes, however the cost
>> is still infinite.
>>
>> Are you able to provide a test case to repro on current code base?
>>
>> From the error message, the given subset’s best RelNode is not available,
>> aka cost is infinite. There could be multiple cases leading to it.
>>
>>
>> > On Nov 8, 2019, at 11:28 AM, Rui Wang <am...@apache.org> wrote:
>> >
>> > My current guess is it could because of `computeSelfCost` of
>> > `EnumerableTableFunctionScan`.
>> >
>> >
>> > -Rui
>> >
>> > On Fri, Nov 8, 2019 at 10:04 AM Rui Wang <am...@apache.org> wrote:
>> >
>> >> Hello community:
>> >>
>> >> I am stuck an optimizer error while working on Calcite-3272. I am less
>> >> familiar with Calcite's optimizer and struggled to debug the following
>> >> error message. Is there some hints on what direction I should go? I can
>> >> also provide more information if that is helpful.
>> >>
>> >>
>> >>
>> >>> java.sql.SQLException: Error while executing SQL "select * FROM
>> >> TABLE(TUMBLE(TABLE ORDERS, 'ROWTIME', INTERVAL '1' MINUTE))": There
>> are not
>> >> enough rules to produce a node with desired properties:
>> >> convention=ENUMERABLE, sort=[]. All the inputs have relevant nodes,
>> however
>> >> the cost is still infinite.
>> >>> Root: rel#26:Subset#2.ENUMERABLE.[]
>> >>> Original rel:
>> >>> LogicalProject(ROWTIME=[$0], ID=[$1], PRODUCT=[$2], UNITS=[$3],
>> >> wstart=[$4], wend=[$5]): rowcount = 100.0, cumulative cost =
>> >> {1.7976931348623157E308 rows, 1.7976931348623157E308 cpu,
>> >> 1.7976931348623157E308 io}, id = 12
>> >>> LogicalTableFunctionScan(invocation=[TUMBLE($3, 'ROWTIME',
>> >> 60000:INTERVAL MINUTE)], rowType=[RecordType(TIMESTAMP(0) ROWTIME,
>> INTEGER
>> >> ID, VARCHAR(10) PRODUCT, INTEGER UNITS, TIMESTAMP(0) wstart,
>> TIMESTAMP(0)
>> >> wend)]): rowcount = 100.0, cumulative cost = {1.7976931348623157E308
>> rows,
>> >> 1.7976931348623157E308 cpu, 1.7976931348623157E308 io}, id = 10
>> >>> LogicalProject(ROWTIME=[$0], ID=[$1], PRODUCT=[$2], UNITS=[$3]):
>> >> rowcount = 100.0, cumulative cost = {200.0 rows, 501.0 cpu, 0.0 io},
>> id = 8
>> >>> LogicalTableScan(table=[[ORINOCO, ORDERS]]): rowcount = 100.0,
>> >> cumulative cost = {100.0 rows, 101.0 cpu, 0.0 io}, id = 2
>> >>
>> >>
>> >>
>> >> -Rui
>> >>
>>
>>
Re: Re: Re: Optimizer: All the inputs have relevant nodes, however
the cost is still infinite.
Posted by Rui Wang <ru...@google.com.INVALID>.
Xiening - You can reproduce it by running CoreQuidemTest in [1].
Haisheng - those enumerable rules all exist. My change in [1] shouldn't
require implementing new enumerable rules.
[1]: https://github.com/amaliujia/calcite/tree/rw-add_TVF_TUMBLE
On Fri, Nov 8, 2019 at 12:04 PM Haisheng Yuan <h....@alibaba-inc.com>
wrote:
> Yes, looks like EnumerableTableFunctionScan doesn't override
> computeSelfCost.
>
> - Haisheng
>
> ------------------------------------------------------------------
> 发件人:Haisheng Yuan<h....@alibaba-inc.com>
> 日 期:2019年11月09日 04:01:19
> 收件人:Apache Calcite dev list<de...@calcite.apache.org>
> 主 题:Re: Re: Optimizer: All the inputs have relevant nodes, however the
> cost is still infinite.
>
> It is not surprising to get an infinitive cost, since the operators in the
> plan are logical operators, which need to be converted to physical
> operators to be costed. Did you try to add some implementation rules to the
> rule set, e.g. EnumerableProjectRule, EnumerableTableFunctionScanRule, etc..
>
> - Haisheng
>
> ------------------------------------------------------------------
> 发件人:Xiening Dai<xn...@gmail.com>
> 日 期:2019年11月09日 03:35:03
> 收件人:<de...@calcite.apache.org>
> 主 题:Re: Optimizer: All the inputs have relevant nodes, however the cost is
> still infinite.
>
> Are you able to provide a test case to repro on current code base?
>
> From the error message, the given subset’s best RelNode is not available,
> aka cost is infinite. There could be multiple cases leading to it.
>
>
> > On Nov 8, 2019, at 11:28 AM, Rui Wang <am...@apache.org> wrote:
> >
> > My current guess is it could because of `computeSelfCost` of
> > `EnumerableTableFunctionScan`.
> >
> >
> > -Rui
> >
> > On Fri, Nov 8, 2019 at 10:04 AM Rui Wang <am...@apache.org> wrote:
> >
> >> Hello community:
> >>
> >> I am stuck an optimizer error while working on Calcite-3272. I am less
> >> familiar with Calcite's optimizer and struggled to debug the following
> >> error message. Is there some hints on what direction I should go? I can
> >> also provide more information if that is helpful.
> >>
> >>
> >>
> >>> java.sql.SQLException: Error while executing SQL "select * FROM
> >> TABLE(TUMBLE(TABLE ORDERS, 'ROWTIME', INTERVAL '1' MINUTE))": There are
> not
> >> enough rules to produce a node with desired properties:
> >> convention=ENUMERABLE, sort=[]. All the inputs have relevant nodes,
> however
> >> the cost is still infinite.
> >>> Root: rel#26:Subset#2.ENUMERABLE.[]
> >>> Original rel:
> >>> LogicalProject(ROWTIME=[$0], ID=[$1], PRODUCT=[$2], UNITS=[$3],
> >> wstart=[$4], wend=[$5]): rowcount = 100.0, cumulative cost =
> >> {1.7976931348623157E308 rows, 1.7976931348623157E308 cpu,
> >> 1.7976931348623157E308 io}, id = 12
> >>> LogicalTableFunctionScan(invocation=[TUMBLE($3, 'ROWTIME',
> >> 60000:INTERVAL MINUTE)], rowType=[RecordType(TIMESTAMP(0) ROWTIME,
> INTEGER
> >> ID, VARCHAR(10) PRODUCT, INTEGER UNITS, TIMESTAMP(0) wstart,
> TIMESTAMP(0)
> >> wend)]): rowcount = 100.0, cumulative cost = {1.7976931348623157E308
> rows,
> >> 1.7976931348623157E308 cpu, 1.7976931348623157E308 io}, id = 10
> >>> LogicalProject(ROWTIME=[$0], ID=[$1], PRODUCT=[$2], UNITS=[$3]):
> >> rowcount = 100.0, cumulative cost = {200.0 rows, 501.0 cpu, 0.0 io}, id
> = 8
> >>> LogicalTableScan(table=[[ORINOCO, ORDERS]]): rowcount = 100.0,
> >> cumulative cost = {100.0 rows, 101.0 cpu, 0.0 io}, id = 2
> >>
> >>
> >>
> >> -Rui
> >>
>
>
Re: Re: Re: Optimizer: All the inputs have relevant nodes, however the cost is still infinite.
Posted by Haisheng Yuan <h....@alibaba-inc.com>.
Yes, looks like EnumerableTableFunctionScan doesn't override computeSelfCost.
- Haisheng
------------------------------------------------------------------
发件人:Haisheng Yuan<h....@alibaba-inc.com>
日 期:2019年11月09日 04:01:19
收件人:Apache Calcite dev list<de...@calcite.apache.org>
主 题:Re: Re: Optimizer: All the inputs have relevant nodes, however the cost is still infinite.
It is not surprising to get an infinitive cost, since the operators in the plan are logical operators, which need to be converted to physical operators to be costed. Did you try to add some implementation rules to the rule set, e.g. EnumerableProjectRule, EnumerableTableFunctionScanRule, etc..
- Haisheng
------------------------------------------------------------------
发件人:Xiening Dai<xn...@gmail.com>
日 期:2019年11月09日 03:35:03
收件人:<de...@calcite.apache.org>
主 题:Re: Optimizer: All the inputs have relevant nodes, however the cost is still infinite.
Are you able to provide a test case to repro on current code base?
From the error message, the given subset’s best RelNode is not available, aka cost is infinite. There could be multiple cases leading to it.
> On Nov 8, 2019, at 11:28 AM, Rui Wang <am...@apache.org> wrote:
>
> My current guess is it could because of `computeSelfCost` of
> `EnumerableTableFunctionScan`.
>
>
> -Rui
>
> On Fri, Nov 8, 2019 at 10:04 AM Rui Wang <am...@apache.org> wrote:
>
>> Hello community:
>>
>> I am stuck an optimizer error while working on Calcite-3272. I am less
>> familiar with Calcite's optimizer and struggled to debug the following
>> error message. Is there some hints on what direction I should go? I can
>> also provide more information if that is helpful.
>>
>>
>>
>>> java.sql.SQLException: Error while executing SQL "select * FROM
>> TABLE(TUMBLE(TABLE ORDERS, 'ROWTIME', INTERVAL '1' MINUTE))": There are not
>> enough rules to produce a node with desired properties:
>> convention=ENUMERABLE, sort=[]. All the inputs have relevant nodes, however
>> the cost is still infinite.
>>> Root: rel#26:Subset#2.ENUMERABLE.[]
>>> Original rel:
>>> LogicalProject(ROWTIME=[$0], ID=[$1], PRODUCT=[$2], UNITS=[$3],
>> wstart=[$4], wend=[$5]): rowcount = 100.0, cumulative cost =
>> {1.7976931348623157E308 rows, 1.7976931348623157E308 cpu,
>> 1.7976931348623157E308 io}, id = 12
>>> LogicalTableFunctionScan(invocation=[TUMBLE($3, 'ROWTIME',
>> 60000:INTERVAL MINUTE)], rowType=[RecordType(TIMESTAMP(0) ROWTIME, INTEGER
>> ID, VARCHAR(10) PRODUCT, INTEGER UNITS, TIMESTAMP(0) wstart, TIMESTAMP(0)
>> wend)]): rowcount = 100.0, cumulative cost = {1.7976931348623157E308 rows,
>> 1.7976931348623157E308 cpu, 1.7976931348623157E308 io}, id = 10
>>> LogicalProject(ROWTIME=[$0], ID=[$1], PRODUCT=[$2], UNITS=[$3]):
>> rowcount = 100.0, cumulative cost = {200.0 rows, 501.0 cpu, 0.0 io}, id = 8
>>> LogicalTableScan(table=[[ORINOCO, ORDERS]]): rowcount = 100.0,
>> cumulative cost = {100.0 rows, 101.0 cpu, 0.0 io}, id = 2
>>
>>
>>
>> -Rui
>>
Re: Re: Optimizer: All the inputs have relevant nodes, however the cost is still infinite.
Posted by Haisheng Yuan <h....@alibaba-inc.com>.
It is not surprising to get an infinitive cost, since the operators in the plan are logical operators, which need to be converted to physical operators to be costed. Did you try to add some implementation rules to the rule set, e.g. EnumerableProjectRule, EnumerableTableFunctionScanRule, etc..
- Haisheng
------------------------------------------------------------------
发件人:Xiening Dai<xn...@gmail.com>
日 期:2019年11月09日 03:35:03
收件人:<de...@calcite.apache.org>
主 题:Re: Optimizer: All the inputs have relevant nodes, however the cost is still infinite.
Are you able to provide a test case to repro on current code base?
From the error message, the given subset’s best RelNode is not available, aka cost is infinite. There could be multiple cases leading to it.
> On Nov 8, 2019, at 11:28 AM, Rui Wang <am...@apache.org> wrote:
>
> My current guess is it could because of `computeSelfCost` of
> `EnumerableTableFunctionScan`.
>
>
> -Rui
>
> On Fri, Nov 8, 2019 at 10:04 AM Rui Wang <am...@apache.org> wrote:
>
>> Hello community:
>>
>> I am stuck an optimizer error while working on Calcite-3272. I am less
>> familiar with Calcite's optimizer and struggled to debug the following
>> error message. Is there some hints on what direction I should go? I can
>> also provide more information if that is helpful.
>>
>>
>>
>>> java.sql.SQLException: Error while executing SQL "select * FROM
>> TABLE(TUMBLE(TABLE ORDERS, 'ROWTIME', INTERVAL '1' MINUTE))": There are not
>> enough rules to produce a node with desired properties:
>> convention=ENUMERABLE, sort=[]. All the inputs have relevant nodes, however
>> the cost is still infinite.
>>> Root: rel#26:Subset#2.ENUMERABLE.[]
>>> Original rel:
>>> LogicalProject(ROWTIME=[$0], ID=[$1], PRODUCT=[$2], UNITS=[$3],
>> wstart=[$4], wend=[$5]): rowcount = 100.0, cumulative cost =
>> {1.7976931348623157E308 rows, 1.7976931348623157E308 cpu,
>> 1.7976931348623157E308 io}, id = 12
>>> LogicalTableFunctionScan(invocation=[TUMBLE($3, 'ROWTIME',
>> 60000:INTERVAL MINUTE)], rowType=[RecordType(TIMESTAMP(0) ROWTIME, INTEGER
>> ID, VARCHAR(10) PRODUCT, INTEGER UNITS, TIMESTAMP(0) wstart, TIMESTAMP(0)
>> wend)]): rowcount = 100.0, cumulative cost = {1.7976931348623157E308 rows,
>> 1.7976931348623157E308 cpu, 1.7976931348623157E308 io}, id = 10
>>> LogicalProject(ROWTIME=[$0], ID=[$1], PRODUCT=[$2], UNITS=[$3]):
>> rowcount = 100.0, cumulative cost = {200.0 rows, 501.0 cpu, 0.0 io}, id = 8
>>> LogicalTableScan(table=[[ORINOCO, ORDERS]]): rowcount = 100.0,
>> cumulative cost = {100.0 rows, 101.0 cpu, 0.0 io}, id = 2
>>
>>
>>
>> -Rui
>>
Re: Optimizer: All the inputs have relevant nodes, however the cost
is still infinite.
Posted by Xiening Dai <xn...@gmail.com>.
Are you able to provide a test case to repro on current code base?
From the error message, the given subset’s best RelNode is not available, aka cost is infinite. There could be multiple cases leading to it.
> On Nov 8, 2019, at 11:28 AM, Rui Wang <am...@apache.org> wrote:
>
> My current guess is it could because of `computeSelfCost` of
> `EnumerableTableFunctionScan`.
>
>
> -Rui
>
> On Fri, Nov 8, 2019 at 10:04 AM Rui Wang <am...@apache.org> wrote:
>
>> Hello community:
>>
>> I am stuck an optimizer error while working on Calcite-3272. I am less
>> familiar with Calcite's optimizer and struggled to debug the following
>> error message. Is there some hints on what direction I should go? I can
>> also provide more information if that is helpful.
>>
>>
>>
>>> java.sql.SQLException: Error while executing SQL "select * FROM
>> TABLE(TUMBLE(TABLE ORDERS, 'ROWTIME', INTERVAL '1' MINUTE))": There are not
>> enough rules to produce a node with desired properties:
>> convention=ENUMERABLE, sort=[]. All the inputs have relevant nodes, however
>> the cost is still infinite.
>>> Root: rel#26:Subset#2.ENUMERABLE.[]
>>> Original rel:
>>> LogicalProject(ROWTIME=[$0], ID=[$1], PRODUCT=[$2], UNITS=[$3],
>> wstart=[$4], wend=[$5]): rowcount = 100.0, cumulative cost =
>> {1.7976931348623157E308 rows, 1.7976931348623157E308 cpu,
>> 1.7976931348623157E308 io}, id = 12
>>> LogicalTableFunctionScan(invocation=[TUMBLE($3, 'ROWTIME',
>> 60000:INTERVAL MINUTE)], rowType=[RecordType(TIMESTAMP(0) ROWTIME, INTEGER
>> ID, VARCHAR(10) PRODUCT, INTEGER UNITS, TIMESTAMP(0) wstart, TIMESTAMP(0)
>> wend)]): rowcount = 100.0, cumulative cost = {1.7976931348623157E308 rows,
>> 1.7976931348623157E308 cpu, 1.7976931348623157E308 io}, id = 10
>>> LogicalProject(ROWTIME=[$0], ID=[$1], PRODUCT=[$2], UNITS=[$3]):
>> rowcount = 100.0, cumulative cost = {200.0 rows, 501.0 cpu, 0.0 io}, id = 8
>>> LogicalTableScan(table=[[ORINOCO, ORDERS]]): rowcount = 100.0,
>> cumulative cost = {100.0 rows, 101.0 cpu, 0.0 io}, id = 2
>>
>>
>>
>> -Rui
>>
Re: Optimizer: All the inputs have relevant nodes, however the cost
is still infinite.
Posted by Rui Wang <am...@apache.org>.
My current guess is it could because of `computeSelfCost` of
`EnumerableTableFunctionScan`.
-Rui
On Fri, Nov 8, 2019 at 10:04 AM Rui Wang <am...@apache.org> wrote:
> Hello community:
>
> I am stuck an optimizer error while working on Calcite-3272. I am less
> familiar with Calcite's optimizer and struggled to debug the following
> error message. Is there some hints on what direction I should go? I can
> also provide more information if that is helpful.
>
>
>
> > java.sql.SQLException: Error while executing SQL "select * FROM
> TABLE(TUMBLE(TABLE ORDERS, 'ROWTIME', INTERVAL '1' MINUTE))": There are not
> enough rules to produce a node with desired properties:
> convention=ENUMERABLE, sort=[]. All the inputs have relevant nodes, however
> the cost is still infinite.
> > Root: rel#26:Subset#2.ENUMERABLE.[]
> > Original rel:
> > LogicalProject(ROWTIME=[$0], ID=[$1], PRODUCT=[$2], UNITS=[$3],
> wstart=[$4], wend=[$5]): rowcount = 100.0, cumulative cost =
> {1.7976931348623157E308 rows, 1.7976931348623157E308 cpu,
> 1.7976931348623157E308 io}, id = 12
> > LogicalTableFunctionScan(invocation=[TUMBLE($3, 'ROWTIME',
> 60000:INTERVAL MINUTE)], rowType=[RecordType(TIMESTAMP(0) ROWTIME, INTEGER
> ID, VARCHAR(10) PRODUCT, INTEGER UNITS, TIMESTAMP(0) wstart, TIMESTAMP(0)
> wend)]): rowcount = 100.0, cumulative cost = {1.7976931348623157E308 rows,
> 1.7976931348623157E308 cpu, 1.7976931348623157E308 io}, id = 10
> > LogicalProject(ROWTIME=[$0], ID=[$1], PRODUCT=[$2], UNITS=[$3]):
> rowcount = 100.0, cumulative cost = {200.0 rows, 501.0 cpu, 0.0 io}, id = 8
> > LogicalTableScan(table=[[ORINOCO, ORDERS]]): rowcount = 100.0,
> cumulative cost = {100.0 rows, 101.0 cpu, 0.0 io}, id = 2
>
>
>
> -Rui
>