You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2020/04/11 03:56:28 UTC

[GitHub] [calcite] hsyuan commented on a change in pull request #1907: [CALCITE-3909] RelMdMinRowCount doesn't take into account UNION DISTINCT

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:
users@infra.apache.org


With regards,
Apache Git Services