xuyangzhong commented on code in PR #26162:
URL: https://github.com/apache/flink/pull/26162#discussion_r1987137226
##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/optimize/program/FlinkRecomputeStatisticsProgram.java:
##########
@@ -115,25 +115,26 @@ private TableStats recomputeStatistics(
FilterPushDownSpec filterPushDownSpec,
boolean reportStatEnabled) {
TableStats origTableStats = table.getStatistic().getTableStats();
+ // bail out early if stats computation is disabled.
+ if (!reportStatEnabled) {
+ return origTableStats;
+ }
DynamicTableSource tableSource = table.tableSource();
if (filterPushDownSpec != null &&
!filterPushDownSpec.isAllPredicatesRetained()) {
// filter push down but some predicates are accepted by source and
not in reaming
// predicates
// the catalog do not support get statistics with filters,
- // so only call reportStatistics method if reportStatEnabled is
true
+ // so call reportStatistics method of the table source.
// TODO estimate statistics by selectivity
- return reportStatEnabled
- ? ((SupportsStatisticReport)
tableSource).reportStatistics()
- : null;
Review Comment:
I believe we should retain the logic that returns null, as our initial
commit indicated the intention to remove table statistics after filter
pushdown, rather than using the existing table statistics. See more here #Line
182
https://github.com/apache/flink/pull/12866/files#diff-cf75b056be8a3cf477444a51584fe44a08e0c5e8b8c553c8f4f07a202830edf1
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]