hsyuan 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_r407013426
 
 

 ##########
 File path: 
core/src/main/java/org/apache/calcite/rel/metadata/RelMdMinRowCount.java
 ##########
 @@ -61,7 +61,16 @@ public Double getMinRowCount(Union rel, RelMetadataQuery 
mq) {
         rowCount += partialRowCount;
       }
     }
-    return rowCount;
+
+    if (rel.all) {
+      return rowCount;
+    } else {
+      if (rowCount < 1) {
+        return rowCount;
+      } else {
+        return 1d;
+      }
 
 Review comment:
   `return min(rowCount, 1d);`

----------------------------------------------------------------
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

Reply via email to