Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.37.0
Description
An Aggregate with constant key can get a RowCount greater than its MaxRowCount.
The root cause is that this logic in RelMdMaxRowCount
// 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; } }
is not applied in RelMdRowCount.
Therefore we can get an Aggregate whose MaxRowCount is 1, but its RowCount is X (> 1).
Attachments
Issue Links
- links to