chunweilei commented on a change in pull request #1907: [CALCITE-3909]
RelMdMinRowCount doesn't take into account UNION DISTINCT
URL: https://github.com/apache/calcite/pull/1907#discussion_r407318030
##########
File path:
core/src/main/java/org/apache/calcite/rel/metadata/RelMdMinRowCount.java
##########
@@ -61,7 +61,12 @@ public Double getMinRowCount(Union rel, RelMetadataQuery
mq) {
rowCount += partialRowCount;
}
}
- return rowCount;
+
+ if (rel.all) {
+ return rowCount;
+ } else {
+ return Math.min(rowCount, 1d);
+ }
Review comment:
Considering there would not be a huge overhead, I prefer it more readable.
----------------------------------------------------------------
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