Github user fhueske commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2025#discussion_r64338066
  
    --- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/api/table/plan/nodes/dataset/DataSetUnion.scala
 ---
    @@ -69,7 +73,7 @@ class DataSetUnion(
           rows + metadata.getRowCount(child)
         }
     
    -    planner.getCostFactory.makeCost(rowCnt, 0, 0)
    +    planner.getCostFactory.makeCost(if (all) rowCnt else rowCnt * 0.1, 0, 
0)
    --- End diff --
    
    The cost for union should be higher than for union all. Also, `rowCnt` is 
the number of rows processed, not the result size.
    How about this?
    ```
    planner.getCostFactory.makeCost(
      rowCnt, 
      if (all) 0 else, rowCnt,
      if (all) 0 else rowCnt)
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to