@@ -0,0 +1,2065 @@
+/*%0A * Licensed to the Apache Software Foundation (ASF) under one%0A * or more contributor license agreements.  See the NOTICE file%0A * distributed with this work for additional information%0A * regarding copyright ownership.  The ASF licenses this file%0A * to you under the Apache License, Version 2.0 (the%0A * %22License%22); you may not use this file except in compliance%0A * with the License.  You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage org.apache.flink.table.connector.source.abilities;%0A%0Aimport org.apache.flink.annotation.PublicEvolving;%0Aimport org.apache.flink.table.connector.source.DynamicTableSource;%0Aimport org.apache.flink.table.plan.stats.TableStats;%0A%0A/**%0A * Enables to report the estimated statistics provided by the %7B@link DynamicTableSource%7D.%0A *%0A * %3Cp%3EStatistics are one of the most important inputs to the optimizer cost model, which will%0A * generate the most effective execution plan with the lowest cost among all considered candidate%0A * plans.%0A *%0A * %3Cp%3EThis interface is used to compensate for the missing of statistics in the catalog. The planner%0A * will call %7B@link #reportStatistics%7D method when the planner detects the statistics from catalog%0A * is unknown. Therefore, the method will be executed as needed.%0A *%0A * %3Cp%3ENote: This method is called at plan optimization phase, the implementation of this interface%0A * should be as light as possible, but more complete information.%0A */%0A@PublicEvolving%0Apublic interface SupportsStatisticReport %7B%0A%0A    /**%0A     * Returns the estimated statistics of this %7B@link DynamicTableSource%7D, else %7B@link%0A     * TableStats#UNKNOWN%7D if some situations are not supported or cannot be handled.%0A     */%0A    TableStats reportStatistics();%0A%7D%0A

Introduce SupportsStatisticsReport interface