Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.25.0
-
None
-
None
Description
currently getMaxRowCount(RelSubset rel, RelMetadataQuery mq) only have a short term fix for CALCITE-1018. https://issues.apache.org/jira/browse/CALCITE-1018
we need a complete solution for this, as suggested in https://issues.apache.org/jira/browse/CALCITE-1048
quotes: Clearly RelMdMaxRowCount of a RelSubset should be the lowest max-row-count of any relational expression in that subset. Each kind of metadata should have a way of deriving a subset's value from the constituent rel values; in the case of RelMdMaxRowCount the roll-up function is "min".
also a sample solution provided by weijie :
public Double getMaxRowCount(RelSubset rel, RelMetadataQuery mq) { Double lowest = Double.POSITIVE_INFINITY; for (RelNode node : rel.getRels()) { Double maxRowCount = mq.getMaxRowCount(node); if (maxRowCount == null)
if (lowest.compareTo(maxRowCount) > 0) {
lowest = maxRowCount;
}
} return lowest;
}
then comments from jhyde :
quote: I was thinking of doing the same thing in a more abstract way, namely providing a "fold" function.
this ticket is opened to address this issue. this is also related to the following ticket:
Attachments
Issue Links
- Blocked
-
CALCITE-6586 Some Rules not firing due to RelMdPredicates returning null in VolcanoPlanner
- Resolved
- is related to
-
CALCITE-1048 Make metadata more robust
- Open
-
CALCITE-1018 SortJoinTransposeRule not firing due to getMaxRowCount(RelSubset) returning null
- Closed