KurtYoung 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_r354120087
##########
File path:
flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/rules/logical/PushPartitionIntoTableSourceScanRule.scala
##########
@@ -112,14 +125,28 @@ 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 {
+ case Some(catalog) =>
+ def mergePartitionStats(): TableStats = {
Review comment:
why creating an inner function?
----------------------------------------------------------------
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