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

    https://github.com/apache/flink/pull/3860#discussion_r115683256
  
    --- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/plan/nodes/PhysicalTableSourceScan.scala
 ---
    @@ -70,4 +73,18 @@ abstract class PhysicalTableSourceScan(
     
       def copy(traitSet: RelTraitSet, tableSource: TableSource[_]): 
PhysicalTableSourceScan
     
    +  override def estimateRowCount(mq: RelMetadataQuery): Double = {
    +    val tableSourceTable = getTable.unwrap(classOf[TableSourceTable[_]])
    +
    +    if (tableSourceTable.getStatistic != FlinkStatistic.UNKNOWN) {
    --- End diff --
    
    Is accessing the registered `TableSourceTable` first and falling back to 
the `TableSource` the right order?
    What if the `TableSource` applies a filter? This would not be taken into 
account when querying the `TableSourceTable`.
    
    Or would we track a `selectivity` parameter when 
`PushFilterIntoTableSourceScanRule` is applied and multiply that here?


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