[jira] [Commented] (CALCITE-4432) When the RelNode's input is the same subset as the node belonged to, not choose this node as best.

2021-01-11 Thread Julian Hyde (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-4432?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17263099#comment-17263099
 ] 

Julian Hyde commented on CALCITE-4432:
--

[~thomas.rebele], That seems reasonable. Since all 3 parts of the cost must be 
non-negative, the check should throw if {{parent cpu < child cpu}}, or if 
{{parent io < child io}}, or if {{parent rows < child rows}}. (That's slightly 
stronger than your suggestion, {{parent cost < child cost}}, because {{<}} is 
not a total order.)

> When the RelNode's input is the same subset as the node belonged to, not 
> choose this node as best.
> --
>
> Key: CALCITE-4432
> URL: https://issues.apache.org/jira/browse/CALCITE-4432
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Reporter: Ziwei Liu
>Assignee: Ziwei Liu
>Priority: Major
>
> If a subset have a cyclic node, the node's input is this subset itself. If 
> the beset 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (CALCITE-4432) When the RelNode's input is the same subset as the node belonged to, not choose this node as best.

2021-01-04 Thread Thomas Rebele (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-4432?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17258108#comment-17258108
 ] 

Thomas Rebele commented on CALCITE-4432:


Would it be possible to add a check "if parent cost < child cost throw 
exception" in the planner? That would help to find the root cause much faster.

> When the RelNode's input is the same subset as the node belonged to, not 
> choose this node as best.
> --
>
> Key: CALCITE-4432
> URL: https://issues.apache.org/jira/browse/CALCITE-4432
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Reporter: Ziwei Liu
>Assignee: Ziwei Liu
>Priority: Major
>
> If a subset have a cyclic node, the node's input is this subset itself. If 
> the beset 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (CALCITE-4432) When the RelNode's input is the same subset as the node belonged to, not choose this node as best.

2020-12-23 Thread Liya Fan (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-4432?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17254371#comment-17254371
 ] 

Liya Fan commented on CALCITE-4432:
---

[~rubenql] It seems the problem you are facing is similar to the one reported 
in this issue:

problem with the cost model =>
the cost of a child greater than that of its parent =>
the parent node is selected as the best of the child's RelSubset =>
a cycle is formed

> When the RelNode's input is the same subset as the node belonged to, not 
> choose this node as best.
> --
>
> Key: CALCITE-4432
> URL: https://issues.apache.org/jira/browse/CALCITE-4432
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Reporter: Ziwei Liu
>Assignee: Ziwei Liu
>Priority: Major
>
> If a subset have a cyclic node, the node's input is this subset itself. If 
> the beset 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (CALCITE-4432) When the RelNode's input is the same subset as the node belonged to, not choose this node as best.

2020-12-23 Thread Ruben Q L (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-4432?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17254136#comment-17254136
 ] 

Ruben Q L commented on CALCITE-4432:


UPDATE: finally I discovered the root cause of my CyclicMetadataException: it 
was also a metadata cost computation problem. At some point during Volcano 
optimization, an operator had a lower cost than its input's cost. The reason 
for this anomaly was a bug in the RelMdColumnUniqueness computation of a 
certain IndexScan operator in my downstream project.

> When the RelNode's input is the same subset as the node belonged to, not 
> choose this node as best.
> --
>
> Key: CALCITE-4432
> URL: https://issues.apache.org/jira/browse/CALCITE-4432
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Reporter: Ziwei Liu
>Assignee: Ziwei Liu
>Priority: Major
>
> If a subset have a cyclic node, the node's input is this subset itself. If 
> the beset 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (CALCITE-4432) When the RelNode's input is the same subset as the node belonged to, not choose this node as best.

2020-12-17 Thread Ruben Q L (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-4432?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17251031#comment-17251031
 ] 

Ruben Q L commented on CALCITE-4432:


[~Ziwei Liu], [~FatLittle] could you provide more info on this subject? Do you 
manage to get a unit test that reproduces the problem? [~thomas.rebele] and I 
are currently facing a very strange {{CyclicMetadataException}} issue and, from 
what you described, it might be related to this bug.

> When the RelNode's input is the same subset as the node belonged to, not 
> choose this node as best.
> --
>
> Key: CALCITE-4432
> URL: https://issues.apache.org/jira/browse/CALCITE-4432
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Reporter: Ziwei Liu
>Assignee: Ziwei Liu
>Priority: Major
>
> If a subset have a cyclic node, the node's input is this subset itself. If 
> the beset 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (CALCITE-4432) When the RelNode's input is the same subset as the node belonged to, not choose this node as best.

2020-12-16 Thread Jinpeng Wu (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-4432?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17250183#comment-17250183
 ] 

Jinpeng Wu commented on CALCITE-4432:
-

I get no more idea currently.

I know that [~hyuan] spent some time on this problem. Maybe [~hyuan] can share 
some findings. 

> When the RelNode's input is the same subset as the node belonged to, not 
> choose this node as best.
> --
>
> Key: CALCITE-4432
> URL: https://issues.apache.org/jira/browse/CALCITE-4432
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Reporter: Ziwei Liu
>Assignee: Ziwei Liu
>Priority: Major
>
> If a subset have a cyclic node, the node's input is this subset itself. If 
> the beset 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (CALCITE-4432) When the RelNode's input is the same subset as the node belonged to, not choose this node as best.

2020-12-15 Thread Julian Hyde (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-4432?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17249874#comment-17249874
 ] 

Julian Hyde commented on CALCITE-4432:
--

That sounds plausible. Do you have a solution for people not using the top-down 
driver? Besides “use the top-down driver”. 

> When the RelNode's input is the same subset as the node belonged to, not 
> choose this node as best.
> --
>
> Key: CALCITE-4432
> URL: https://issues.apache.org/jira/browse/CALCITE-4432
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Reporter: Ziwei Liu
>Assignee: Ziwei Liu
>Priority: Major
>
> If a subset have a cyclic node, the node's input is this subset itself. If 
> the beset 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (CALCITE-4432) When the RelNode's input is the same subset as the node belonged to, not choose this node as best.

2020-12-14 Thread Jinpeng Wu (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-4432?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17248795#comment-17248795
 ] 

Jinpeng Wu commented on CALCITE-4432:
-

Hi, Julian. I think the top-down rule driver may be a general solution for this 
problem:
 # Transformation rules that lead to set merging are generally fired before 
implementations rules
 # During implemetation/optimization phase, optimization will stop directly 
when cycles are detected. So cyclic nodes should have no chance to become the 
best of its RelSubset. 

 

> When the RelNode's input is the same subset as the node belonged to, not 
> choose this node as best.
> --
>
> Key: CALCITE-4432
> URL: https://issues.apache.org/jira/browse/CALCITE-4432
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Reporter: Ziwei Liu
>Assignee: Ziwei Liu
>Priority: Major
>
> If a subset have a cyclic node, the node's input is this subset itself. If 
> the beset 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (CALCITE-4432) When the RelNode's input is the same subset as the node belonged to, not choose this node as best.

2020-12-10 Thread Julian Hyde (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-4432?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17247585#comment-17247585
 ] 

Julian Hyde commented on CALCITE-4432:
--

I'm curious: what was the resolution here?

I agree that cyclic graphs are a problem. [~FatLittle]'s suggestion to use the 
cost model often works, but not always (e.g. if the arc adds no cost). So, I'd 
like to come up with a general-purpose way to deal with cyclic graphs. Any 
ideas will help.

> When the RelNode's input is the same subset as the node belonged to, not 
> choose this node as best.
> --
>
> Key: CALCITE-4432
> URL: https://issues.apache.org/jira/browse/CALCITE-4432
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Reporter: Ziwei Liu
>Assignee: Ziwei Liu
>Priority: Major
>
> If a subset have a cyclic node, the node's input is this subset itself. If 
> the beset 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (CALCITE-4432) When the RelNode's input is the same subset as the node belonged to, not choose this node as best.

2020-12-10 Thread Jinpeng Wu (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-4432?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17247170#comment-17247170
 ] 

Jinpeng Wu commented on CALCITE-4432:
-

For example, there is a RelSubset A with best as X. RelSubset B with best Y is 
the input subset of X. When A is merged with B, A's best should be replaced by 
Y as X's cost should always greater than Y's cost.  

This bug is fired when X's cost is not greater than Y's cost. 

There are all kinds of reason why Y's cost is not always larger than X's cost. 
For example, X's selfCost is underflowed or X's totalCost is overflowed. 

But these should be the issue of cost model, not calcite core. 

 

> When the RelNode's input is the same subset as the node belonged to, not 
> choose this node as best.
> --
>
> Key: CALCITE-4432
> URL: https://issues.apache.org/jira/browse/CALCITE-4432
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Reporter: Ziwei Liu
>Assignee: Ziwei Liu
>Priority: Major
>
> If a subset have a cyclic node, the node's input is this subset itself. If 
> the beset 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)