Github user beyond1920 commented on a diff in the pull request: https://github.com/apache/flink/pull/4681#discussion_r140462814 --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/plan/schema/FlinkRelOptTable.scala --- @@ -0,0 +1,265 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.flink.table.plan.schema + +import org.apache.calcite.plan.{RelOptCluster, RelOptSchema, RelOptTable} +import org.apache.calcite.rel.`type`.RelDataType +import org.apache.calcite.prepare.CalcitePrepareImpl +import java.util.{List => JList} + +import com.google.common.collect.ImmutableList +import org.apache.calcite.adapter.enumerable.EnumerableTableScan +import org.apache.calcite.linq4j.tree.Expression +import org.apache.calcite.plan.RelOptTable.ToRelContext +import org.apache.calcite.prepare.Prepare.PreparingTable +import org.apache.calcite.rel.`type`.{RelDataTypeField, RelDataTypeFactory} +import org.apache.calcite.rel._ +import org.apache.calcite.rel.logical.LogicalTableScan +import org.apache.calcite.runtime.Hook +import org.apache.calcite.schema.{StreamableTable, TranslatableTable} +import org.apache.calcite.sql.SqlAccessType +import org.apache.calcite.sql.validate.{SqlModality, SqlMonotonicity} +import org.apache.calcite.sql2rel.InitializerContext +import org.apache.calcite.util.ImmutableBitSet +import org.apache.flink.table.plan.stats.FlinkStatistic + +import scala.collection.JavaConverters._ + +/** + * FlinkRelOptTable wraps a FlinkTable + * + * @param schema the [[RelOptSchema]] this table belongs to + * @param rowType the type of rows returned by this table + * @param names the identifier for this table. The identifier must be unique with + * respect to the Connection producing this table. + * @param table wrapped flink table + */ + +class FlinkRelOptTable protected( + schema: RelOptSchema, + rowType: RelDataType, + names: JList[String], + table: FlinkTable[_]) extends PreparingTable { --- End diff -- done
---