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

Julian Hyde commented on CALCITE-987:
-------------------------------------

I disagree with you both about Intersect. If we have intersect(A, B, C), and A, 
B, C have max row counts of 1000, unknown, 40, then the answer is 40. Intersect 
max row count is the minimum of its inputs' row max row counts, and it is safe 
to treat unknown as +infinity.

I agree regarding estimateJoinedRows. I will add the null check.

> Push limit 0 will result in an infinite loop
> --------------------------------------------
>
>                 Key: CALCITE-987
>                 URL: https://issues.apache.org/jira/browse/CALCITE-987
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.5.0
>            Reporter: Pengcheng Xiong
>            Assignee: Pengcheng Xiong
>             Fix For: 1.6.0
>
>         Attachments: CALCITE-987.01.patch, CALCITE-987.02.patch, 
> CALCITE-987.03.patch, CALCITE-987.04.patch
>
>
> We use "checkInputForCollationAndLimit" in RelMdUtil.java to check the input 
> #rows. However, it calls RelMetadataQuery.getRowCount which will validate the 
> #rows. The validation will change #row=0 to #row=1. This will result in an 
> infinite loop to push limit. The affected rules include 
> SortUnionTransposeRule and any Sort***TransposeRules that call  
> checkInputForCollationAndLimit.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to