flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fhueske <...@git.apache.org>
Subject [GitHub] flink pull request #3058: [FLINK-5394] [Table API & SQL]the estimateRowCount...
Date Tue, 10 Jan 2017 14:28:53 GMT
Github user fhueske commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3058#discussion_r95372931
  
    --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/plan/nodes/dataset/DataSetSort.scala
---
    @@ -71,6 +72,21 @@ class DataSetSort(
         )
       }
     
    +  override def estimateRowCount(metadata: RelMetadataQuery): Double = {
    +    val inputRowCnt = metadata.getRowCount(this.getInput)
    +    if (inputRowCnt == null) {
    +      inputRowCnt
    +    } else {
    +      val rowCount = Math.max(inputRowCnt - limitStart, 0D)
    --- End diff --
    
    Returning a cardinality estimate of `0` is not a good idea because all remaining operations
might appear to have no costs at all. Rather be conservative and return `1` which is still
low but does not invalidate any subsequent costs.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message