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

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

Sorry, some more post-commit review:
* The rule for Join is wrong for outer joins. Should +1 each outer side. Also, 
left and right could be null.
* The rule for Aggregate is wrong if the group key is empty. Always returns 1 
row, even if the input is empty.
* The rule for Aggregate is wrong if there are grouping sets. 
* The rule for Sort adds offset and limit. Should it not subtract offset from 
limit? 
* Add a rule for Values. Will be extremely useful. Especially since we 
represent the empty relation as a Values with 0 rows.
* Rules for Intersect, Minus would be somewhat useful. Return 
{{getMaxRowCount(inputs[0])}}.
* The description if CALCITE-987 in testSortUnionTranspose3 is wrong.
* The javadoc for RelMetadataQuery.getMaxRowCount has a copy-paste error.

I don't know whether it would be possible to add a test to RelMetadataTest. I 
see testRowCountEmp is disabled. I should investigate why.

> 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