godfreyhe commented on a change in pull request #10315: [FLINK-14552][table] 
Enable partition statistics in blink planner
URL: https://github.com/apache/flink/pull/10315#discussion_r352473315
 
 

 ##########
 File path: 
flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/rules/logical/PushPartitionIntoTableSourceScanRule.scala
 ##########
 @@ -112,14 +124,16 @@ class PushPartitionIntoTableSourceScanRule extends 
RelOptRule(
     }
 
     val statistic = tableSourceTable.getStatistic
-    val newStatistic = if (remainingPartitions.size() == allPartitions.size()) 
{
-      // Keep all Statistics if no predicates can be pushed down
-      statistic
-    } else if (statistic == FlinkStatistic.UNKNOWN) {
-      statistic
-    } else {
-      // Remove tableStats after predicates pushed down
-      FlinkStatistic.builder().statistic(statistic).tableStats(null).build()
+    val newStatistic = {
+      val tableStats = catalogOption match {
 
 Review comment:
   if no partitions are pruned and the original `TableStats` is not `UNKNOWN`, 
we could use the original `TableStats` and avoid fetch all partitions' 
statistics

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