[ 
https://issues.apache.org/jira/browse/CALCITE-6474?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ruben Q L resolved CALCITE-6474.
--------------------------------
    Resolution: Fixed

Fixed via 
[{{a27a8de}}|https://github.com/apache/calcite/commit/a27a8de278d06f0fa5875df4dc1bbbedc6a2213a]
 .

Thanks [~mbudiu], [~cancai] for helping with the review!

> Aggregate with constant key can get a RowCount greater than its MaxRowCount
> ---------------------------------------------------------------------------
>
>                 Key: CALCITE-6474
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6474
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.37.0
>            Reporter: Ruben Q L
>            Assignee: Ruben Q L
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.38.0
>
>
> An Aggregate with constant key can get a RowCount greater than its 
> MaxRowCount.
> The root cause is that this logic in RelMdMaxRowCount
> {code}
> // Aggregate with constant GROUP BY always returns 1 row
> if (rel.getGroupType() == Aggregate.Group.SIMPLE) {
>   final RelOptPredicateList predicateList =
>     mq.getPulledUpPredicates(rel.getInput());
>   if (!RelOptPredicateList.isEmpty(predicateList)
>     && allGroupKeysAreConstant(rel, predicateList)) {
>     return 1D;
>   }
> }
> {code}
> is not applied in RelMdRowCount.
> Therefore we can get an Aggregate whose MaxRowCount is 1, but its RowCount is 
> X (> 1).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to