hsyuan commented on a change in pull request #1410: [CALCITE-3287] Fix minor
bug, getRowCount for union in RelMdRowCount.java not consider 'union all'
URL: https://github.com/apache/calcite/pull/1410#discussion_r317417476
##########
File path:
core/src/main/java/org/apache/calcite/rel/metadata/RelMdRowCount.java
##########
@@ -83,15 +83,7 @@ public Double getRowCount(RelSubset subset,
RelMetadataQuery mq) {
}
public Double getRowCount(Union rel, RelMetadataQuery mq) {
- double rowCount = 0.0;
- for (RelNode input : rel.getInputs()) {
- Double partialRowCount = mq.getRowCount(input);
- if (partialRowCount == null) {
- return null;
- }
- rowCount += partialRowCount;
- }
- return rowCount;
+ return rel.estimateRowCount(mq);
Review comment:
`Union.estimateRowCount` doesn't take into account the case that one of the
inputs might return null.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services