talatuyarer commented on code in PR #17878:
URL: https://github.com/apache/iceberg/pull/17878#discussion_r3915724640
##########
flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/source/IcebergTableSource.java:
##########
@@ -228,6 +257,21 @@ public Optional<Integer> getParallelism() {
};
}
+ @Override
+ public TableStats reportStatistics() {
+ try {
+ boolean columnStatsEnabled =
+
readableConfig.get(FlinkConfigOptions.TABLE_EXEC_ICEBERG_REPORT_COLUMN_STATISTICS);
+ Table loadedTable = table();
+ FlinkReadConf readConf = new FlinkReadConf(loadedTable, properties,
readableConfig);
+ return FlinkTableStatistics.reportStatistics(
Review Comment:
Short Answer:Yes
SupportsStatisticReport was introduced by
[FLIP-231](https://cwiki.apache.org/confluence/spaces/FLINK/pages/211883859/FLIP-231+Introduce+SupportsStatisticReport+to+support+reporting+statistics+from+source+connectors)
explicitly as an estimation interface for the cost-based optimizer, to
compensate for missing catalog statistics:
The [interface
Javadoc](https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/connector/source/abilities/SupportsStatisticReport.java#L26)
opens with "Enables to report the estimated statistics provided by the
DynamicTableSource" and describes them as "one of the most important inputs to
the optimizer cost model". They only influence plan choice (join order,
broadcast-vs-shuffle); a wrong estimate can produce a suboptimal plan, never a
wrong result.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]