[
https://issues.apache.org/jira/browse/CALCITE-6665?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17906565#comment-17906565
]
Julian Hyde commented on CALCITE-6665:
--------------------------------------
That sounds reasonable. (People will need to be a bit careful because not
knowing that it is empty is confusingly similar to knowing that it is not
empty.)
I don't mind whether we use {{maxRowCount < 1D}} and {{maxRowCount == 0D}}. If
an implementation of {{maxRowCount}} returns different values for those
statistics then it has a bug and should be fixed. But it would be wrong to use
{{maxRowCount <= 1D}} as the criterion.
Can you please link the PR to this case.
> Add isEmpty metadata to check if a relational expression returns no rows
> ------------------------------------------------------------------------
>
> Key: CALCITE-6665
> URL: https://issues.apache.org/jira/browse/CALCITE-6665
> Project: Calcite
> Issue Type: Improvement
> Reporter: xiong duan
> Priority: Major
>
> In Calcite, there are many times to determine whether a relational expression
> returns 0 rows through maxRowCount.
> But some places use `maxRowCount<=1D` while others use `maxRowCount ==0D`.
> This PR mainly aims to add `@Nullable Boolean
> RelMetadataQuery.isEmpty(RelNode)` to unify this behavior.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)