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

Pengcheng Xiong commented on CALCITE-987:
-----------------------------------------

[~jcamachorodriguez], thanks for your comments. i partially agree with your 
opinion. But please also note that we had a similar discussion before "whether 
to use 0 or 1 for explain when a hive operator outputs 0 rows". We followed 
what Postgres does, i.e., validate it to 1. So, if this "getRowCount" is used 
externally, e.g., in explain, i would prefer to validate it to 1. Else if it is 
used internally, e.g., in pushing limit through union/join, i would prefer not 
to validate it. Thus, i would like to have two functions, i.e., what i did in 
the patch. Let's see [~julianhyde]'s opinion on this. :)

> 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
>            Reporter: Pengcheng Xiong
>            Assignee: Pengcheng Xiong
>         Attachments: CALCITE-987.01.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