Re: Optimizer: All the inputs have relevant nodes, however the cost is still infinite.

2019-11-13 Thread Rui Wang
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.vladi...@gmail.com> wrote: > I typically use http://www.webgraphviz.com/ > > Try pasting digraph { ... } part

Re: Optimizer: All the inputs have relevant nodes, however the cost is still infinite.

2019-11-13 Thread Vladimir Sitnikov
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.

2019-11-13 Thread Rui Wang
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]:

Re: Optimizer: All the inputs have relevant nodes, however the cost is still infinite.

2019-11-13 Thread Xiening Dai
No, I didn’t get a chance. Thanks for diagnosing. > On Nov 13, 2019, at 7:55 AM, Vladimir Sitnikov > 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

Re: Re: Re: Optimizer: All the inputs have relevant nodes, however the cost is still infinite.

2019-11-13 Thread Vladimir Sitnikov
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

Re: Re: Re: Optimizer: All the inputs have relevant nodes, however the cost is still infinite.

2019-11-12 Thread Rui Wang
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

Re: Re: Re: Optimizer: All the inputs have relevant nodes, however the cost is still infinite.

2019-11-08 Thread Rui Wang
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

Re: Re: Re: Optimizer: All the inputs have relevant nodes, however the cost is still infinite.

2019-11-08 Thread Haisheng Yuan
Yes, looks like EnumerableTableFunctionScan doesn't override computeSelfCost. - Haisheng -- 发件人:Haisheng Yuan 日 期:2019年11月09日 04:01:19 收件人:Apache Calcite dev list 主 题:Re: Re: Optimizer: All the inputs have relevant nodes, however

Re: Re: Optimizer: All the inputs have relevant nodes, however the cost is still infinite.

2019-11-08 Thread Haisheng Yuan
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..

Re: Optimizer: All the inputs have relevant nodes, however the cost is still infinite.

2019-11-08 Thread Xiening Dai
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 wrote: > > My current guess is it could

Re: Optimizer: All the inputs have relevant nodes, however the cost is still infinite.

2019-11-08 Thread Rui Wang
My current guess is it could because of `computeSelfCost` of `EnumerableTableFunctionScan`. -Rui On Fri, Nov 8, 2019 at 10:04 AM Rui Wang 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

Optimizer: All the inputs have relevant nodes, however the cost is still infinite.

2019-11-08 Thread Rui Wang
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. >