You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by ku...@apache.org on 2019/06/20 10:56:10 UTC

[flink] branch master updated (d8aac6f -> 4a727c0)

This is an automated email from the ASF dual-hosted git repository.

kurt pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git.


    from d8aac6f  [FLINK-11759] Update AbstractNonKeyedOperatorRestoreTestBase for 1.8
     new 9a292e22 [FLINK-12815] [table-planner-blink] Do not register the intermediate optimization result as a table in batch and stream CommonSubGraphBasedOptimizer
     new e73e1d7  [FLINK-12815] [table-planner-blink] TableImpl supports QueryOperation in blink planner
     new 4a727c0  [FLINK-12815] [table-planner-blink] Support CatalogManager in blink planner

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../apache/calcite/jdbc/CalciteSchemaBuilder.java  |    0
 .../table/calcite/FlinkCalciteCatalogReader.java   |   32 +-
 .../flink/table/catalog/CatalogCalciteSchema.java  |   31 +-
 .../table/catalog/CatalogManagerCalciteSchema.java |   61 +-
 .../flink/table/catalog/DatabaseCalciteSchema.java |   88 +-
 .../apache/flink/table/catalog/FlinkSchema.java    |   33 +-
 .../catalog/QueryOperationCatalogViewTable.java    |   45 +-
 .../table/operations/DataStreamQueryOperation.java |   55 +-
 .../table/operations/PlannerQueryOperation.java    |   22 +-
 .../operations/RichTableSourceQueryOperation.java} |   52 +-
 .../flink/table/plan/QueryOperationConverter.java  |  200 +++
 .../apache/flink/table/planner/PlannerContext.java |   30 +-
 .../flink/table/api/BatchTableEnvironment.scala    |  109 +-
 .../flink/table/api/StreamTableEnvironment.scala   |  201 +--
 .../org/apache/flink/table/api/TableConfig.scala   |   44 +
 .../apache/flink/table/api/TableEnvironment.scala  |  437 +++---
 .../org/apache/flink/table/api/TableImpl.scala     |   27 +-
 .../table/api/java/BatchTableEnvironment.scala     |   37 +-
 .../table/api/java/StreamTableEnvironment.scala    |   58 +-
 .../table/api/scala/BatchTableEnvironment.scala    |   36 +-
 .../table/api/scala/StreamTableEnvironment.scala   |   61 +-
 .../flink/table/calcite/FlinkRelBuilder.scala      |   18 +
 .../BatchCommonSubGraphBasedOptimizer.scala        |   15 +-
 .../optimize/CommonSubGraphBasedOptimizer.scala    |   29 +-
 .../flink/table/plan/optimize/RelNodeBlock.scala   |   24 +-
 .../StreamCommonSubGraphBasedOptimizer.scala       |   34 +-
 .../plan/optimize/program/FlinkBatchProgram.scala  |    2 +-
 .../plan/optimize/program/FlinkStreamProgram.scala |    2 +-
 .../flink/table/plan/schema/FlinkRelOptTable.scala |    7 +
 .../table/plan/schema/IntermediateRelTable.scala   |    4 -
 .../apache/flink/table/plan/schema/RelTable.scala  |   46 -
 .../flink/table/plan/schema/TableSourceTable.scala |    2 +-
 .../flink/table/plan/stats/FlinkStatistic.scala    |   21 +
 .../apache/flink/table/plan/util/RelShuttles.scala |   80 +-
 .../flink/table/util/JavaScalaConversionUtil.scala |    4 +
 .../digest/testGetDigestWithDynamicFunction.out    |    6 +-
 .../testGetDigestWithDynamicFunctionView.out       |    6 +-
 .../apache/flink/table/api/batch/ExplainTest.xml   |  132 +-
 .../flink/table/api/batch/TableStatsTest.xml       |   28 +-
 .../apache/flink/table/api/stream/ExplainTest.xml  |  132 +-
 .../flink/table/catalog/PathResolutionTest.xml     |  195 +++
 .../apache/flink/table/plan/batch/sql/CalcTest.xml |   76 +-
 .../table/plan/batch/sql/DagOptimizationTest.xml   |  242 ++--
 .../table/plan/batch/sql/DeadlockBreakupTest.xml   |   54 +-
 .../flink/table/plan/batch/sql/LimitTest.xml       |   32 +-
 .../apache/flink/table/plan/batch/sql/RankTest.xml |   28 +-
 .../table/plan/batch/sql/RemoveCollationTest.xml   |  160 +--
 .../table/plan/batch/sql/RemoveShuffleTest.xml     |  312 ++---
 .../table/plan/batch/sql/SetOperatorsTest.xml      |   52 +-
 .../apache/flink/table/plan/batch/sql/SinkTest.xml |   10 +-
 .../flink/table/plan/batch/sql/SortLimitTest.xml   |   32 +-
 .../apache/flink/table/plan/batch/sql/SortTest.xml |   20 +-
 .../table/plan/batch/sql/SubplanReuseTest.xml      |  250 ++--
 .../flink/table/plan/batch/sql/TableScanTest.xml   |    4 +-
 .../flink/table/plan/batch/sql/TableSourceTest.xml |   12 +-
 .../flink/table/plan/batch/sql/UnionTest.xml       |   20 +-
 .../flink/table/plan/batch/sql/UnnestTest.xml      |   40 +-
 .../batch/sql/agg/AggregateReduceGroupingTest.xml  |  212 +--
 .../plan/batch/sql/agg/DistinctAggregateTest.xml   |   40 +-
 .../table/plan/batch/sql/agg/GroupingSetsTest.xml  |  144 +-
 .../table/plan/batch/sql/agg/HashAggregateTest.xml |  156 +--
 .../table/plan/batch/sql/agg/OverAggregateTest.xml |   92 +-
 .../table/plan/batch/sql/agg/SortAggregateTest.xml |  192 +--
 .../plan/batch/sql/agg/WindowAggregateTest.xml     |  228 +--
 .../plan/batch/sql/join/BroadcastHashJoinTest.xml  |  110 +-
 .../sql/join/BroadcastHashSemiAntiJoinTest.xml     |  598 ++++----
 .../table/plan/batch/sql/join/LookupJoinTest.xml   |   59 +-
 .../plan/batch/sql/join/NestedLoopJoinTest.xml     |  226 +--
 .../batch/sql/join/NestedLoopSemiAntiJoinTest.xml  |  800 +++++------
 .../table/plan/batch/sql/join/SemiAntiJoinTest.xml |  800 +++++------
 .../plan/batch/sql/join/ShuffledHashJoinTest.xml   |  136 +-
 .../sql/join/ShuffledHashSemiAntiJoinTest.xml      |  598 ++++----
 .../plan/batch/sql/join/SingleRowJoinTest.xml      |   58 +-
 .../plan/batch/sql/join/SortMergeJoinTest.xml      |  142 +-
 .../batch/sql/join/SortMergeSemiAntiJoinTest.xml   |  622 ++++----
 .../plan/nodes/resource/ExecNodeResourceTest.xml   |   56 +-
 .../logical/AggregateReduceGroupingRuleTest.xml    |  212 +--
 .../logical/CalcPruneAggregateCallRuleTest.xml     |   72 +-
 .../rules/logical/CalcRankTransposeRuleTest.xml    |   36 +-
 .../rules/logical/ConvertToNotInOrInRuleTest.xml   |   88 +-
 .../logical/DecomposeGroupingSetsRuleTest.xml      |   28 +-
 ...nkAggregateExpandDistinctAggregatesRuleTest.xml |   84 +-
 .../FlinkAggregateInnerJoinTransposeRuleTest.xml   |   68 +-
 .../FlinkAggregateOuterJoinTransposeRuleTest.xml   |   72 +-
 .../rules/logical/FlinkAggregateRemoveRuleTest.xml |   96 +-
 .../plan/rules/logical/FlinkCalcMergeRuleTest.xml  |   12 +-
 .../plan/rules/logical/FlinkFilterJoinRuleTest.xml |  112 +-
 .../logical/FlinkJoinPushExpressionsRuleTest.xml   |   32 +-
 .../rules/logical/FlinkLimit0RemoveRuleTest.xml    |   38 +-
 .../FlinkLogicalRankRuleForConstantRangeTest.xml   |   60 +-
 .../FlinkLogicalRankRuleForRangeEndTest.xml        |   52 +-
 .../rules/logical/FlinkPruneEmptyRulesTest.xml     |   10 +-
 .../FlinkSemiAntiJoinFilterTransposeRuleTest.xml   |   16 +-
 .../FlinkSemiAntiJoinJoinTransposeRuleTest.xml     |  432 +++---
 .../FlinkSemiAntiJoinProjectTransposeRuleTest.xml  |   24 +-
 .../JoinConditionEqualityTransferRuleTest.xml      |  112 +-
 .../logical/JoinConditionTypeCoerceRuleTest.xml    |   74 +-
 .../JoinDependentConditionDerivationRuleTest.xml   |   68 +-
 .../rules/logical/JoinDeriveNullFilterRuleTest.xml |   72 +-
 .../plan/rules/logical/LogicalUnnestRuleTest.xml   |   40 +-
 .../logical/ProjectPruneAggregateCallRuleTest.xml  |   72 +-
 .../ProjectSemiAntiJoinTransposeRuleTest.xml       |  148 +-
 .../PushProjectIntoTableSourceScanRuleTest.xml     |   20 +-
 .../logical/RankNumberColumnRemoveRuleTest.xml     |   16 +-
 .../ReplaceIntersectWithSemiJoinRuleTest.xml       |   32 +-
 .../logical/ReplaceMinusWithAntiJoinRuleTest.xml   |   32 +-
 .../plan/rules/logical/RewriteCoalesceRuleTest.xml |   40 +-
 .../logical/SimplifyFilterConditionRuleTest.xml    |   68 +-
 .../logical/SimplifyJoinConditionRuleTest.xml      |   18 +-
 .../plan/rules/logical/SplitAggregateRuleTest.xml  |   76 +-
 .../rules/logical/WindowGroupReorderRuleTest.xml   |   40 +-
 .../subquery/FlinkRewriteSubQueryRuleTest.xml      |  152 +-
 .../logical/subquery/SubQueryAntiJoinTest.xml      |  756 +++++-----
 .../logical/subquery/SubQuerySemiJoinTest.xml      | 1480 ++++++++++----------
 .../batch/RemoveRedundantLocalHashAggRuleTest.xml  |   12 +-
 .../batch/RemoveRedundantLocalRankRuleTest.xml     |   12 +-
 .../batch/RemoveRedundantLocalSortAggRuleTest.xml  |   16 +-
 .../rules/physical/stream/RetractionRulesTest.xml  |   20 +-
 .../stream/RetractionRulesWithTwoStageAggTest.xml  |   16 +-
 .../flink/table/plan/stream/sql/CalcTest.xml       |   76 +-
 .../table/plan/stream/sql/DagOptimizationTest.xml  |  270 ++--
 .../flink/table/plan/stream/sql/LimitTest.xml      |  112 +-
 .../plan/stream/sql/ModifiedMonotonicityTest.xml   |   24 +-
 .../flink/table/plan/stream/sql/RankTest.xml       |  104 +-
 .../stream/sql/RelTimeIndicatorConverterTest.xml   |   58 +-
 .../table/plan/stream/sql/SetOperatorsTest.xml     |   52 +-
 .../flink/table/plan/stream/sql/SinkTest.xml       |   58 +-
 .../flink/table/plan/stream/sql/SortLimitTest.xml  |  204 +--
 .../flink/table/plan/stream/sql/SortTest.xml       |   36 +-
 .../table/plan/stream/sql/SubplanReuseTest.xml     |  156 +--
 .../flink/table/plan/stream/sql/TableScanTest.xml  |    8 +-
 .../table/plan/stream/sql/TableSourceTest.xml      |   36 +-
 .../flink/table/plan/stream/sql/UnionTest.xml      |   20 +-
 .../flink/table/plan/stream/sql/UnnestTest.xml     |   40 +-
 .../table/plan/stream/sql/agg/AggregateTest.xml    |   68 +-
 .../plan/stream/sql/agg/DistinctAggregateTest.xml  |  272 ++--
 .../table/plan/stream/sql/agg/GroupingSetsTest.xml |  144 +-
 .../stream/sql/agg/IncrementalAggregateTest.xml    |   68 +-
 .../plan/stream/sql/agg/OverAggregateTest.xml      |   72 +-
 .../plan/stream/sql/agg/TwoStageAggregateTest.xml  |   28 +-
 .../plan/stream/sql/agg/WindowAggregateTest.xml    |   56 +-
 .../flink/table/plan/stream/sql/join/JoinTest.xml  |  278 ++--
 .../table/plan/stream/sql/join/LookupJoinTest.xml  |   48 +-
 .../plan/stream/sql/join/SemiAntiJoinTest.xml      |  792 +++++------
 .../table/plan/stream/sql/join/WindowJoinTest.xml  |  124 +-
 .../flink/table/api/TableEnvironmentTest.scala     |   18 +-
 .../flink/table/codegen/agg/AggTestBase.scala      |    2 +-
 .../plan/metadata/FlinkRelMdHandlerTestBase.scala  |    3 +-
 .../plan/nodes/resource/ExecNodeResourceTest.scala |   12 +-
 .../plan/stream/sql/join/LookupJoinTest.scala      |   11 +-
 .../table/plan/util/FlinkRelOptUtilTest.scala      |    4 +-
 .../batch/sql/agg/AggregateRemoveITCase.scala      |    2 +-
 .../table/runtime/utils/BatchTableEnvUtil.scala    |   17 +-
 .../table/runtime/utils/StreamTableEnvUtil.scala   |   13 +-
 .../apache/flink/table/util/TableTestBase.scala    |  130 +-
 155 files changed, 9080 insertions(+), 8331 deletions(-)
 copy flink-table/{flink-table-planner => flink-table-planner-blink}/src/main/java/org/apache/calcite/jdbc/CalciteSchemaBuilder.java (100%)
 copy flink-table/{flink-table-planner => flink-table-planner-blink}/src/main/java/org/apache/flink/table/catalog/CatalogCalciteSchema.java (79%)
 copy flink-table/{flink-table-planner => flink-table-planner-blink}/src/main/java/org/apache/flink/table/catalog/CatalogManagerCalciteSchema.java (61%)
 copy flink-table/{flink-table-planner => flink-table-planner-blink}/src/main/java/org/apache/flink/table/catalog/DatabaseCalciteSchema.java (59%)
 copy flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/EmptyMessageParameters.java => flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/catalog/FlinkSchema.java (55%)
 copy flink-table/{flink-table-planner => flink-table-planner-blink}/src/main/java/org/apache/flink/table/catalog/QueryOperationCatalogViewTable.java (64%)
 copy flink-table/{flink-table-api-java-bridge => flink-table-planner-blink}/src/main/java/org/apache/flink/table/operations/DataStreamQueryOperation.java (61%)
 copy flink-table/{flink-table-planner/src/main/scala => flink-table-planner-blink/src/main/java}/org/apache/flink/table/operations/PlannerQueryOperation.java (79%)
 copy flink-table/{flink-table-api-java/src/main/java/org/apache/flink/table/operations/TableSourceQueryOperation.java => flink-table-planner-blink/src/main/java/org/apache/flink/table/operations/RichTableSourceQueryOperation.java} (54%)
 create mode 100644 flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/plan/QueryOperationConverter.java
 delete mode 100644 flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/schema/RelTable.scala
 create mode 100644 flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/catalog/PathResolutionTest.xml


[flink] 02/03: [FLINK-12815] [table-planner-blink] TableImpl supports QueryOperation in blink planner

Posted by ku...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kurt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git

commit e73e1d7dcc13c5bcc56b0290870b5c018470f981
Author: godfreyhe <go...@163.com>
AuthorDate: Wed Jun 12 16:33:59 2019 +0800

    [FLINK-12815] [table-planner-blink] TableImpl supports QueryOperation in blink planner
---
 .../table/operations/DataStreamQueryOperation.java | 138 +++++++++++++++
 .../table/operations/PlannerQueryOperation.java    |  84 +++++++++
 .../flink/table/plan/QueryOperationConverter.java  | 164 +++++++++++++++++
 .../flink/table/api/BatchTableEnvironment.scala    | 101 +++++------
 .../flink/table/api/StreamTableEnvironment.scala   | 195 +++++++--------------
 .../apache/flink/table/api/TableEnvironment.scala  | 126 ++++++++++++-
 .../org/apache/flink/table/api/TableImpl.scala     |  27 +--
 .../table/api/java/StreamTableEnvironment.scala    |  19 +-
 .../table/api/scala/StreamTableEnvironment.scala   |  21 +--
 .../flink/table/calcite/FlinkRelBuilder.scala      |  10 ++
 .../flink/table/plan/optimize/RelNodeBlock.scala   |  20 +--
 .../apache/flink/table/plan/schema/RelTable.scala  |   9 +-
 .../flink/table/plan/schema/TableSourceTable.scala |   2 +-
 .../apache/flink/table/api/stream/ExplainTest.xml  |  88 +++++-----
 .../table/plan/batch/sql/DagOptimizationTest.xml   |  54 +++++-
 .../table/plan/batch/sql/join/LookupJoinTest.xml   |  15 +-
 .../rules/logical/CalcRankTransposeRuleTest.xml    |  12 +-
 .../logical/RankNumberColumnRemoveRuleTest.xml     |   8 +-
 .../table/plan/stream/sql/DagOptimizationTest.xml  |  56 +++++-
 .../flink/table/plan/stream/sql/LimitTest.xml      |  44 ++---
 .../plan/stream/sql/ModifiedMonotonicityTest.xml   |  12 +-
 .../flink/table/plan/stream/sql/RankTest.xml       |  48 ++---
 .../stream/sql/RelTimeIndicatorConverterTest.xml   |  28 +--
 .../flink/table/plan/stream/sql/SinkTest.xml       |  44 ++---
 .../flink/table/plan/stream/sql/SortLimitTest.xml  |  86 ++++-----
 .../flink/table/plan/stream/sql/SortTest.xml       |  18 +-
 .../flink/table/plan/stream/sql/TableScanTest.xml  |   2 +-
 .../flink/table/plan/stream/sql/UnnestTest.xml     |   6 +-
 .../plan/stream/sql/agg/OverAggregateTest.xml      |  36 ++--
 .../plan/stream/sql/agg/WindowAggregateTest.xml    |  26 +--
 .../table/plan/stream/sql/join/LookupJoinTest.xml  |  16 +-
 .../table/plan/stream/sql/join/WindowJoinTest.xml  |  60 +++----
 .../plan/stream/sql/join/LookupJoinTest.scala      |  11 +-
 .../batch/sql/agg/AggregateRemoveITCase.scala      |   2 +-
 .../table/runtime/utils/BatchTableEnvUtil.scala    |  17 +-
 .../table/runtime/utils/StreamTableEnvUtil.scala   |  13 +-
 .../apache/flink/table/util/TableTestBase.scala    |  40 ++---
 37 files changed, 1066 insertions(+), 592 deletions(-)

diff --git a/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/operations/DataStreamQueryOperation.java b/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/operations/DataStreamQueryOperation.java
new file mode 100644
index 0000000..7b1d7d2
--- /dev/null
+++ b/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/operations/DataStreamQueryOperation.java
@@ -0,0 +1,138 @@
+/*
+ * 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.operations;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.streaming.api.datastream.DataStream;
+import org.apache.flink.table.api.TableSchema;
+import org.apache.flink.table.plan.stats.FlinkStatistic;
+
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Describes a relational operation that reads from a {@link DataStream}.
+ *
+ * <p>This operation may expose only part, or change the order of the fields available in a
+ * {@link org.apache.flink.api.common.typeutils.CompositeType} of the underlying {@link DataStream}.
+ * The {@link DataStreamQueryOperation#getFieldIndices()} describes the mapping between fields of the
+ * {@link TableSchema} to the {@link org.apache.flink.api.common.typeutils.CompositeType}.
+ */
+@Internal
+public class DataStreamQueryOperation<E> implements QueryOperation {
+
+	// DataStreamQueryOperation represent a registered DataStream from `registerDataStream` method
+	// or a unregistered DataStream from `fromDataStream`. However the name under which the DataStream is registered
+	// is missing when converting a DataStreamQueryOperation to a RelNode.
+	// so using `qualifiedName` to keep the original name.
+	// TODO This is a temporary solution.
+	private List<String> qualifiedName;
+	private final DataStream<E> dataStream;
+	private final int[] fieldIndices;
+	private final TableSchema tableSchema;
+	// TODO remove this while TableSchema supports fieldNullables
+	private final boolean[] fieldNullables;
+	private final boolean producesUpdates;
+	private final boolean isAccRetract;
+	private final FlinkStatistic statistic;
+
+	public DataStreamQueryOperation(
+			DataStream<E> dataStream,
+			int[] fieldIndices,
+			TableSchema tableSchema,
+			boolean[] fieldNullables,
+			boolean producesUpdates,
+			boolean isAccRetract,
+			FlinkStatistic statistic) {
+		this.dataStream = dataStream;
+		this.tableSchema = tableSchema;
+		this.fieldNullables = fieldNullables;
+		this.fieldIndices = fieldIndices;
+		this.producesUpdates = producesUpdates;
+		this.isAccRetract = isAccRetract;
+		this.statistic = statistic;
+	}
+
+	public DataStreamQueryOperation(
+			DataStream<E> dataStream,
+			int[] fieldIndices,
+			TableSchema tableSchema,
+			boolean[] fieldNullables,
+			FlinkStatistic statistic) {
+		this(dataStream, fieldIndices, tableSchema, fieldNullables, false, false, statistic);
+	}
+
+	public DataStream<E> getDataStream() {
+		return dataStream;
+	}
+
+	public int[] getFieldIndices() {
+		return fieldIndices;
+	}
+
+	@Override
+	public TableSchema getTableSchema() {
+		return tableSchema;
+	}
+
+	@Override
+	public String asSummaryString() {
+		Map<String, Object> args = new LinkedHashMap<>();
+		args.put("id", dataStream.getId());
+		args.put("fields", tableSchema.getFieldNames());
+
+		return OperationUtils.formatWithChildren("DataStream", args, getChildren(), Operation::asSummaryString);
+	}
+
+	@Override
+	public List<QueryOperation> getChildren() {
+		return Collections.emptyList();
+	}
+
+	@Override
+	public <T> T accept(QueryOperationVisitor<T> visitor) {
+		return visitor.visit(this);
+	}
+
+	public List<String> getQualifiedName() {
+		return qualifiedName;
+	}
+
+	public void setQualifiedName(List<String> qualifiedName) {
+		this.qualifiedName = qualifiedName;
+	}
+
+	public boolean[] getFieldNullables() {
+		return fieldNullables;
+	}
+
+	public boolean isProducesUpdates() {
+		return producesUpdates;
+	}
+
+	public boolean isAccRetract() {
+		return isAccRetract;
+	}
+
+	public FlinkStatistic getStatistic() {
+		return statistic;
+	}
+}
diff --git a/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/operations/PlannerQueryOperation.java b/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/operations/PlannerQueryOperation.java
new file mode 100644
index 0000000..ee65ed6
--- /dev/null
+++ b/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/operations/PlannerQueryOperation.java
@@ -0,0 +1,84 @@
+/*
+ * 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.operations;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.api.TableSchema;
+import org.apache.flink.table.calcite.FlinkTypeFactory;
+import org.apache.flink.table.types.DataType;
+import org.apache.flink.table.types.LogicalTypeDataTypeConverter;
+
+import org.apache.calcite.rel.RelNode;
+import org.apache.calcite.rel.type.RelDataType;
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * Wrapper for valid logical plans generated by Planner.
+ */
+@Internal
+public class PlannerQueryOperation implements QueryOperation {
+
+	private final RelNode calciteTree;
+	private final TableSchema tableSchema;
+
+	public PlannerQueryOperation(RelNode calciteTree) {
+		this.calciteTree = calciteTree;
+
+		RelDataType rowType = calciteTree.getRowType();
+		String[] fieldNames = rowType.getFieldNames().toArray(new String[0]);
+		DataType[] fieldTypes = rowType.getFieldList()
+				.stream()
+				.map(field ->
+						LogicalTypeDataTypeConverter.fromLogicalTypeToDataType(
+								FlinkTypeFactory.toLogicalType(field.getType())))
+				.toArray(DataType[]::new);
+
+		this.tableSchema = TableSchema.builder().fields(fieldNames, fieldTypes).build();
+	}
+
+	public RelNode getCalciteTree() {
+		return calciteTree;
+	}
+
+	@Override
+	public TableSchema getTableSchema() {
+		return tableSchema;
+	}
+
+	@Override
+	public String asSummaryString() {
+		return OperationUtils.formatWithChildren(
+				"PlannerNode",
+				Collections.emptyMap(),
+				getChildren(),
+				Operation::asSummaryString);
+	}
+
+	@Override
+	public List<QueryOperation> getChildren() {
+		return Collections.emptyList();
+	}
+
+	@Override
+	public <T> T accept(QueryOperationVisitor<T> visitor) {
+		return visitor.visit(this);
+	}
+}
diff --git a/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/plan/QueryOperationConverter.java b/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/plan/QueryOperationConverter.java
new file mode 100644
index 0000000..d7277f7
--- /dev/null
+++ b/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/plan/QueryOperationConverter.java
@@ -0,0 +1,164 @@
+/*
+ * 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;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.api.TableException;
+import org.apache.flink.table.calcite.FlinkRelBuilder;
+import org.apache.flink.table.operations.AggregateQueryOperation;
+import org.apache.flink.table.operations.CalculatedQueryOperation;
+import org.apache.flink.table.operations.CatalogQueryOperation;
+import org.apache.flink.table.operations.DataStreamQueryOperation;
+import org.apache.flink.table.operations.DistinctQueryOperation;
+import org.apache.flink.table.operations.FilterQueryOperation;
+import org.apache.flink.table.operations.JoinQueryOperation;
+import org.apache.flink.table.operations.PlannerQueryOperation;
+import org.apache.flink.table.operations.ProjectQueryOperation;
+import org.apache.flink.table.operations.QueryOperation;
+import org.apache.flink.table.operations.QueryOperationDefaultVisitor;
+import org.apache.flink.table.operations.QueryOperationVisitor;
+import org.apache.flink.table.operations.SetQueryOperation;
+import org.apache.flink.table.operations.SortQueryOperation;
+import org.apache.flink.table.operations.TableSourceQueryOperation;
+import org.apache.flink.table.operations.WindowAggregateQueryOperation;
+import org.apache.flink.table.plan.schema.DataStreamTable;
+import org.apache.flink.table.plan.schema.FlinkRelOptTable;
+
+import org.apache.calcite.rel.RelNode;
+import org.apache.calcite.rel.logical.LogicalTableScan;
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * Converter from Flink's specific relational representation: {@link QueryOperation} to Calcite's specific relational
+ * representation: {@link RelNode}.
+ */
+@Internal
+public class QueryOperationConverter extends QueryOperationDefaultVisitor<RelNode> {
+
+	private final FlinkRelBuilder relBuilder;
+	private final SingleRelVisitor singleRelVisitor = new SingleRelVisitor();
+
+	public QueryOperationConverter(FlinkRelBuilder relBuilder) {
+		this.relBuilder = relBuilder;
+	}
+
+	@Override
+	public RelNode defaultMethod(QueryOperation other) {
+		other.getChildren().forEach(child -> relBuilder.push(child.accept(this)));
+		return other.accept(singleRelVisitor);
+	}
+
+	private class SingleRelVisitor implements QueryOperationVisitor<RelNode> {
+
+		@Override
+		public RelNode visit(ProjectQueryOperation projection) {
+			throw new UnsupportedOperationException("Unsupported now");
+		}
+
+		@Override
+		public RelNode visit(AggregateQueryOperation aggregate) {
+			throw new UnsupportedOperationException("Unsupported now");
+		}
+
+		@Override
+		public RelNode visit(WindowAggregateQueryOperation windowAggregate) {
+			throw new UnsupportedOperationException("Unsupported now");
+		}
+
+		@Override
+		public RelNode visit(JoinQueryOperation join) {
+			throw new UnsupportedOperationException("Unsupported now");
+		}
+
+		@Override
+		public RelNode visit(SetQueryOperation setOperation) {
+			throw new UnsupportedOperationException("Unsupported now");
+		}
+
+		@Override
+		public RelNode visit(FilterQueryOperation filter) {
+			throw new UnsupportedOperationException("Unsupported now");
+		}
+
+		@Override
+		public RelNode visit(DistinctQueryOperation distinct) {
+			throw new UnsupportedOperationException("Unsupported now");
+		}
+
+		@Override
+		public RelNode visit(SortQueryOperation sort) {
+			throw new UnsupportedOperationException("Unsupported now");
+		}
+
+		@Override
+		public <U> RelNode visit(CalculatedQueryOperation<U> calculatedTable) {
+			throw new UnsupportedOperationException("Unsupported now");
+		}
+
+		@Override
+		public RelNode visit(CatalogQueryOperation catalogTable) {
+			return relBuilder.scan(catalogTable.getTablePath()).build();
+		}
+
+		@Override
+		public RelNode visit(QueryOperation other) {
+			if (other instanceof PlannerQueryOperation) {
+				return ((PlannerQueryOperation) other).getCalciteTree();
+			} else if (other instanceof DataStreamQueryOperation) {
+				return convertToDataStreamScan((DataStreamQueryOperation<?>) other);
+			}
+
+			throw new TableException("Unknown table operation: " + other);
+		}
+
+		@Override
+		public <U> RelNode visit(TableSourceQueryOperation<U> tableSourceTable) {
+			throw new UnsupportedOperationException("Unsupported now");
+		}
+
+		private RelNode convertToDataStreamScan(DataStreamQueryOperation<?> operation) {
+			DataStreamTable<?> dataStreamTable = new DataStreamTable<>(
+					operation.getDataStream(),
+					operation.isProducesUpdates(),
+					operation.isAccRetract(),
+					operation.getFieldIndices(),
+					operation.getTableSchema().getFieldNames(),
+					operation.getStatistic(),
+					scala.Option.apply(operation.getFieldNullables()));
+
+			List<String> names;
+			if (operation.getQualifiedName() != null) {
+				names = operation.getQualifiedName();
+			} else {
+				names = Collections.singletonList(String.format("DataStream_%s", operation.getDataStream().getId()));
+			}
+
+			FlinkRelOptTable table = FlinkRelOptTable.create(
+					null,
+					dataStreamTable.getRowType(relBuilder.getTypeFactory()),
+					names,
+					dataStreamTable);
+
+			return LogicalTableScan.create(relBuilder.getCluster(), table);
+		}
+	}
+
+}
diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/BatchTableEnvironment.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/BatchTableEnvironment.scala
index c3c36ef..8f354ed 100644
--- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/BatchTableEnvironment.scala
+++ b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/BatchTableEnvironment.scala
@@ -17,6 +17,7 @@
  */
 package org.apache.flink.table.api
 
+import org.apache.flink.annotation.VisibleForTesting
 import org.apache.flink.api.common.JobExecutionResult
 import org.apache.flink.configuration.Configuration
 import org.apache.flink.runtime.jobgraph.ScheduleMode
@@ -25,17 +26,18 @@ import org.apache.flink.streaming.api.datastream.DataStream
 import org.apache.flink.streaming.api.environment.{CheckpointConfig, StreamExecutionEnvironment}
 import org.apache.flink.streaming.api.graph.{StreamGraph, StreamGraphGenerator}
 import org.apache.flink.streaming.api.transformations.StreamTransformation
+import org.apache.flink.table.operations.DataStreamQueryOperation
 import org.apache.flink.table.plan.`trait`.FlinkRelDistributionTraitDef
 import org.apache.flink.table.plan.nodes.exec.{BatchExecNode, ExecNode}
 import org.apache.flink.table.plan.nodes.process.DAGProcessContext
 import org.apache.flink.table.plan.nodes.resource.parallelism.ParallelismProcessor
 import org.apache.flink.table.plan.optimize.{BatchCommonSubGraphBasedOptimizer, Optimizer}
 import org.apache.flink.table.plan.reuse.DeadlockBreakupProcessor
-import org.apache.flink.table.plan.schema.{TableSourceSinkTable, TableSourceTable}
 import org.apache.flink.table.plan.stats.FlinkStatistic
 import org.apache.flink.table.plan.util.{ExecNodePlanDumper, FlinkRelOptUtil}
 import org.apache.flink.table.sinks._
 import org.apache.flink.table.sources._
+import org.apache.flink.table.types.utils.TypeConversions.fromLegacyInfoToDataType
 import org.apache.flink.table.util.PlanUtil
 import org.apache.flink.util.InstantiationUtil
 import org.apache.calcite.plan.{ConventionTraitDef, RelTrait, RelTraitDef}
@@ -74,6 +76,8 @@ class BatchTableEnvironment(
 
   override protected def getOptimizer: Optimizer = new BatchCommonSubGraphBasedOptimizer(this)
 
+  override private[flink] def isBatch = true
+
   /**
     * Checks if the chosen table name is valid.
     *
@@ -89,6 +93,20 @@ class BatchTableEnvironment(
     }
   }
 
+  override protected def validateTableSource(tableSource: TableSource[_]): Unit = {
+    // TODO TableSourceUtil.validateTableSource(tableSource)
+    tableSource match {
+      // check for proper batch table source
+      case boundedTableSource: StreamTableSource[_] if boundedTableSource.isBounded => // ok
+      // a lookupable table source can also be registered in the env
+      case _: LookupableTableSource[_] => // ok
+      // not a batch table source
+      case _ =>
+        throw new TableException("Only LookupableTableSouce and BatchTableSource can be " +
+          "registered in BatchTableEnvironment.")
+    }
+  }
+
   override def execute(jobName: String): JobExecutionResult = {
     generateStreamGraph(jobName)
     // TODO supports streamEnv.execute(streamGraph)
@@ -248,63 +266,36 @@ class BatchTableEnvironment(
     sb.toString()
   }
 
-  /**
-    * Registers an internal bounded [[StreamTableSource]] in this [[TableEnvironment]]'s catalog
-    * without name checking. Registered tables can be referenced in SQL queries.
-    *
-    * @param name        The name under which the [[TableSource]] is registered.
-    * @param tableSource The [[TableSource]] to register.
-    * @param replace     Whether to replace the registered table.
-    */
-  override protected def registerTableSourceInternal(
-      name: String,
-      tableSource: TableSource[_],
-      statistic: FlinkStatistic,
-      replace: Boolean = false): Unit = {
-
-    def register(): Unit = {
-      // check if a table (source or sink) is registered
-      getTable(name) match {
-        // table source and/or sink is registered
-        case Some(table: TableSourceSinkTable[_, _]) => table.tableSourceTable match {
-
-          // wrapper contains source
-          case Some(_: TableSourceTable[_]) if !replace =>
-            throw new TableException(s"Table '$name' already exists. " +
-              s"Please choose a different name.")
-
-          // wrapper contains only sink (not source)
-          case _ =>
-            val enrichedTable = new TableSourceSinkTable(
-              Some(new TableSourceTable(tableSource, false, statistic)),
-              table.tableSinkTable)
-            replaceRegisteredTable(name, enrichedTable)
+  @VisibleForTesting
+  private[flink] def asQueryOperation[T](
+      boundedStream: DataStream[T],
+      fields: Option[Array[String]],
+      fieldNullables: Option[Array[Boolean]] = None,
+      statistic: Option[FlinkStatistic] = None): DataStreamQueryOperation[T] = {
+    val streamType = boundedStream.getType
+
+    // get field names and types for all non-replaced fields
+    val (indices, names) = fields match {
+      case Some(f) =>
+        fieldNullables match {
+          case Some(nulls) => require(nulls.length == f.length,
+            "length of `fields` and length of `fieldNullables` should be equal")
+          case _ => // do nothing
         }
-
-        // no table is registered
-        case _ =>
-          val newTable = new TableSourceSinkTable(
-            Some(new TableSourceTable(tableSource, false, statistic)),
-            None)
-          registerTableInternal(name, newTable)
-      }
+        val fieldIndexes = f.indices.toArray
+        (fieldIndexes, f)
+      case None =>
+        val (fieldNames, fieldIndexes) = getFieldInfo[T](fromLegacyInfoToDataType(streamType))
+        (fieldIndexes, fieldNames)
     }
 
-    tableSource match {
-
-      // check for proper batch table source
-      case boundedTableSource: StreamTableSource[_] if boundedTableSource.isBounded =>
-        register()
-
-      // a lookupable table source can also be registered in the env
-      case _: LookupableTableSource[_] =>
-        register()
-
-      // not a batch table source
-      case _ =>
-        throw new TableException("Only LookupableTableSouce and BatchTableSource can be " +
-          "registered in BatchTableEnvironment.")
-    }
+    val dataStreamTable = new DataStreamQueryOperation(
+      boundedStream,
+      indices,
+      TableEnvironment.calculateTableSchema(streamType, indices, names),
+      fieldNullables.getOrElse(Array.fill(indices.length)(true)),
+      statistic.getOrElse(FlinkStatistic.UNKNOWN))
+    dataStreamTable
   }
 
 }
diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/StreamTableEnvironment.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/StreamTableEnvironment.scala
index d5565fc..248114a 100644
--- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/StreamTableEnvironment.scala
+++ b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/StreamTableEnvironment.scala
@@ -18,6 +18,7 @@
 
 package org.apache.flink.table.api
 
+import org.apache.flink.annotation.VisibleForTesting
 import org.apache.flink.api.common.JobExecutionResult
 import org.apache.flink.api.common.typeinfo.TypeInformation
 import org.apache.flink.configuration.Configuration
@@ -29,23 +30,23 @@ import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment
 import org.apache.flink.streaming.api.graph.{StreamGraph, StreamGraphGenerator}
 import org.apache.flink.streaming.api.transformations.StreamTransformation
 import org.apache.flink.table.dataformat.BaseRow
+import org.apache.flink.table.operations.DataStreamQueryOperation
 import org.apache.flink.table.plan.`trait`.{AccModeTraitDef, FlinkRelDistributionTraitDef, MiniBatchIntervalTraitDef, UpdateAsRetractionTraitDef}
 import org.apache.flink.table.plan.nodes.calcite.LogicalSink
 import org.apache.flink.table.plan.nodes.exec.{ExecNode, StreamExecNode}
 import org.apache.flink.table.plan.nodes.process.DAGProcessContext
 import org.apache.flink.table.plan.nodes.resource.parallelism.ParallelismProcessor
 import org.apache.flink.table.plan.optimize.{Optimizer, StreamCommonSubGraphBasedOptimizer}
-import org.apache.flink.table.plan.reuse.DeadlockBreakupProcessor
-import org.apache.flink.table.plan.schema._
 import org.apache.flink.table.plan.stats.FlinkStatistic
 import org.apache.flink.table.plan.util.{ExecNodePlanDumper, FlinkRelOptUtil}
 import org.apache.flink.table.sinks.DataStreamTableSink
 import org.apache.flink.table.sources.{LookupableTableSource, StreamTableSource, TableSource}
-import org.apache.flink.table.types.{DataType, LogicalTypeDataTypeConverter}
 import org.apache.flink.table.types.logical.{LogicalType, RowType}
 import org.apache.flink.table.types.utils.TypeConversions.fromLegacyInfoToDataType
+import org.apache.flink.table.types.{DataType, LogicalTypeDataTypeConverter}
 import org.apache.flink.table.typeutils.{TimeIndicatorTypeInfo, TypeCheckUtils}
 import org.apache.flink.table.util.PlanUtil
+
 import org.apache.calcite.plan.{ConventionTraitDef, RelTrait, RelTraitDef}
 import org.apache.calcite.rel.RelNode
 import org.apache.calcite.sql.SqlExplainLevel
@@ -93,6 +94,8 @@ abstract class StreamTableEnvironment(
 
   override protected def getOptimizer: Optimizer = new StreamCommonSubGraphBasedOptimizer(this)
 
+  override private[flink] def isBatch = false
+
   /**
     * Checks if the chosen table name is valid.
     *
@@ -108,6 +111,29 @@ abstract class StreamTableEnvironment(
     }
   }
 
+  override protected def validateTableSource(tableSource: TableSource[_]): Unit = {
+    // TODO TableSourceUtil.validateTableSource(tableSource)
+    tableSource match {
+      // check for proper stream table source
+      case streamTableSource: StreamTableSource[_] if !streamTableSource.isBounded => // ok
+      // TODO `TableSourceUtil.hasRowtimeAttribute` depends on [Expression]
+      // check that event-time is enabled if table source includes rowtime attributes
+      // if (TableSourceUtil.hasRowtimeAttribute(streamTableSource) &&
+      //  execEnv.getStreamTimeCharacteristic != TimeCharacteristic.EventTime) {
+      //  throw new TableException(
+      //    s"A rowtime attribute requires an EventTime time characteristic in stream " +
+      //      s"environment. But is: ${execEnv.getStreamTimeCharacteristic}")
+      // }
+
+      // a lookupable table source can also be registered in the env
+      case _: LookupableTableSource[_] =>
+      // not a stream table source
+      case _ =>
+        throw new TableException("Only LookupableTableSource and unbounded StreamTableSource " +
+          "can be registered in StreamTableEnvironment")
+    }
+  }
+
   override def execute(jobName: String): JobExecutionResult = {
     generateStreamGraph(jobName)
     // TODO supports execEnv.execute(streamGraph)
@@ -310,67 +336,52 @@ abstract class StreamTableEnvironment(
     sb.toString()
   }
 
-  /**
-    * Registers a [[DataStream]] as a table under a given name in the [[TableEnvironment]]'s
-    * catalog.
-    *
-    * @param name The name under which the table is registered in the catalog.
-    * @param dataStream The [[DataStream]] to register as table in the catalog.
-    * @tparam T the type of the [[DataStream]].
-    */
-  protected def registerDataStreamInternal[T](
-    name: String,
-    dataStream: DataStream[T]): Unit = {
-
-    val (fieldNames, fieldIndexes) = getFieldInfo[T](fromLegacyInfoToDataType(dataStream.getType))
-    val dataStreamTable = new DataStreamTable[T](
-      dataStream,
-      fieldIndexes,
-      fieldNames
-    )
-    registerTableInternal(name, dataStreamTable)
-  }
-
-  /**
-    * Registers a [[DataStream]] as a table under a given name with field names as specified by
-    * field expressions in the [[TableEnvironment]]'s catalog.
-    *
-    * @param name The name under which the table is registered in the catalog.
-    * @param dataStream The [[DataStream]] to register as table in the catalog.
-    * @param fields The field expressions to define the field names of the table.
-    * @tparam T The type of the [[DataStream]].
-    */
-  protected def registerDataStreamInternal[T](
-      name: String,
+  @VisibleForTesting
+  private[flink] def asQueryOperation[T](
       dataStream: DataStream[T],
-      fields: Array[String]): Unit = {
+      fields: Option[Array[String]],
+      fieldNullables: Option[Array[Boolean]] = None,
+      statistic: Option[FlinkStatistic] = None): DataStreamQueryOperation[T] = {
+    val streamType = dataStream.getType
+    val streamDataType = fromLegacyInfoToDataType(streamType)
 
     // get field names and types for all non-replaced fields
-    val (fieldNames, fieldIndexes) = getFieldInfo(
-      fromLegacyInfoToDataType(dataStream.getType), fields)
+    val (indices, names) = fields match {
+      case Some(f) =>
+        // validate and extract time attributes
+        // TODO should use FieldInfoUtils#getFieldsInfo instead of getFieldInfo
+        // TODO: validate and extract time attributes after we introduce [Expression],
+        //  return None currently
+        val (rowtime, proctime) = validateAndExtractTimeAttributes(streamDataType, f)
+        val (fieldNames, fieldIndexes) = getFieldInfo(streamDataType, f)
+
+        // check if event-time is enabled
+        if (rowtime.isDefined &&
+          execEnv.getStreamTimeCharacteristic != TimeCharacteristic.EventTime) {
+          throw new TableException(
+            s"A rowtime attribute requires an EventTime time characteristic in stream environment" +
+              s". But is: ${execEnv.getStreamTimeCharacteristic}")
+        }
 
-    // TODO: validate and extract time attributes after we introduce [Expression],
-    //  return None currently
-    val (rowtime, proctime) = validateAndExtractTimeAttributes(
-      fromLegacyInfoToDataType(dataStream.getType), fields)
+        // adjust field indexes and field names
+        val indexesWithIndicatorFields = adjustFieldIndexes(fieldIndexes, rowtime, proctime)
+        val namesWithIndicatorFields = adjustFieldNames(fieldNames, rowtime, proctime)
 
-    // check if event-time is enabled
-    if (rowtime.isDefined && execEnv.getStreamTimeCharacteristic != TimeCharacteristic.EventTime) {
-      throw new TableException(
-        s"A rowtime attribute requires an EventTime time characteristic in stream environment. " +
-          s"But is: ${execEnv.getStreamTimeCharacteristic}")
+        (indexesWithIndicatorFields, namesWithIndicatorFields)
+      case None =>
+        val (fieldNames, fieldIndexes) = getFieldInfo[T](streamDataType)
+        (fieldIndexes, fieldNames)
     }
 
-    // adjust field indexes and field names
-    val indexesWithIndicatorFields = adjustFieldIndexes(fieldIndexes, rowtime, proctime)
-    val namesWithIndicatorFields = adjustFieldNames(fieldNames, rowtime, proctime)
-
-    val dataStreamTable = new DataStreamTable[T](
+    val dataStreamTable = new DataStreamQueryOperation(
       dataStream,
-      indexesWithIndicatorFields,
-      namesWithIndicatorFields
-    )
-    registerTableInternal(name, dataStreamTable)
+      indices,
+      TableEnvironment.calculateTableSchema(streamType, indices, names),
+      fieldNullables.getOrElse(Array.fill(indices.length)(true)),
+      false,
+      false,
+      statistic.getOrElse(FlinkStatistic.UNKNOWN))
+    dataStreamTable
   }
 
   /**
@@ -498,78 +509,6 @@ abstract class StreamTableEnvironment(
   }
 
   /**
-    * Registers an internal [[StreamTableSource]] in this [[TableEnvironment]]'s catalog without
-    * name checking. Registered tables can be referenced in SQL queries.
-    *
-    * @param name        The name under which the [[TableSource]] is registered.
-    * @param tableSource The [[TableSource]] to register.
-    */
-  override protected def registerTableSourceInternal(
-      name: String,
-      tableSource: TableSource[_],
-      statistic: FlinkStatistic,
-      replace: Boolean = false): Unit = {
-
-    // TODO `TableSourceUtil.hasRowtimeAttribute` depends on [Expression]
-    // check that event-time is enabled if table source includes rowtime attributes
-    //tableSource match {
-    //  case tableSource: TableSource[_] if TableSourceUtil.hasRowtimeAttribute(tableSource) &&
-    //    execEnv.getStreamTimeCharacteristic != TimeCharacteristic.EventTime =>
-    //
-    //    throw new TableException(
-    //      s"A rowtime attribute requires an EventTime time characteristic in stream environment
-    //      . " +
-    //        s"But is: ${execEnv.getStreamTimeCharacteristic}")
-    //  case _ => // ok
-    //}
-
-    def register(): Unit = {
-      // register
-      getTable(name) match {
-
-        // check if a table (source or sink) is registered
-        case Some(table: TableSourceSinkTable[_, _]) => table.tableSourceTable match {
-
-          // wrapper contains source
-          case Some(_: TableSourceTable[_]) if !replace =>
-            throw new TableException(s"Table '$name' already exists. " +
-              s"Please choose a different name.")
-
-          // wrapper contains only sink (not source)
-          case Some(_: TableSourceTable[_]) =>
-            val enrichedTable = new TableSourceSinkTable(
-              Some(new TableSourceTable(tableSource, true, statistic)),
-              table.tableSinkTable)
-            replaceRegisteredTable(name, enrichedTable)
-        }
-
-        // no table is registered
-        case _ =>
-          val newTable = new TableSourceSinkTable(
-            Some(new TableSourceTable(tableSource, true, statistic)),
-            None)
-          registerTableInternal(name, newTable)
-      }
-    }
-
-    tableSource match {
-
-      // check for proper stream table source
-      case streamTableSource: StreamTableSource[_] if !streamTableSource.isBounded =>
-        register()
-
-      // a lookupable table source can also be registered in the env
-      case _: LookupableTableSource[_] =>
-        register()
-
-      // not a stream table source
-      case _ =>
-        throw new TableException("Only LookupableTableSource and unbounded StreamTableSource " +
-          "can be registered in StreamTableEnvironment")
-    }
-  }
-
-  /**
     * Injects markers for time indicator fields into the field indexes.
     *
     * @param fieldIndexes The field indexes into which the time indicators markers are injected.
diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/TableEnvironment.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/TableEnvironment.scala
index b603381..63a9260 100644
--- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/TableEnvironment.scala
+++ b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/TableEnvironment.scala
@@ -21,6 +21,7 @@ package org.apache.flink.table.api
 import org.apache.flink.annotation.VisibleForTesting
 import org.apache.flink.api.common.JobExecutionResult
 import org.apache.flink.api.common.typeinfo.TypeInformation
+import org.apache.flink.api.common.typeutils.CompositeType
 import org.apache.flink.api.java.typeutils._
 import org.apache.flink.streaming.api.environment.{StreamExecutionEnvironment => JavaStreamExecEnv}
 import org.apache.flink.streaming.api.graph.StreamGraph
@@ -32,12 +33,13 @@ import org.apache.flink.table.calcite._
 import org.apache.flink.table.dataformat.BaseRow
 import org.apache.flink.table.functions.utils.UserDefinedFunctionUtils.{checkForInstantiation, checkNotSingleton, extractResultTypeFromTableFunction, getAccumulatorTypeOfAggregateFunction, getResultTypeOfAggregateFunction}
 import org.apache.flink.table.functions.{AggregateFunction, ScalarFunction, TableFunction}
+import org.apache.flink.table.operations.{DataStreamQueryOperation, PlannerQueryOperation}
 import org.apache.flink.table.plan.nodes.calcite.{LogicalSink, Sink}
 import org.apache.flink.table.plan.nodes.exec.ExecNode
 import org.apache.flink.table.plan.nodes.physical.FlinkPhysicalRel
 import org.apache.flink.table.plan.optimize.Optimizer
 import org.apache.flink.table.plan.reuse.SubplanReuser
-import org.apache.flink.table.plan.schema.RelTable
+import org.apache.flink.table.plan.schema.{RelTable, TableSourceSinkTable, TableSourceTable}
 import org.apache.flink.table.plan.stats.FlinkStatistic
 import org.apache.flink.table.plan.util.SameRelObjectShuttle
 import org.apache.flink.table.planner.PlannerContext
@@ -47,6 +49,7 @@ import org.apache.flink.table.types.LogicalTypeDataTypeConverter.fromDataTypeToL
 import org.apache.flink.table.types.logical.{LogicalType, RowType, TypeInformationAnyType}
 import org.apache.flink.table.types.utils.TypeConversions.fromLegacyInfoToDataType
 import org.apache.flink.table.types.{ClassLogicalTypeConverter, DataType}
+import org.apache.flink.table.typeutils.TimeIndicatorTypeInfo
 import org.apache.flink.table.validate.FunctionCatalog
 import org.apache.flink.types.Row
 
@@ -131,6 +134,11 @@ abstract class TableEnvironment(
   protected def getOptimizer: Optimizer
 
   /**
+    * Returns true if this is a batch TableEnvironment.
+    */
+  private[flink] def isBatch: Boolean
+
+  /**
     * Triggers the program execution.
     */
   def execute(): JobExecutionResult = execute(DEFAULT_JOB_NAME)
@@ -269,14 +277,18 @@ abstract class TableEnvironment(
     * @param table The table to register.
     */
   def registerTable(name: String, table: Table): Unit = {
-
     // check that table belongs to this table environment
     if (table.asInstanceOf[TableImpl].tableEnv != this) {
       throw new TableException(
         "Only tables that belong to this TableEnvironment can be registered.")
     }
 
-    checkValidTableName(name)
+    // TODO improve this
+    table.getQueryOperation match {
+      case dsq: DataStreamQueryOperation[_] => dsq.setQualifiedName(List(name))
+      case _ => // do nothing
+    }
+
     val tableTable = new RelTable(table.asInstanceOf[TableImpl].getRelNode)
     registerTableInternal(name, tableTable)
   }
@@ -337,7 +349,7 @@ abstract class TableEnvironment(
       val table = schema.getTable(tableName)
       if (table != null) {
         val scan = getRelBuilder.scan(JArrays.asList(tablePath: _*)).build()
-        return Some(new TableImpl(this, scan))
+        return Some(new TableImpl(this, new PlannerQueryOperation(scan)))
       }
     }
     None
@@ -433,7 +445,7 @@ abstract class TableEnvironment(
       val validated = planner.validate(parsed)
       // transform to a relational tree
       val relational = planner.rel(validated)
-      new TableImpl(this, relational.project())
+      new TableImpl(this, new PlannerQueryOperation(relational.project()))
     } else {
       throw new TableException(
         "Unsupported SQL query! sqlQuery() only accepts SQL queries of type " +
@@ -785,7 +797,40 @@ abstract class TableEnvironment(
       name: String,
       tableSource: TableSource[_],
       statistic: FlinkStatistic,
-      replace: Boolean): Unit
+      replace: Boolean): Unit = {
+    validateTableSource(tableSource)
+    // register
+    getTable(name) match {
+      // check if a table (source or sink) is registered
+      case Some(table: TableSourceSinkTable[_, _]) => table.tableSourceTable match {
+        // wrapper contains source
+        case Some(_: TableSourceTable[_]) if !replace =>
+          throw new TableException(s"Table '$name' already exists. " +
+            s"Please choose a different name.")
+        // wrapper contains only sink (not source)
+        case Some(_: TableSourceTable[_]) =>
+          val enrichedTable = new TableSourceSinkTable(
+            Some(new TableSourceTable(tableSource, !isBatch, statistic)),
+            table.tableSinkTable)
+          replaceRegisteredTable(name, enrichedTable)
+      }
+      // no table is registered
+      case _ =>
+        val newTable = new TableSourceSinkTable(
+          Some(new TableSourceTable(tableSource, !isBatch, statistic)),
+          None)
+        registerTableInternal(name, newTable)
+    }
+  }
+
+  /**
+    * Perform batch or streaming specific validations of the [[TableSource]].
+    * This method should throw [[ValidationException]] if the [[TableSource]] cannot be used
+    * in this [[TableEnvironment]].
+    *
+    * @param tableSource table source to validate
+    */
+  protected def validateTableSource(tableSource: TableSource[_]): Unit
 
 }
 
@@ -862,6 +907,75 @@ object TableEnvironment {
   }
 
   /**
+    * Derives [[TableSchema]] out of a [[TypeInformation]]. It is complementary to other
+    * methods in this class. This also performs translation from time indicator markers such as
+    * [[TimeIndicatorTypeInfo#ROWTIME_STREAM_MARKER]] etc. to a corresponding
+    * [[TimeIndicatorTypeInfo]].
+    *
+    * TODO remove this method and use FieldInfoUtils utility methods when [Expression] is ready
+    *
+    * @param typeInfo input type info to calculate fields type infos from
+    * @param fieldIndexes indices within the typeInfo of the resulting Table schema
+    * @param fieldNames names of the fields of the resulting schema
+    * @return calculates resulting schema
+    */
+  private[flink] def calculateTableSchema(
+      typeInfo: TypeInformation[_],
+      fieldIndexes: Array[Int],
+      fieldNames: Array[String]): TableSchema = {
+    if (fieldIndexes.length != fieldNames.length) {
+      throw new TableException(String.format(
+        "Number of field names and field indexes must be equal.\n" +
+          "Number of names is %s, number of indexes is %s.\n" +
+          "List of column names: %s.\n" +
+          "List of column indexes: %s.",
+        s"${fieldNames.length}",
+        s"${fieldIndexes.length}",
+        fieldNames.mkString(", "),
+        fieldIndexes.mkString(", ")))
+    }
+    // check uniqueness of field names
+    val duplicatedNames = fieldNames.diff(fieldNames.distinct).distinct
+    if (duplicatedNames.length != 0) {
+      throw new TableException(String.format(
+        "Field names must be unique.\n" +
+          "List of duplicate fields: [%s].\n" +
+          "List of all fields: [%s].",
+        duplicatedNames.mkString(", "), fieldNames.mkString(", ")))
+    }
+    val fieldIndicesCount = fieldIndexes.count(_ >= 0)
+    val types = typeInfo match {
+      case ct: CompositeType[_] =>
+        // it is ok to leave out fields
+        if (fieldIndicesCount > ct.getArity) {
+          throw new TableException(
+            String.format("Arity of type (%s) must not be greater than number of field names %s.",
+              ct.getFieldNames.mkString(", "), fieldNames.mkString(", ")))
+        }
+        fieldIndexes.map(idx => extractTimeMarkerType(idx).getOrElse(ct.getTypeAt(idx)))
+      case _ =>
+        if (fieldIndicesCount > 1) {
+          throw new TableException(
+            "Non-composite input type may have only a single field and its index must be 0.")
+        }
+        fieldIndexes.map(idx => extractTimeMarkerType(idx).getOrElse(typeInfo))
+    }
+    new TableSchema(fieldNames, types)
+  }
+
+  private def extractTimeMarkerType(idx: Int): Option[TypeInformation[_]] = idx match {
+    case TimeIndicatorTypeInfo.ROWTIME_STREAM_MARKER =>
+      Some(TimeIndicatorTypeInfo.ROWTIME_INDICATOR)
+    case TimeIndicatorTypeInfo.PROCTIME_STREAM_MARKER =>
+      Some(TimeIndicatorTypeInfo.PROCTIME_INDICATOR)
+    case TimeIndicatorTypeInfo.ROWTIME_BATCH_MARKER |
+         TimeIndicatorTypeInfo.PROCTIME_BATCH_MARKER =>
+      Some(Types.SQL_TIMESTAMP)
+    case _ =>
+      None
+  }
+
+  /**
     * Returns a [[BatchTableEnvironment]] for a Java [[JavaStreamExecEnv]].
     *
     * @param executionEnvironment The Java batch ExecutionEnvironment.
diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/TableImpl.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/TableImpl.scala
index 5505cc7..2e78d8a 100644
--- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/TableImpl.scala
+++ b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/TableImpl.scala
@@ -18,16 +18,12 @@
 
 package org.apache.flink.table.api
 
-import org.apache.flink.table.calcite.FlinkTypeFactory._
 import org.apache.flink.table.expressions.Expression
 import org.apache.flink.table.functions.TemporalTableFunction
 import org.apache.flink.table.operations.QueryOperation
-import org.apache.flink.table.types.LogicalTypeDataTypeConverter.fromLogicalTypeToDataType
 
 import org.apache.calcite.rel.RelNode
 
-import _root_.scala.collection.JavaConversions._
-
 /**
   * The implementation of the [[Table]].
   *
@@ -37,23 +33,20 @@ import _root_.scala.collection.JavaConversions._
   * implemented when we support full stack Table API for Blink planner.
   *
   * @param tableEnv The [[TableEnvironment]] to which the table is bound.
-  * @param relNode  The Calcite RelNode representation
+  * @param operationTree logical representation
   */
-class TableImpl(val tableEnv: TableEnvironment, relNode: RelNode) extends Table {
-
-  private lazy val tableSchema: TableSchema = {
-    val rowType = relNode.getRowType
-    val builder = TableSchema.builder()
-    rowType.getFieldList.foreach { field =>
-      builder.field(field.getName, fromLogicalTypeToDataType(toLogicalType(field.getType)))
-    }
-    builder.build()
-  }
+class TableImpl(val tableEnv: TableEnvironment, operationTree: QueryOperation) extends Table {
+
+  private lazy val tableSchema: TableSchema = operationTree.getTableSchema
 
   /**
     * Returns the Calcite RelNode represent this Table.
     */
-  def getRelNode: RelNode = relNode
+  def getRelNode: RelNode = {
+    tableEnv.getRelBuilder.queryOperation(operationTree).build()
+  }
+
+  override def getQueryOperation: QueryOperation = operationTree
 
   override def getSchema: TableSchema = tableSchema
 
@@ -208,8 +201,6 @@ class TableImpl(val tableEnv: TableEnvironment, relNode: RelNode) extends Table
 
   override def flatMap(tableFunction: Expression): Table = ???
 
-  override def getQueryOperation: QueryOperation = ???
-
   override def aggregate(aggregateFunction: String): AggregatedTable = ???
 
   override def aggregate(aggregateFunction: Expression): AggregatedTable = ???
diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/java/StreamTableEnvironment.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/java/StreamTableEnvironment.scala
index 8d276d5..c660ee3 100644
--- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/java/StreamTableEnvironment.scala
+++ b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/java/StreamTableEnvironment.scala
@@ -55,9 +55,7 @@ class StreamTableEnvironment @Deprecated() (
     * @return The converted [[Table]].
     */
   def fromDataStream[T](dataStream: DataStream[T]): Table = {
-    val name = createUniqueTableName()
-    registerDataStreamInternal(name, dataStream)
-    scan(name)
+    new TableImpl(this, asQueryOperation(dataStream, None))
   }
 
   /**
@@ -78,10 +76,7 @@ class StreamTableEnvironment @Deprecated() (
   def fromDataStream[T](dataStream: DataStream[T], fields: String): Table = {
     // TODO: use ExpressionParser instead after we introduce [Expression]
     val exprs = fields.split(",").map(_.trim)
-
-    val name = createUniqueTableName()
-    registerDataStreamInternal(name, dataStream, exprs)
-    scan(name)
+    new TableImpl(this, asQueryOperation(dataStream, Some(exprs)))
   }
 
   /**
@@ -97,9 +92,7 @@ class StreamTableEnvironment @Deprecated() (
     * @tparam T The type of the [[DataStream]] to register.
     */
   def registerDataStream[T](name: String, dataStream: DataStream[T]): Unit = {
-
-    checkValidTableName(name)
-    registerDataStreamInternal(name, dataStream)
+    registerTable(name, fromDataStream(dataStream))
   }
 
   /**
@@ -121,12 +114,8 @@ class StreamTableEnvironment @Deprecated() (
     */
   def registerDataStream[T](name: String, dataStream: DataStream[T], fields: String): Unit = {
     // TODO: use ExpressionParser instead after we introduce [Expression]
-    val exprs = fields.split(",").map(_.trim)
-
-    checkValidTableName(name)
-    registerDataStreamInternal(name, dataStream, exprs)
+    registerTable(name, fromDataStream(dataStream, fields))
   }
-
 }
 
 object StreamTableEnvironment {
diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/scala/StreamTableEnvironment.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/scala/StreamTableEnvironment.scala
index cb3dd5c..de16eed 100644
--- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/scala/StreamTableEnvironment.scala
+++ b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/scala/StreamTableEnvironment.scala
@@ -19,9 +19,8 @@ package org.apache.flink.table.api.scala
 
 import org.apache.flink.api.common.typeinfo.TypeInformation
 import org.apache.flink.api.scala._
-import org.apache.flink.streaming.api.scala.asScalaStream
-import org.apache.flink.streaming.api.scala.{DataStream, StreamExecutionEnvironment}
-import org.apache.flink.table.api.{Table, TableConfig, TableEnvironment}
+import org.apache.flink.streaming.api.scala.{DataStream, StreamExecutionEnvironment, asScalaStream}
+import org.apache.flink.table.api.{Table, TableConfig, TableEnvironment, TableImpl}
 import org.apache.flink.table.functions.{AggregateFunction, TableFunction}
 
 /**
@@ -60,10 +59,7 @@ class StreamTableEnvironment @deprecated(
     * @return The converted [[Table]].
     */
   def fromDataStream[T](dataStream: DataStream[T]): Table = {
-
-    val name = createUniqueTableName()
-    registerDataStreamInternal(name, dataStream.javaStream)
-    scan(name)
+    new TableImpl(this, asQueryOperation(dataStream.javaStream, None))
   }
 
   /**
@@ -84,9 +80,7 @@ class StreamTableEnvironment @deprecated(
   // TODO: Change fields type to `Expression*` after introducing [Expression]
   def fromDataStream[T](dataStream: DataStream[T], fields: Symbol*): Table = {
     val exprs = fields.map(_.name).toArray
-    val name = createUniqueTableName()
-    registerDataStreamInternal(name, dataStream.javaStream, exprs)
-    scan(name)
+    new TableImpl(this, asQueryOperation(dataStream.javaStream, Some(exprs)))
   }
 
   /**
@@ -102,9 +96,7 @@ class StreamTableEnvironment @deprecated(
     * @tparam T The type of the [[DataStream]] to register.
     */
   def registerDataStream[T](name: String, dataStream: DataStream[T]): Unit = {
-
-    checkValidTableName(name)
-    registerDataStreamInternal(name, dataStream.javaStream)
+    registerTable(name, fromDataStream(dataStream))
   }
 
   /**
@@ -127,8 +119,7 @@ class StreamTableEnvironment @deprecated(
   // TODO: Change fields type to `Expression*` after introducing [Expression]
   def registerDataStream[T](name: String, dataStream: DataStream[T], fields: Symbol*): Unit = {
     val exprs = fields.map(_.name).toArray
-    checkValidTableName(name)
-    registerDataStreamInternal(name, dataStream.javaStream, exprs)
+    registerTable(name, fromDataStream(dataStream, fields: _*))
   }
 
   /**
diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/calcite/FlinkRelBuilder.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/calcite/FlinkRelBuilder.scala
index 11de839..29300fb 100644
--- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/calcite/FlinkRelBuilder.scala
+++ b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/calcite/FlinkRelBuilder.scala
@@ -20,6 +20,8 @@ package org.apache.flink.table.calcite
 
 import org.apache.flink.table.calcite.FlinkRelFactories.{ExpandFactory, RankFactory, SinkFactory}
 import org.apache.flink.table.expressions.WindowProperty
+import org.apache.flink.table.operations.QueryOperation
+import org.apache.flink.table.plan.QueryOperationConverter
 import org.apache.flink.table.runtime.rank.{RankRange, RankType}
 import org.apache.flink.table.sinks.TableSink
 
@@ -46,6 +48,8 @@ class FlinkRelBuilder(
 
   require(context != null)
 
+  private val toRelNodeConverter = new QueryOperationConverter(this)
+
   private val expandFactory: ExpandFactory = {
     Util.first(context.unwrap(classOf[ExpandFactory]), FlinkRelFactories.DEFAULT_EXPAND_FACTORY)
   }
@@ -92,6 +96,12 @@ class FlinkRelBuilder(
       rankNumberType, outputRankNumber)
     push(rank)
   }
+
+  def queryOperation(queryOperation: QueryOperation): RelBuilder= {
+    val relNode = queryOperation.accept(toRelNodeConverter)
+    push(relNode)
+    this
+  }
 }
 
 object FlinkRelBuilder {
diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/optimize/RelNodeBlock.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/optimize/RelNodeBlock.scala
index 6a464ff..f7d9699 100644
--- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/optimize/RelNodeBlock.scala
+++ b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/optimize/RelNodeBlock.scala
@@ -380,11 +380,15 @@ object RelNodeBlockPlanBuilder {
       config: TableConfig): Seq[RelNodeBlock] = {
     require(sinkNodes.nonEmpty)
 
-    if (sinkNodes.size == 1) {
-      Seq(new RelNodeBlock(sinkNodes.head))
+    // expand RelTable in TableScan
+    val shuttle = new ExpandTableScanShuttle
+    val convertedRelNodes = sinkNodes.map(_.accept(shuttle))
+
+    if (convertedRelNodes.size == 1) {
+      Seq(new RelNodeBlock(convertedRelNodes.head))
     } else {
       // merge multiple RelNode trees to RelNode dag
-      val relNodeDag = reuseRelNodes(sinkNodes, config)
+      val relNodeDag = reuseRelNodes(convertedRelNodes, config)
       val builder = new RelNodeBlockPlanBuilder(config)
       builder.buildRelNodeBlockPlan(relNodeDag)
     }
@@ -397,20 +401,16 @@ object RelNodeBlockPlanBuilder {
     * @return RelNode dag which reuse common subPlan in each tree
     */
   private def reuseRelNodes(relNodes: Seq[RelNode], tableConfig: TableConfig): Seq[RelNode] = {
-    // expand RelTable in TableScan
-    val shuttle = new ExpandTableScanShuttle
-    val convertedRelNodes = relNodes.map(_.accept(shuttle))
-
     val findOpBlockWithDigest = tableConfig.getConf.getBoolean(
       PlannerConfigOptions.SQL_OPTIMIZER_REUSE_OPTIMIZE_BLOCK_WITH_DIGEST_ENABLED)
     if (!findOpBlockWithDigest) {
-      return convertedRelNodes
+      return relNodes
     }
 
     // reuse sub-plan with same digest in input RelNode trees.
-    val context = new SubplanReuseContext(true, convertedRelNodes: _*)
+    val context = new SubplanReuseContext(true, relNodes: _*)
     val reuseShuttle = new SubplanReuseShuttle(context)
-    convertedRelNodes.map(_.accept(reuseShuttle))
+    relNodes.map(_.accept(reuseShuttle))
   }
 
 }
diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/schema/RelTable.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/schema/RelTable.scala
index c2e7933..4e5d45e 100644
--- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/schema/RelTable.scala
+++ b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/schema/RelTable.scala
@@ -18,13 +18,14 @@
 
 package org.apache.flink.table.plan.schema
 
+import org.apache.flink.table.plan.stats.FlinkStatistic
+
 import org.apache.calcite.plan.RelOptTable
 import org.apache.calcite.plan.RelOptTable.ToRelContext
 import org.apache.calcite.rel.RelNode
 import org.apache.calcite.rel.`type`.{RelDataType, RelDataTypeFactory}
 import org.apache.calcite.schema.Schema.TableType
 import org.apache.calcite.schema.TranslatableTable
-import org.apache.calcite.schema.impl.AbstractTable
 
 /**
  * A [[org.apache.calcite.schema.Table]] implementation for registering
@@ -34,7 +35,7 @@ import org.apache.calcite.schema.impl.AbstractTable
  *
  * @see [[DataStreamTable]]
  */
-class RelTable(relNode: RelNode) extends AbstractTable with TranslatableTable {
+class RelTable(relNode: RelNode) extends FlinkTable with TranslatableTable {
 
   override def getJdbcTableType: TableType = ???
 
@@ -43,4 +44,8 @@ class RelTable(relNode: RelNode) extends AbstractTable with TranslatableTable {
   override def toRel(context: ToRelContext, relOptTable: RelOptTable): RelNode = {
     relNode
   }
+
+  override def getStatistic: FlinkStatistic = FlinkStatistic.UNKNOWN
+
+  override def copy(statistic: FlinkStatistic): FlinkTable = this
 }
diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/schema/TableSourceTable.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/schema/TableSourceTable.scala
index fddce0e..ce4e722 100644
--- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/schema/TableSourceTable.scala
+++ b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/schema/TableSourceTable.scala
@@ -66,6 +66,6 @@ class TableSourceTable[T](
     * @return new TableSourceTable
     */
   def replaceTableSource(tableSource: TableSource[T]): TableSourceTable[T] = {
-    new TableSourceTable(tableSource, isStreaming, statistic)
+    new TableSourceTable[T](tableSource, isStreaming, statistic)
   }
 }
diff --git a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/api/stream/ExplainTest.xml b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/api/stream/ExplainTest.xml
index ce22393..b2a9e99 100644
--- a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/api/stream/ExplainTest.xml
+++ b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/api/stream/ExplainTest.xml
@@ -23,14 +23,14 @@ LogicalProject(a=[$0], b=[$1], c=[$2])
 +- LogicalTableScan(table=[[MyTable1]])
 
 == Optimized Logical Plan ==
-DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c])
+DataStreamScan(table=[[MyTable1]], fields=[a, b, c])
 
 == Physical Execution Plan ==
  : Data Source
 	content : collect elements with CollectionInputFormat
 
 	 : Operator
-		content : SourceConversion(table:Buffer(_DataStreamTable_0), fields:(a, b, c))
+		content : SourceConversion(table:Buffer(MyTable1), fields:(a, b, c))
 		ship_strategy : FORWARD
 
 ]]>
@@ -49,14 +49,14 @@ Calc(select=[EXPR$0], updateAsRetraction=[false], accMode=[Acc]): rowcount = , c
 +- GroupAggregate(groupBy=[a], select=[a, COUNT(*) AS EXPR$0], updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
    +- Exchange(distribution=[hash[a]], updateAsRetraction=[true], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
       +- Calc(select=[a], updateAsRetraction=[true], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
-         +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c], updateAsRetraction=[true], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
+         +- DataStreamScan(table=[[MyTable1]], fields=[a, b, c], updateAsRetraction=[true], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
 
 == Physical Execution Plan ==
  : Data Source
 	content : collect elements with CollectionInputFormat
 
 	 : Operator
-		content : SourceConversion(table:Buffer(_DataStreamTable_0), fields:(a, b, c))
+		content : SourceConversion(table:Buffer(MyTable1), fields:(a, b, c))
 		ship_strategy : FORWARD
 
 		 : Operator
@@ -81,14 +81,14 @@ LogicalProject(a=[$0], b=[$1], c=[$2])
 +- LogicalTableScan(table=[[MyTable1]])
 
 == Optimized Logical Plan ==
-DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c], updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
+DataStreamScan(table=[[MyTable1]], fields=[a, b, c], updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
 
 == Physical Execution Plan ==
  : Data Source
 	content : collect elements with CollectionInputFormat
 
 	 : Operator
-		content : SourceConversion(table:Buffer(_DataStreamTable_0), fields:(a, b, c))
+		content : SourceConversion(table:Buffer(MyTable1), fields:(a, b, c))
 		ship_strategy : FORWARD
 
 ]]>
@@ -139,14 +139,14 @@ Calc(select=[EXPR$0])
 +- GroupAggregate(groupBy=[a], select=[a, COUNT(*) AS EXPR$0])
    +- Exchange(distribution=[hash[a]])
       +- Calc(select=[a])
-         +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c])
+         +- DataStreamScan(table=[[MyTable1]], fields=[a, b, c])
 
 == Physical Execution Plan ==
  : Data Source
 	content : collect elements with CollectionInputFormat
 
 	 : Operator
-		content : SourceConversion(table:Buffer(_DataStreamTable_0), fields:(a, b, c))
+		content : SourceConversion(table:Buffer(MyTable1), fields:(a, b, c))
 		ship_strategy : FORWARD
 
 		 : Operator
@@ -173,14 +173,14 @@ LogicalProject(a=[$0], b=[$1], c=[$2])
 
 == Optimized Logical Plan ==
 Calc(select=[a, b, c], where=[=(MOD(a, 2), 0)])
-+- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c])
++- DataStreamScan(table=[[MyTable1]], fields=[a, b, c])
 
 == Physical Execution Plan ==
  : Data Source
 	content : collect elements with CollectionInputFormat
 
 	 : Operator
-		content : SourceConversion(table:Buffer(_DataStreamTable_0), fields:(a, b, c))
+		content : SourceConversion(table:Buffer(MyTable1), fields:(a, b, c))
 		ship_strategy : FORWARD
 
 		 : Operator
@@ -199,14 +199,14 @@ LogicalProject(a=[$0], b=[$1], c=[$2])
 
 == Optimized Logical Plan ==
 Calc(select=[a, b, c], where=[=(MOD(a, 2), 0)], updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
-+- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c], updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
++- DataStreamScan(table=[[MyTable1]], fields=[a, b, c], updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
 
 == Physical Execution Plan ==
  : Data Source
 	content : collect elements with CollectionInputFormat
 
 	 : Operator
-		content : SourceConversion(table:Buffer(_DataStreamTable_0), fields:(a, b, c))
+		content : SourceConversion(table:Buffer(MyTable1), fields:(a, b, c))
 		ship_strategy : FORWARD
 
 		 : Operator
@@ -229,9 +229,9 @@ LogicalProject(a=[$0], b=[$1], c=[$2], e=[$4], f=[$5])
 Calc(select=[a, b, c, e, f])
 +- Join(joinType=[InnerJoin], where=[=(a, d)], select=[a, b, c, d, e, f], leftInputSpec=[NoUniqueKey], rightInputSpec=[NoUniqueKey])
    :- Exchange(distribution=[hash[a]])
-   :  +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c])
+   :  +- DataStreamScan(table=[[MyTable1]], fields=[a, b, c])
    +- Exchange(distribution=[hash[d]])
-      +- DataStreamScan(table=[[_DataStreamTable_1]], fields=[d, e, f])
+      +- DataStreamScan(table=[[MyTable2]], fields=[d, e, f])
 
 == Physical Execution Plan ==
  : Data Source
@@ -241,11 +241,11 @@ Calc(select=[a, b, c, e, f])
 	content : collect elements with CollectionInputFormat
 
 	 : Operator
-		content : SourceConversion(table:Buffer(_DataStreamTable_0), fields:(a, b, c))
+		content : SourceConversion(table:Buffer(MyTable1), fields:(a, b, c))
 		ship_strategy : FORWARD
 
 		 : Operator
-			content : SourceConversion(table:Buffer(_DataStreamTable_1), fields:(d, e, f))
+			content : SourceConversion(table:Buffer(MyTable2), fields:(d, e, f))
 			ship_strategy : FORWARD
 
 			 : Operator
@@ -270,8 +270,8 @@ LogicalUnion(all=[true])
 
 == Optimized Logical Plan ==
 Union(all=[true], union=[a, b, c], updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
-:- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c], updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
-+- DataStreamScan(table=[[_DataStreamTable_1]], fields=[d, e, f], updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
+:- DataStreamScan(table=[[MyTable1]], fields=[a, b, c], updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
++- DataStreamScan(table=[[MyTable2]], fields=[d, e, f], updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
 
 == Physical Execution Plan ==
  : Data Source
@@ -281,11 +281,11 @@ Union(all=[true], union=[a, b, c], updateAsRetraction=[false], accMode=[Acc]): r
 	content : collect elements with CollectionInputFormat
 
 	 : Operator
-		content : SourceConversion(table:Buffer(_DataStreamTable_0), fields:(a, b, c))
+		content : SourceConversion(table:Buffer(MyTable1), fields:(a, b, c))
 		ship_strategy : FORWARD
 
 		 : Operator
-			content : SourceConversion(table:Buffer(_DataStreamTable_1), fields:(d, e, f))
+			content : SourceConversion(table:Buffer(MyTable2), fields:(d, e, f))
 			ship_strategy : FORWARD
 
 ]]>
@@ -304,9 +304,9 @@ LogicalProject(a=[$0], b=[$1], c=[$2], e=[$4], f=[$5])
 Calc(select=[a, b, c, e, f], updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
 +- Join(joinType=[InnerJoin], where=[=(a, d)], select=[a, b, c, d, e, f], leftInputSpec=[NoUniqueKey], rightInputSpec=[NoUniqueKey], updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
    :- Exchange(distribution=[hash[a]], updateAsRetraction=[true], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
-   :  +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c], updateAsRetraction=[true], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
+   :  +- DataStreamScan(table=[[MyTable1]], fields=[a, b, c], updateAsRetraction=[true], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
    +- Exchange(distribution=[hash[d]], updateAsRetraction=[true], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
-      +- DataStreamScan(table=[[_DataStreamTable_1]], fields=[d, e, f], updateAsRetraction=[true], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
+      +- DataStreamScan(table=[[MyTable2]], fields=[d, e, f], updateAsRetraction=[true], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
 
 == Physical Execution Plan ==
  : Data Source
@@ -316,11 +316,11 @@ Calc(select=[a, b, c, e, f], updateAsRetraction=[false], accMode=[Acc]): rowcoun
 	content : collect elements with CollectionInputFormat
 
 	 : Operator
-		content : SourceConversion(table:Buffer(_DataStreamTable_0), fields:(a, b, c))
+		content : SourceConversion(table:Buffer(MyTable1), fields:(a, b, c))
 		ship_strategy : FORWARD
 
 		 : Operator
-			content : SourceConversion(table:Buffer(_DataStreamTable_1), fields:(d, e, f))
+			content : SourceConversion(table:Buffer(MyTable2), fields:(d, e, f))
 			ship_strategy : FORWARD
 
 			 : Operator
@@ -342,20 +342,20 @@ LogicalSink(name=[sink1], fields=[a, cnt])
    +- LogicalFilter(condition=[>($1, 10)])
       +- LogicalAggregate(group=[{0}], cnt=[COUNT()])
          +- LogicalProject(a=[$0])
-            +- LogicalTableScan(table=[[_DataStreamTable_0]])
+            +- LogicalTableScan(table=[[MyTable1]])
 
 LogicalSink(name=[sink1], fields=[a, cnt])
 +- LogicalProject(a=[$0], cnt=[$1])
    +- LogicalFilter(condition=[<($1, 10)])
       +- LogicalAggregate(group=[{0}], cnt=[COUNT()])
          +- LogicalProject(a=[$0])
-            +- LogicalTableScan(table=[[_DataStreamTable_0]])
+            +- LogicalTableScan(table=[[MyTable1]])
 
 == Optimized Logical Plan ==
 GroupAggregate(groupBy=[a], select=[a, COUNT(*) AS cnt], reuse_id=[1])
 +- Exchange(distribution=[hash[a]])
    +- Calc(select=[a])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c])
+      +- DataStreamScan(table=[[MyTable1]], fields=[a, b, c])
 
 Sink(name=[sink1], fields=[a, cnt])
 +- Calc(select=[a, cnt], where=[>(cnt, 10)])
@@ -370,7 +370,7 @@ Sink(name=[sink1], fields=[a, cnt])
 	content : collect elements with CollectionInputFormat
 
 	 : Operator
-		content : SourceConversion(table:Buffer(_DataStreamTable_0), fields:(a, b, c))
+		content : SourceConversion(table:Buffer(MyTable1), fields:(a, b, c))
 		ship_strategy : FORWARD
 
 		 : Operator
@@ -424,20 +424,20 @@ LogicalSink(name=[sink1], fields=[a, cnt])
    +- LogicalFilter(condition=[>($1, 10)])
       +- LogicalAggregate(group=[{0}], cnt=[COUNT()])
          +- LogicalProject(a=[$0])
-            +- LogicalTableScan(table=[[_DataStreamTable_0]])
+            +- LogicalTableScan(table=[[MyTable1]])
 
 LogicalSink(name=[sink1], fields=[a, cnt])
 +- LogicalProject(a=[$0], cnt=[$1])
    +- LogicalFilter(condition=[<($1, 10)])
       +- LogicalAggregate(group=[{0}], cnt=[COUNT()])
          +- LogicalProject(a=[$0])
-            +- LogicalTableScan(table=[[_DataStreamTable_0]])
+            +- LogicalTableScan(table=[[MyTable1]])
 
 == Optimized Logical Plan ==
 GroupAggregate(groupBy=[a], select=[a, COUNT(*) AS cnt], updateAsRetraction=[false], accMode=[Acc], reuse_id=[1]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
 +- Exchange(distribution=[hash[a]], updateAsRetraction=[true], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
    +- Calc(select=[a], updateAsRetraction=[true], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c], updateAsRetraction=[true], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
+      +- DataStreamScan(table=[[MyTable1]], fields=[a, b, c], updateAsRetraction=[true], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
 
 Sink(name=[sink1], fields=[a, cnt], updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
 +- Calc(select=[a, cnt], where=[>(cnt, 10)], updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
@@ -452,7 +452,7 @@ Sink(name=[sink1], fields=[a, cnt], updateAsRetraction=[false], accMode=[Acc]):
 	content : collect elements with CollectionInputFormat
 
 	 : Operator
-		content : SourceConversion(table:Buffer(_DataStreamTable_0), fields:(a, b, c))
+		content : SourceConversion(table:Buffer(MyTable1), fields:(a, b, c))
 		ship_strategy : FORWARD
 
 		 : Operator
@@ -509,14 +509,14 @@ LogicalSink(fields=[a, b, c])
 == Optimized Logical Plan ==
 Sink(fields=[a, b, c])
 +- Calc(select=[a, b, c], where=[>(a, 10)])
-   +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c])
+   +- DataStreamScan(table=[[MyTable1]], fields=[a, b, c])
 
 == Physical Execution Plan ==
  : Data Source
 	content : collect elements with CollectionInputFormat
 
 	 : Operator
-		content : SourceConversion(table:Buffer(_DataStreamTable_0), fields:(a, b, c))
+		content : SourceConversion(table:Buffer(MyTable1), fields:(a, b, c))
 		ship_strategy : FORWARD
 
 		 : Operator
@@ -544,14 +544,14 @@ LogicalSort(sort0=[$0], dir0=[ASC-nulls-first], fetch=[5])
 == Optimized Logical Plan ==
 SortLimit(orderBy=[a ASC], offset=[0], fetch=[5])
 +- Exchange(distribution=[single])
-   +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c])
+   +- DataStreamScan(table=[[MyTable1]], fields=[a, b, c])
 
 == Physical Execution Plan ==
  : Data Source
 	content : collect elements with CollectionInputFormat
 
 	 : Operator
-		content : SourceConversion(table:Buffer(_DataStreamTable_0), fields:(a, b, c))
+		content : SourceConversion(table:Buffer(MyTable1), fields:(a, b, c))
 		ship_strategy : FORWARD
 
 		 : Operator
@@ -571,14 +571,14 @@ LogicalSort(sort0=[$0], dir0=[ASC-nulls-first], fetch=[5])
 == Optimized Logical Plan ==
 SortLimit(orderBy=[a ASC], offset=[0], fetch=[5], updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
 +- Exchange(distribution=[single], updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
-   +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c], updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
+   +- DataStreamScan(table=[[MyTable1]], fields=[a, b, c], updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
 
 == Physical Execution Plan ==
  : Data Source
 	content : collect elements with CollectionInputFormat
 
 	 : Operator
-		content : SourceConversion(table:Buffer(_DataStreamTable_0), fields:(a, b, c))
+		content : SourceConversion(table:Buffer(MyTable1), fields:(a, b, c))
 		ship_strategy : FORWARD
 
 		 : Operator
@@ -599,14 +599,14 @@ LogicalSink(fields=[a, b, c])
 == Optimized Logical Plan ==
 Sink(fields=[a, b, c], updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
 +- Calc(select=[a, b, c], where=[>(a, 10)], updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
-   +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c], updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
+   +- DataStreamScan(table=[[MyTable1]], fields=[a, b, c], updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
 
 == Physical Execution Plan ==
  : Data Source
 	content : collect elements with CollectionInputFormat
 
 	 : Operator
-		content : SourceConversion(table:Buffer(_DataStreamTable_0), fields:(a, b, c))
+		content : SourceConversion(table:Buffer(MyTable1), fields:(a, b, c))
 		ship_strategy : FORWARD
 
 		 : Operator
@@ -635,8 +635,8 @@ LogicalUnion(all=[true])
 
 == Optimized Logical Plan ==
 Union(all=[true], union=[a, b, c])
-:- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c])
-+- DataStreamScan(table=[[_DataStreamTable_1]], fields=[d, e, f])
+:- DataStreamScan(table=[[MyTable1]], fields=[a, b, c])
++- DataStreamScan(table=[[MyTable2]], fields=[d, e, f])
 
 == Physical Execution Plan ==
  : Data Source
@@ -646,11 +646,11 @@ Union(all=[true], union=[a, b, c])
 	content : collect elements with CollectionInputFormat
 
 	 : Operator
-		content : SourceConversion(table:Buffer(_DataStreamTable_0), fields:(a, b, c))
+		content : SourceConversion(table:Buffer(MyTable1), fields:(a, b, c))
 		ship_strategy : FORWARD
 
 		 : Operator
-			content : SourceConversion(table:Buffer(_DataStreamTable_1), fields:(d, e, f))
+			content : SourceConversion(table:Buffer(MyTable2), fields:(d, e, f))
 			ship_strategy : FORWARD
 
 ]]>
diff --git a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/DagOptimizationTest.xml b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/DagOptimizationTest.xml
index 930db5f..75fa01b 100644
--- a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/DagOptimizationTest.xml
+++ b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/DagOptimizationTest.xml
@@ -714,8 +714,22 @@ LogicalSink(fields=[a1, b, c1])
 +- LogicalProject(a1=[$2], b=[$3], c1=[$1])
    +- LogicalFilter(condition=[=($2, $0)])
       +- LogicalJoin(condition=[true], joinType=[inner])
-         :- LogicalTableScan(table=[[table4]])
-         +- LogicalTableScan(table=[[table5]])
+         :- LogicalProject(a3=[$0], c1=[$2])
+         :  +- LogicalFilter(condition=[<($1, 5)])
+         :     +- LogicalProject(a=[$0], b=[$1], c=[$2])
+         :        +- LogicalFilter(condition=[>=($0, 0)])
+         :           +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+         +- LogicalProject(a1=[$0], b=[$1], c2=[$3])
+            +- LogicalFilter(condition=[=($0, $2)])
+               +- LogicalJoin(condition=[true], joinType=[inner])
+                  :- LogicalProject(a1=[$0], b=[$1])
+                  :  +- LogicalFilter(condition=[<=($0, 10)])
+                  :     +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+                  +- LogicalProject(a2=[$0], c=[$2])
+                     +- LogicalFilter(condition=[>=($1, 5)])
+                        +- LogicalProject(a=[$0], b=[$1], c=[$2])
+                           +- LogicalFilter(condition=[>=($0, 0)])
+                              +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -743,9 +757,17 @@ Sink(fields=[a1, b, c1])
 LogicalSink(fields=[a1, b1])
 +- LogicalUnion(all=[true])
    :- LogicalProject(a1=[$0], b1=[$1])
-   :  +- LogicalTableScan(table=[[table1]])
+   :  +- LogicalProject(a1=[$0], b1=[$1])
+   :     +- LogicalFilter(condition=[<=($0, 10)])
+   :        +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
    +- LogicalProject(a=[$0], b1=[$1])
-      +- LogicalTableScan(table=[[table2]])
+      +- LogicalProject(a=[$2], b1=[$1])
+         +- LogicalFilter(condition=[=($2, $0)])
+            +- LogicalJoin(condition=[true], joinType=[inner])
+               :- LogicalProject(a1=[$0], b1=[$1])
+               :  +- LogicalFilter(condition=[<=($0, 10)])
+               :     +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+               +- LogicalTableScan(table=[[MyTable2]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -771,8 +793,28 @@ LogicalSink(fields=[a, b, c])
 +- LogicalProject(a1=[$0], b1=[$3], c1=[$4])
    +- LogicalFilter(condition=[=($0, $2)])
       +- LogicalJoin(condition=[true], joinType=[inner])
-         :- LogicalTableScan(table=[[table1]])
-         +- LogicalTableScan(table=[[table6]])
+         :- LogicalProject(a1=[$0], b=[$1])
+         :  +- LogicalFilter(condition=[<=($0, 10)])
+         :     +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+         +- LogicalProject(a3=[$0], b1=[$3], c1=[$1])
+            +- LogicalFilter(condition=[=($2, $0)])
+               +- LogicalJoin(condition=[true], joinType=[inner])
+                  :- LogicalProject(a3=[$0], c1=[$2])
+                  :  +- LogicalFilter(condition=[<($1, 5)])
+                  :     +- LogicalProject(a=[$0], b=[$1], c=[$2])
+                  :        +- LogicalFilter(condition=[>=($0, 0)])
+                  :           +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+                  +- LogicalProject(a1=[$0], b=[$1], c2=[$3])
+                     +- LogicalFilter(condition=[=($0, $2)])
+                        +- LogicalJoin(condition=[true], joinType=[inner])
+                           :- LogicalProject(a1=[$0], b=[$1])
+                           :  +- LogicalFilter(condition=[<=($0, 10)])
+                           :     +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+                           +- LogicalProject(a2=[$0], c=[$2])
+                              +- LogicalFilter(condition=[>=($1, 5)])
+                                 +- LogicalProject(a=[$0], b=[$1], c=[$2])
+                                    +- LogicalFilter(condition=[>=($0, 0)])
+                                       +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
diff --git a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/join/LookupJoinTest.xml b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/join/LookupJoinTest.xml
index b398e66..65626e3 100644
--- a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/join/LookupJoinTest.xml
+++ b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/join/LookupJoinTest.xml
@@ -71,7 +71,8 @@ HashAggregate(isMerge=[true], groupBy=[b], select=[b, Final_COUNT(count$0) AS EX
 LogicalProject(a=[$0], b=[$1], c=[$2], proctime=[$3], id=[$4], name=[$5], age=[$6])
 +- LogicalFilter(condition=[=($0, $4)])
    +- LogicalCorrelate(correlation=[$cor0], joinType=[inner], requiredColumns=[{3}])
-      :- LogicalTableScan(table=[[MyTable]])
+      :- LogicalProject(a=[$0], b=[$1], c=[$2], proctime=[PROCTIME()])
+      :  +- LogicalTableScan(table=[[T0]])
       +- LogicalSnapshot(period=[$cor0.proctime])
          +- LogicalTableScan(table=[[temporalTest, source: [TestTemporalTable(id, name, age)]]])
 ]]>
@@ -99,7 +100,8 @@ LogicalProject(a=[$0], b=[$1], c=[$2], proctime=[$3], id=[$4], name=[$5], age=[$
 +- LogicalFilter(condition=[>($2, 1000)])
    +- LogicalFilter(condition=[AND(=($0, $4), =($6, 10))])
       +- LogicalCorrelate(correlation=[$cor0], joinType=[inner], requiredColumns=[{3}])
-         :- LogicalTableScan(table=[[MyTable]])
+         :- LogicalProject(a=[$0], b=[$1], c=[$2], proctime=[PROCTIME()])
+         :  +- LogicalTableScan(table=[[T0]])
          +- LogicalSnapshot(period=[$cor0.proctime])
             +- LogicalTableScan(table=[[temporalTest, source: [TestTemporalTable(id, name, age)]]])
 ]]>
@@ -124,7 +126,8 @@ LogicalProject(a=[$0], b=[$1], proctime=[$2], id=[$3], name=[$4], age=[$5])
    +- LogicalCorrelate(correlation=[$cor0], joinType=[inner], requiredColumns=[{2}])
       :- LogicalProject(a=[$0], b=[$1], proctime=[$3])
       :  +- LogicalFilter(condition=[>($2, 1000)])
-      :     +- LogicalTableScan(table=[[MyTable]])
+      :     +- LogicalProject(a=[$0], b=[$1], c=[$2], proctime=[PROCTIME()])
+      :        +- LogicalTableScan(table=[[T0]])
       +- LogicalSnapshot(period=[$cor0.proctime])
          +- LogicalTableScan(table=[[temporalTest, source: [TestTemporalTable(id, name, age)]]])
 ]]>
@@ -147,7 +150,8 @@ Calc(select=[a, b, PROCTIME() AS proctime, id, name, age])
 LogicalProject(a=[$0], b=[$1], c=[$2], proctime=[$3], id=[$4], name=[$5], age=[$6])
 +- LogicalFilter(condition=[=($0, $4)])
    +- LogicalCorrelate(correlation=[$cor0], joinType=[left], requiredColumns=[{3}])
-      :- LogicalTableScan(table=[[MyTable]])
+      :- LogicalProject(a=[$0], b=[$1], c=[$2], proctime=[PROCTIME()])
+      :  +- LogicalTableScan(table=[[T0]])
       +- LogicalSnapshot(period=[$cor0.proctime])
          +- LogicalTableScan(table=[[temporalTest, source: [TestTemporalTable(id, name, age)]]])
 ]]>
@@ -174,7 +178,8 @@ ON T.a = D.id
 LogicalProject(a=[$0], b=[$1], c=[$2], proctime=[$3], id=[$4])
 +- LogicalFilter(condition=[=($0, $4)])
    +- LogicalCorrelate(correlation=[$cor0], joinType=[inner], requiredColumns=[{3}])
-      :- LogicalTableScan(table=[[MyTable]])
+      :- LogicalProject(a=[$0], b=[$1], c=[$2], proctime=[PROCTIME()])
+      :  +- LogicalTableScan(table=[[T0]])
       +- LogicalSnapshot(period=[$cor0.proctime])
          +- LogicalTableScan(table=[[temporalTest, source: [TestTemporalTable(id, name, age)]]])
 ]]>
diff --git a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/rules/logical/CalcRankTransposeRuleTest.xml b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/rules/logical/CalcRankTransposeRuleTest.xml
index 33b47e8..ebeac28 100644
--- a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/rules/logical/CalcRankTransposeRuleTest.xml
+++ b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/rules/logical/CalcRankTransposeRuleTest.xml
@@ -71,7 +71,7 @@ LogicalProject(rank_num=[$4], rowtime=[$3], a=[$0], rank_num0=[$4], a0=[$0], ran
 FlinkLogicalCalc(select=[rank_num1 AS rank_num, rowtime, a, rank_num1 AS rank_num0, a AS a0, rank_num1])
 +- FlinkLogicalRank(rankType=[ROW_NUMBER], rankRange=[rankStart=1, rankEnd=2], partitionBy=[a], orderBy=[rowtime DESC], select=[a, rowtime, rank_num1])
    +- FlinkLogicalCalc(select=[a, rowtime])
-      +- FlinkLogicalDataStreamTableScan(table=[[_DataStreamTable_0]])
+      +- FlinkLogicalDataStreamTableScan(table=[[MyTable]])
 ]]>
     </Resource>
   </TestCase>
@@ -98,7 +98,7 @@ LogicalProject(a=[$0])
 FlinkLogicalCalc(select=[a])
 +- FlinkLogicalRank(rankType=[ROW_NUMBER], rankRange=[rankStart=1, rankEnd=1], partitionBy=[a], orderBy=[rowtime DESC], select=[a, rowtime])
    +- FlinkLogicalCalc(select=[a, rowtime])
-      +- FlinkLogicalDataStreamTableScan(table=[[_DataStreamTable_0]])
+      +- FlinkLogicalDataStreamTableScan(table=[[MyTable]])
 ]]>
     </Resource>
   </TestCase>
@@ -125,7 +125,7 @@ LogicalProject(rowtime=[$3])
 FlinkLogicalCalc(select=[rowtime])
 +- FlinkLogicalRank(rankType=[ROW_NUMBER], rankRange=[rankStart=1, rankEnd=1], partitionBy=[a], orderBy=[rowtime DESC], select=[a, rowtime])
    +- FlinkLogicalCalc(select=[a, rowtime])
-      +- FlinkLogicalDataStreamTableScan(table=[[_DataStreamTable_0]])
+      +- FlinkLogicalDataStreamTableScan(table=[[MyTable]])
 ]]>
     </Resource>
   </TestCase>
@@ -152,7 +152,7 @@ LogicalProject(rowtime=[$3], c=[$2])
 FlinkLogicalCalc(select=[rowtime, c], where=[>(a, 10)])
 +- FlinkLogicalRank(rankType=[ROW_NUMBER], rankRange=[rankStart=1, rankEnd=2], partitionBy=[a], orderBy=[rowtime DESC], select=[a, c, rowtime])
    +- FlinkLogicalCalc(select=[a, c, rowtime])
-      +- FlinkLogicalDataStreamTableScan(table=[[_DataStreamTable_0]])
+      +- FlinkLogicalDataStreamTableScan(table=[[MyTable]])
 ]]>
     </Resource>
   </TestCase>
@@ -178,7 +178,7 @@ LogicalProject(a=[$0], rowtime=[$3])
       <![CDATA[
 FlinkLogicalRank(rankType=[ROW_NUMBER], rankRange=[rankStart=1, rankEnd=2], partitionBy=[a], orderBy=[rowtime DESC], select=[a, rowtime])
 +- FlinkLogicalCalc(select=[a, rowtime])
-   +- FlinkLogicalDataStreamTableScan(table=[[_DataStreamTable_0]])
+   +- FlinkLogicalDataStreamTableScan(table=[[MyTable]])
 ]]>
     </Resource>
   </TestCase>
@@ -270,7 +270,7 @@ LogicalProject(a=[$0], rowtime=[$3], rank_num=[$4])
       <![CDATA[
 FlinkLogicalRank(rankType=[ROW_NUMBER], rankRange=[rankStart=1, rankEnd=2], partitionBy=[a], orderBy=[rowtime DESC], select=[a, rowtime, w0$o0])
 +- FlinkLogicalCalc(select=[a, rowtime])
-   +- FlinkLogicalDataStreamTableScan(table=[[_DataStreamTable_0]])
+   +- FlinkLogicalDataStreamTableScan(table=[[MyTable]])
 ]]>
     </Resource>
   </TestCase>
diff --git a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/rules/logical/RankNumberColumnRemoveRuleTest.xml b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/rules/logical/RankNumberColumnRemoveRuleTest.xml
index 754e016..50711a1 100644
--- a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/rules/logical/RankNumberColumnRemoveRuleTest.xml
+++ b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/rules/logical/RankNumberColumnRemoveRuleTest.xml
@@ -39,7 +39,7 @@ LogicalProject(a=[$0], rank_num=[$4])
 FlinkLogicalCalc(select=[a, w0$o0])
 +- FlinkLogicalRank(rankType=[RANK], rankRange=[rankStart=1, rankEnd=1], partitionBy=[a], orderBy=[rowtime DESC], select=[a, rowtime, w0$o0])
    +- FlinkLogicalCalc(select=[a, rowtime])
-      +- FlinkLogicalDataStreamTableScan(table=[[_DataStreamTable_0]])
+      +- FlinkLogicalDataStreamTableScan(table=[[MyTable]])
 ]]>
     </Resource>
   </TestCase>
@@ -66,7 +66,7 @@ LogicalProject(a=[$0], rank_num=[$4])
 FlinkLogicalCalc(select=[a, w0$o0])
 +- FlinkLogicalRank(rankType=[ROW_NUMBER], rankRange=[rankStart=1, rankEnd=2], partitionBy=[a], orderBy=[rowtime DESC], select=[a, rowtime, w0$o0])
    +- FlinkLogicalCalc(select=[a, rowtime])
-      +- FlinkLogicalDataStreamTableScan(table=[[_DataStreamTable_0]])
+      +- FlinkLogicalDataStreamTableScan(table=[[MyTable]])
 ]]>
     </Resource>
   </TestCase>
@@ -93,7 +93,7 @@ LogicalProject(a=[$0])
 FlinkLogicalCalc(select=[a])
 +- FlinkLogicalRank(rankType=[ROW_NUMBER], rankRange=[rankStart=1, rankEnd=1], partitionBy=[a], orderBy=[rowtime DESC], select=[a, rowtime])
    +- FlinkLogicalCalc(select=[a, rowtime])
-      +- FlinkLogicalDataStreamTableScan(table=[[_DataStreamTable_0]])
+      +- FlinkLogicalDataStreamTableScan(table=[[MyTable]])
 ]]>
     </Resource>
   </TestCase>
@@ -120,7 +120,7 @@ LogicalProject(a=[$0], rank_num=[$4])
 FlinkLogicalCalc(select=[a, 1:BIGINT AS w0$o0])
 +- FlinkLogicalRank(rankType=[ROW_NUMBER], rankRange=[rankStart=1, rankEnd=1], partitionBy=[a], orderBy=[rowtime DESC], select=[a, rowtime])
    +- FlinkLogicalCalc(select=[a, rowtime])
-      +- FlinkLogicalDataStreamTableScan(table=[[_DataStreamTable_0]])
+      +- FlinkLogicalDataStreamTableScan(table=[[MyTable]])
 ]]>
     </Resource>
   </TestCase>
diff --git a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/DagOptimizationTest.xml b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/DagOptimizationTest.xml
index 7c15d6a..b1482ec 100644
--- a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/DagOptimizationTest.xml
+++ b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/DagOptimizationTest.xml
@@ -735,8 +735,22 @@ LogicalSink(fields=[a1, b, c1])
 +- LogicalProject(a1=[$2], b=[$3], c1=[$1])
    +- LogicalFilter(condition=[=($2, $0)])
       +- LogicalJoin(condition=[true], joinType=[inner])
-         :- LogicalTableScan(table=[[table4]])
-         +- LogicalTableScan(table=[[table5]])
+         :- LogicalProject(a3=[$0], c1=[$2])
+         :  +- LogicalFilter(condition=[<($1, 5)])
+         :     +- LogicalProject(a=[$0], b=[$1], c=[$2])
+         :        +- LogicalFilter(condition=[>=($0, 0)])
+         :           +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+         +- LogicalProject(a1=[$0], b=[$1], c2=[$3])
+            +- LogicalFilter(condition=[=($0, $2)])
+               +- LogicalJoin(condition=[true], joinType=[inner])
+                  :- LogicalProject(a1=[$0], b=[$1])
+                  :  +- LogicalFilter(condition=[<=($0, 10)])
+                  :     +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+                  +- LogicalProject(a2=[$0], c=[$2])
+                     +- LogicalFilter(condition=[>=($1, 5)])
+                        +- LogicalProject(a=[$0], b=[$1], c=[$2])
+                           +- LogicalFilter(condition=[>=($0, 0)])
+                              +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -765,9 +779,17 @@ Sink(fields=[a1, b, c1], updateAsRetraction=[false], accMode=[Acc])
 LogicalSink(fields=[a1, b1])
 +- LogicalUnion(all=[true])
    :- LogicalProject(a1=[$0], b1=[$1])
-   :  +- LogicalTableScan(table=[[table1]])
+   :  +- LogicalProject(a1=[$0], b1=[$1])
+   :     +- LogicalFilter(condition=[<=($0, 10)])
+   :        +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
    +- LogicalProject(a=[$0], b1=[$1])
-      +- LogicalTableScan(table=[[table2]])
+      +- LogicalProject(a=[$2], b1=[$1])
+         +- LogicalFilter(condition=[=($2, $0)])
+            +- LogicalJoin(condition=[true], joinType=[inner])
+               :- LogicalProject(a1=[$0], b1=[$1])
+               :  +- LogicalFilter(condition=[<=($0, 10)])
+               :     +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+               +- LogicalTableScan(table=[[MyTable2]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -781,7 +803,7 @@ Sink(fields=[a1, b1], updateAsRetraction=[false], accMode=[Acc])
          :- Exchange(distribution=[hash[a1]], updateAsRetraction=[true], accMode=[Acc])
          :  +- Reused(reference_id=[1])
          +- Exchange(distribution=[hash[a]], updateAsRetraction=[true], accMode=[Acc])
-            +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, d, e], updateAsRetraction=[true], accMode=[Acc])
+            +- DataStreamScan(table=[[MyTable2]], fields=[a, b, c, d, e], updateAsRetraction=[true], accMode=[Acc])
 ]]>
     </Resource>
   </TestCase>
@@ -792,8 +814,28 @@ LogicalSink(fields=[a, b, c])
 +- LogicalProject(a1=[$0], b1=[$3], c1=[$4])
    +- LogicalFilter(condition=[=($0, $2)])
       +- LogicalJoin(condition=[true], joinType=[inner])
-         :- LogicalTableScan(table=[[table1]])
-         +- LogicalTableScan(table=[[table6]])
+         :- LogicalProject(a1=[$0], b=[$1])
+         :  +- LogicalFilter(condition=[<=($0, 10)])
+         :     +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+         +- LogicalProject(a3=[$0], b1=[$3], c1=[$1])
+            +- LogicalFilter(condition=[=($2, $0)])
+               +- LogicalJoin(condition=[true], joinType=[inner])
+                  :- LogicalProject(a3=[$0], c1=[$2])
+                  :  +- LogicalFilter(condition=[<($1, 5)])
+                  :     +- LogicalProject(a=[$0], b=[$1], c=[$2])
+                  :        +- LogicalFilter(condition=[>=($0, 0)])
+                  :           +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+                  +- LogicalProject(a1=[$0], b=[$1], c2=[$3])
+                     +- LogicalFilter(condition=[=($0, $2)])
+                        +- LogicalJoin(condition=[true], joinType=[inner])
+                           :- LogicalProject(a1=[$0], b=[$1])
+                           :  +- LogicalFilter(condition=[<=($0, 10)])
+                           :     +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+                           +- LogicalProject(a2=[$0], c=[$2])
+                              +- LogicalFilter(condition=[>=($1, 5)])
+                                 +- LogicalProject(a=[$0], b=[$1], c=[$2])
+                                    +- LogicalFilter(condition=[>=($0, 0)])
+                                       +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
diff --git a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/LimitTest.xml b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/LimitTest.xml
index 3b6ffc6..4e0db1c 100644
--- a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/LimitTest.xml
+++ b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/LimitTest.xml
@@ -49,7 +49,7 @@ LogicalSort(offset=[10], fetch=[10])
 Calc(select=[a, c])
 +- Limit(offset=[10], fetch=[10])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -69,7 +69,7 @@ LogicalSort(fetch=[10])
 Calc(select=[a, c])
 +- Limit(offset=[0], fetch=[10])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -276,7 +276,7 @@ LogicalSort(offset=[1], fetch=[10])
 Calc(select=[a, c])
 +- Limit(offset=[1], fetch=[10])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -296,7 +296,7 @@ LogicalSort(offset=[0], fetch=[10])
 Calc(select=[a, c])
 +- Limit(offset=[0], fetch=[10])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -316,7 +316,7 @@ LogicalSort(fetch=[5])
 Calc(select=[a, b, c, PROCTIME_MATERIALIZE(proctime) AS proctime, rowtime])
 +- Limit(offset=[0], fetch=[5])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -336,7 +336,7 @@ LogicalSort(fetch=[2])
 Calc(select=[PROCTIME_MATERIALIZE(proctime) AS proctime, c])
 +- Limit(offset=[0], fetch=[2])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -356,7 +356,7 @@ LogicalSort(fetch=[2])
 Calc(select=[PROCTIME_MATERIALIZE(proctime) AS desc, c])
 +- Limit(offset=[0], fetch=[2])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -376,7 +376,7 @@ LogicalSort(fetch=[2])
 Calc(select=[c, PROCTIME_MATERIALIZE(proctime) AS desc])
 +- Limit(offset=[0], fetch=[2])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -396,7 +396,7 @@ LogicalSort(fetch=[2])
 Calc(select=[c, PROCTIME_MATERIALIZE(proctime) AS proctime])
 +- Limit(offset=[0], fetch=[2])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -416,7 +416,7 @@ LogicalSort(fetch=[2])
 Calc(select=[rowtime, c])
 +- Limit(offset=[0], fetch=[2])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -436,7 +436,7 @@ LogicalSort(fetch=[2])
 Calc(select=[rowtime AS desc, c])
 +- Limit(offset=[0], fetch=[2])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -456,7 +456,7 @@ LogicalSort(fetch=[2])
 Calc(select=[c, rowtime AS desc])
 +- Limit(offset=[0], fetch=[2])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -476,7 +476,7 @@ LogicalSort(fetch=[2])
 Calc(select=[c, rowtime])
 +- Limit(offset=[0], fetch=[2])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -496,7 +496,7 @@ LogicalSort(offset=[2])
 Calc(select=[PROCTIME_MATERIALIZE(proctime) AS proctime, c])
 +- Limit(offset=[2], fetch=[unlimited])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -516,7 +516,7 @@ LogicalSort(offset=[2])
 Calc(select=[rowtime AS desc, c])
 +- Limit(offset=[2], fetch=[unlimited])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -536,7 +536,7 @@ LogicalSort(offset=[2])
 Calc(select=[PROCTIME_MATERIALIZE(proctime) AS desc, c])
 +- Limit(offset=[2], fetch=[unlimited])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -556,7 +556,7 @@ LogicalSort(offset=[2])
 Calc(select=[c, PROCTIME_MATERIALIZE(proctime) AS desc])
 +- Limit(offset=[2], fetch=[unlimited])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -576,7 +576,7 @@ LogicalSort(offset=[2])
 Calc(select=[c, PROCTIME_MATERIALIZE(proctime) AS proctime])
 +- Limit(offset=[2], fetch=[unlimited])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -596,7 +596,7 @@ LogicalSort(offset=[2])
 Calc(select=[rowtime, c])
 +- Limit(offset=[2], fetch=[unlimited])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -616,7 +616,7 @@ LogicalSort(offset=[2])
 Calc(select=[c, rowtime AS desc])
 +- Limit(offset=[2], fetch=[unlimited])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -636,7 +636,7 @@ LogicalSort(offset=[10])
 Calc(select=[a, c])
 +- Limit(offset=[10], fetch=[unlimited])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -656,7 +656,7 @@ LogicalSort(offset=[2])
 Calc(select=[c, rowtime])
 +- Limit(offset=[2], fetch=[unlimited])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
diff --git a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/ModifiedMonotonicityTest.xml b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/ModifiedMonotonicityTest.xml
index e56c7fb..0854b65 100644
--- a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/ModifiedMonotonicityTest.xml
+++ b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/ModifiedMonotonicityTest.xml
@@ -37,7 +37,7 @@ GlobalGroupAggregate(groupBy=[a1], select=[a1, MAX(max$0) AS EXPR$1], updateAsRe
          +- GlobalGroupAggregate(groupBy=[a1, a2], select=[a1, a2, MAX(max$0) AS a3], updateAsRetraction=[true], accMode=[AccRetract])
             +- Exchange(distribution=[hash[a1, a2]], updateAsRetraction=[true], accMode=[Acc])
                +- LocalGroupAggregate(groupBy=[a1, a2], select=[a1, a2, MAX(a3) AS max$0], updateAsRetraction=[true], accMode=[Acc])
-                  +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a1, a2, a3], updateAsRetraction=[true], accMode=[Acc])
+                  +- DataStreamScan(table=[[A]], fields=[a1, a2, a3], updateAsRetraction=[true], accMode=[Acc])
 ]]>
     </Resource>
   </TestCase>
@@ -60,7 +60,7 @@ GroupAggregate(groupBy=[a1], select=[a1, MAX(a3) AS EXPR$1], updateAsRetraction=
    +- Calc(select=[a1, a3], updateAsRetraction=[true], accMode=[AccRetract])
       +- GroupAggregate(groupBy=[a1, a2], select=[a1, a2, MAX(a3) AS a3], updateAsRetraction=[true], accMode=[AccRetract])
          +- Exchange(distribution=[hash[a1, a2]], updateAsRetraction=[true], accMode=[Acc])
-            +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a1, a2, a3], updateAsRetraction=[true], accMode=[Acc])
+            +- DataStreamScan(table=[[A]], fields=[a1, a2, a3], updateAsRetraction=[true], accMode=[Acc])
 ]]>
     </Resource>
   </TestCase>
@@ -83,7 +83,7 @@ GroupAggregate(groupBy=[a1], select=[a1, MIN_RETRACT(a3) AS EXPR$1], updateAsRet
    +- Calc(select=[a1, a3], updateAsRetraction=[true], accMode=[AccRetract])
       +- GroupAggregate(groupBy=[a1, a2], select=[a1, a2, MAX(a3) AS a3], updateAsRetraction=[true], accMode=[AccRetract])
          +- Exchange(distribution=[hash[a1, a2]], updateAsRetraction=[true], accMode=[Acc])
-            +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a1, a2, a3], updateAsRetraction=[true], accMode=[Acc])
+            +- DataStreamScan(table=[[A]], fields=[a1, a2, a3], updateAsRetraction=[true], accMode=[Acc])
 ]]>
     </Resource>
   </TestCase>
@@ -108,7 +108,7 @@ GlobalGroupAggregate(groupBy=[a1], select=[a1, MIN_RETRACT(min$0) AS EXPR$1], up
          +- GlobalGroupAggregate(groupBy=[a1, a2], select=[a1, a2, MAX(max$0) AS a3], updateAsRetraction=[true], accMode=[AccRetract])
             +- Exchange(distribution=[hash[a1, a2]], updateAsRetraction=[true], accMode=[Acc])
                +- LocalGroupAggregate(groupBy=[a1, a2], select=[a1, a2, MAX(a3) AS max$0], updateAsRetraction=[true], accMode=[Acc])
-                  +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a1, a2, a3], updateAsRetraction=[true], accMode=[Acc])
+                  +- DataStreamScan(table=[[A]], fields=[a1, a2, a3], updateAsRetraction=[true], accMode=[Acc])
 ]]>
     </Resource>
   </TestCase>
@@ -133,7 +133,7 @@ GlobalGroupAggregate(select=[MIN(min$0) AS EXPR$0], updateAsRetraction=[false],
          +- GlobalGroupAggregate(groupBy=[a1, a2], select=[a1, a2, MIN(min$0) AS a3], updateAsRetraction=[true], accMode=[AccRetract])
             +- Exchange(distribution=[hash[a1, a2]], updateAsRetraction=[true], accMode=[Acc])
                +- LocalGroupAggregate(groupBy=[a1, a2], select=[a1, a2, MIN(a3) AS min$0], updateAsRetraction=[true], accMode=[Acc])
-                  +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a1, a2, a3], updateAsRetraction=[true], accMode=[Acc])
+                  +- DataStreamScan(table=[[A]], fields=[a1, a2, a3], updateAsRetraction=[true], accMode=[Acc])
 ]]>
     </Resource>
   </TestCase>
@@ -156,7 +156,7 @@ GroupAggregate(groupBy=[a1], select=[a1, MIN(a3) AS EXPR$1], updateAsRetraction=
    +- Calc(select=[a1, a3], updateAsRetraction=[true], accMode=[AccRetract])
       +- GroupAggregate(groupBy=[a1, a2], select=[a1, a2, MIN(a3) AS a3], updateAsRetraction=[true], accMode=[AccRetract])
          +- Exchange(distribution=[hash[a1, a2]], updateAsRetraction=[true], accMode=[Acc])
-            +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a1, a2, a3], updateAsRetraction=[true], accMode=[Acc])
+            +- DataStreamScan(table=[[A]], fields=[a1, a2, a3], updateAsRetraction=[true], accMode=[Acc])
 ]]>
     </Resource>
   </TestCase>
diff --git a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/RankTest.xml b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/RankTest.xml
index 215339f..46f5932 100644
--- a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/RankTest.xml
+++ b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/RankTest.xml
@@ -64,7 +64,7 @@ Calc(select=[a, b, count_c, w0$o0], updateAsRetraction=[false], accMode=[Acc])
                +- GroupAggregate(groupBy=[a, b, cn], select=[a, b, cn, COUNT(*) AS count_c], updateAsRetraction=[false], accMode=[Acc])
                   +- Exchange(distribution=[hash[a, b, cn]], updateAsRetraction=[true], accMode=[Acc])
                      +- Calc(select=[a, b, _UTF-16LE'cn' AS cn], updateAsRetraction=[true], accMode=[Acc])
-                        +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime], updateAsRetraction=[true], accMode=[Acc])
+                        +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime], updateAsRetraction=[true], accMode=[Acc])
 ]]>
     </Resource>
   </TestCase>
@@ -93,7 +93,7 @@ Calc(select=[a, b, c, 1:BIGINT AS w0$o0])
 +- Rank(strategy=[AppendFastStrategy], rankType=[ROW_NUMBER], rankRange=[rankStart=1, rankEnd=1], partitionBy=[a], orderBy=[b DESC], select=[a, b, c])
    +- Exchange(distribution=[hash[a]])
       +- Calc(select=[a, b, c])
-         +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+         +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -119,7 +119,7 @@ Calc(select=[a, rk, b, c])
 +- Rank(strategy=[AppendFastStrategy], rankType=[RANK], rankRange=[rankStart=1, rankEnd=9], partitionBy=[a], orderBy=[a ASC], select=[a, b, c, rk])
    +- Exchange(distribution=[hash[a]])
       +- Calc(select=[a, b, c])
-         +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+         +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -148,7 +148,7 @@ Calc(select=[a, b, c])
 +- Rank(strategy=[AppendFastStrategy], rankType=[RANK], rankRange=[rankStart=1, rankEnd=1], partitionBy=[a], orderBy=[proctime ASC], select=[a, b, c, proctime])
    +- Exchange(distribution=[hash[a]])
       +- Calc(select=[a, b, c, proctime])
-         +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+         +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -177,7 +177,7 @@ Calc(select=[a, b, c])
 +- Rank(strategy=[AppendFastStrategy], rankType=[RANK], rankRange=[rankStart=1, rankEnd=1], partitionBy=[a], orderBy=[proctime DESC], select=[a, b, c, proctime])
    +- Exchange(distribution=[hash[a]])
       +- Calc(select=[a, b, c, proctime])
-         +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+         +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -206,7 +206,7 @@ Calc(select=[a, b, c])
 +- Deduplicate(keepLastRow=[false], key=[a], order=[PROCTIME])
    +- Exchange(distribution=[hash[a]])
       +- Calc(select=[a, b, c, proctime])
-         +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+         +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -235,7 +235,7 @@ Calc(select=[a, b, c])
 +- Deduplicate(keepLastRow=[true], key=[a], order=[PROCTIME])
    +- Exchange(distribution=[hash[a]])
       +- Calc(select=[a, b, c, proctime])
-         +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+         +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -264,7 +264,7 @@ Calc(select=[a, b, c])
 +- Rank(strategy=[AppendFastStrategy], rankType=[ROW_NUMBER], rankRange=[rankStart=1, rankEnd=1], partitionBy=[a], orderBy=[rowtime ASC], select=[a, b, c, rowtime])
    +- Exchange(distribution=[hash[a]])
       +- Calc(select=[a, b, c, rowtime])
-         +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+         +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -293,7 +293,7 @@ Calc(select=[a, b, c])
 +- Rank(strategy=[AppendFastStrategy], rankType=[ROW_NUMBER], rankRange=[rankStart=1, rankEnd=1], partitionBy=[a], orderBy=[rowtime DESC], select=[a, b, c, rowtime])
    +- Exchange(distribution=[hash[a]])
       +- Calc(select=[a, b, c, rowtime])
-         +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+         +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -321,7 +321,7 @@ LogicalProject(a=[$0], b=[$1], c=[$2], row_num=[$3])
 Rank(strategy=[AppendFastStrategy], rankType=[ROW_NUMBER], rankRange=[rankStart=1, rankEnd=10], partitionBy=[a], orderBy=[b DESC], select=[a, b, c, w0$o0], updateAsRetraction=[false], accMode=[Acc])
 +- Exchange(distribution=[hash[a]], updateAsRetraction=[false], accMode=[Acc])
    +- Calc(select=[a, b, c], updateAsRetraction=[false], accMode=[Acc])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime], updateAsRetraction=[false], accMode=[Acc])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime], updateAsRetraction=[false], accMode=[Acc])
 ]]>
     </Resource>
   </TestCase>
@@ -349,7 +349,7 @@ LogicalProject(a=[$0], b=[$1], c=[$2], row_num=[$3])
 Rank(strategy=[AppendFastStrategy], rankType=[ROW_NUMBER], rankRange=[rankStart=1, rankEnd=10], partitionBy=[a], orderBy=[b DESC], select=[a, b, c, w0$o0], updateAsRetraction=[false], accMode=[Acc])
 +- Exchange(distribution=[hash[a]], updateAsRetraction=[false], accMode=[Acc])
    +- Calc(select=[a, b, c], updateAsRetraction=[false], accMode=[Acc])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime], updateAsRetraction=[false], accMode=[Acc])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime], updateAsRetraction=[false], accMode=[Acc])
 ]]>
     </Resource>
   </TestCase>
@@ -385,7 +385,7 @@ Rank(strategy=[UpdateFastStrategy[0,1]], rankType=[ROW_NUMBER], rankRange=[rankS
    +- GroupAggregate(groupBy=[a, b], select=[a, b, COUNT(*) AS count_c], updateAsRetraction=[false], accMode=[Acc])
       +- Exchange(distribution=[hash[a, b]], updateAsRetraction=[true], accMode=[Acc])
          +- Calc(select=[a, b], updateAsRetraction=[true], accMode=[Acc])
-            +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime], updateAsRetraction=[true], accMode=[Acc])
+            +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime], updateAsRetraction=[true], accMode=[Acc])
 ]]>
     </Resource>
   </TestCase>
@@ -421,7 +421,7 @@ Rank(strategy=[RetractStrategy], rankType=[ROW_NUMBER], rankRange=[rankStart=1,
    +- GroupAggregate(groupBy=[a, b], select=[a, b, SUM(c) AS sum_c], updateAsRetraction=[true], accMode=[AccRetract])
       +- Exchange(distribution=[hash[a, b]], updateAsRetraction=[true], accMode=[Acc])
          +- Calc(select=[a, b, c], updateAsRetraction=[true], accMode=[Acc])
-            +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime], updateAsRetraction=[true], accMode=[Acc])
+            +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime], updateAsRetraction=[true], accMode=[Acc])
 ]]>
     </Resource>
   </TestCase>
@@ -525,7 +525,7 @@ GroupAggregate(select=[MAX_RETRACT(a) AS EXPR$0], updateAsRetraction=[false], ac
             +- GroupAggregate(groupBy=[a, b], select=[a, b, COUNT(*) AS count_c], updateAsRetraction=[false], accMode=[Acc])
                +- Exchange(distribution=[hash[a, b]], updateAsRetraction=[true], accMode=[Acc])
                   +- Calc(select=[a, b], updateAsRetraction=[true], accMode=[Acc])
-                     +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime], updateAsRetraction=[true], accMode=[Acc])
+                     +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime], updateAsRetraction=[true], accMode=[Acc])
 ]]>
     </Resource>
   </TestCase>
@@ -561,7 +561,7 @@ Rank(strategy=[UpdateFastStrategy[0,1]], rankType=[ROW_NUMBER], rankRange=[rankS
    +- GroupAggregate(groupBy=[a, b], select=[a, b, INCR_SUM(c) AS sum_c], updateAsRetraction=[false], accMode=[Acc])
       +- Exchange(distribution=[hash[a, b]], updateAsRetraction=[true], accMode=[Acc])
          +- Calc(select=[a, b, c], updateAsRetraction=[true], accMode=[Acc])
-            +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime], updateAsRetraction=[true], accMode=[Acc])
+            +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime], updateAsRetraction=[true], accMode=[Acc])
 ]]>
     </Resource>
   </TestCase>
@@ -597,7 +597,7 @@ Rank(strategy=[UpdateFastStrategy[0,1]], rankType=[ROW_NUMBER], rankRange=[rankS
    +- GroupAggregate(groupBy=[a, b], select=[a, b, SUM($f2) AS sum_c])
       +- Exchange(distribution=[hash[a, b]])
          +- Calc(select=[a, b, CASE(>(c, 10), 1, <(c, 0), 0, null:INTEGER) AS $f2])
-            +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+            +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -635,7 +635,7 @@ Rank(strategy=[UpdateFastStrategy[0,1]], rankType=[ROW_NUMBER], rankRange=[rankS
    +- GroupAggregate(groupBy=[a, b], select=[a, b, SUM(c) AS sum_c], updateAsRetraction=[false], accMode=[Acc])
       +- Exchange(distribution=[hash[a, b]], updateAsRetraction=[true], accMode=[Acc])
          +- Calc(select=[a, b, c], where=[>=(c, 0)], updateAsRetraction=[true], accMode=[Acc])
-            +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime], updateAsRetraction=[true], accMode=[Acc])
+            +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime], updateAsRetraction=[true], accMode=[Acc])
 ]]>
     </Resource>
   </TestCase>
@@ -671,7 +671,7 @@ Rank(strategy=[UpdateFastStrategy[0,1]], rankType=[ROW_NUMBER], rankRange=[rankS
    +- GroupAggregate(groupBy=[a, b], select=[a, b, SUM(c) FILTER $f3 AS sum_c])
       +- Exchange(distribution=[hash[a, b]])
          +- Calc(select=[a, b, c, IS TRUE(AND(>=(c, 0), <(a, 0))) AS $f3])
-            +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+            +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -707,7 +707,7 @@ Rank(strategy=[UpdateFastStrategy[0,1]], rankType=[ROW_NUMBER], rankRange=[rankS
    +- GroupAggregate(groupBy=[a, b], select=[a, b, SUM(c) FILTER $f3 AS sum_c])
       +- Exchange(distribution=[hash[a, b]])
          +- Calc(select=[a, b, c, IS TRUE(AND(<=(c, 0), <(a, 0))) AS $f3])
-            +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+            +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -743,7 +743,7 @@ Rank(strategy=[RetractStrategy], rankType=[ROW_NUMBER], rankRange=[rankStart=1,
    +- GroupAggregate(groupBy=[a, b], select=[a, b, SUM($f2) AS sum_c])
       +- Exchange(distribution=[hash[a, b]])
          +- Calc(select=[a, b, IF(>(c, 10), 1, 0) AS $f2])
-            +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+            +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -772,7 +772,7 @@ Calc(select=[a, b, c, 10:BIGINT AS row_num], updateAsRetraction=[false], accMode
 +- Rank(strategy=[AppendFastStrategy], rankType=[ROW_NUMBER], rankRange=[rankStart=10, rankEnd=10], partitionBy=[a], orderBy=[b DESC], select=[a, b, c], updateAsRetraction=[false], accMode=[Acc])
    +- Exchange(distribution=[hash[a]], updateAsRetraction=[false], accMode=[Acc])
       +- Calc(select=[a, b, c], updateAsRetraction=[false], accMode=[Acc])
-         +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime], updateAsRetraction=[false], accMode=[Acc])
+         +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime], updateAsRetraction=[false], accMode=[Acc])
 ]]>
     </Resource>
   </TestCase>
@@ -812,7 +812,7 @@ Calc(select=[a, b, count_c, w0$o0], updateAsRetraction=[false], accMode=[Acc])
       +- GroupAggregate(groupBy=[a, b, cn], select=[a, b, cn, COUNT(*) AS count_c], updateAsRetraction=[false], accMode=[Acc])
          +- Exchange(distribution=[hash[a, b, cn]], updateAsRetraction=[true], accMode=[Acc])
             +- Calc(select=[a, b, _UTF-16LE'cn' AS cn], updateAsRetraction=[true], accMode=[Acc])
-               +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime], updateAsRetraction=[true], accMode=[Acc])
+               +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime], updateAsRetraction=[true], accMode=[Acc])
 ]]>
     </Resource>
   </TestCase>
@@ -848,7 +848,7 @@ Rank(strategy=[RetractStrategy], rankType=[ROW_NUMBER], rankRange=[rankStart=1,
    +- GroupAggregate(groupBy=[a], select=[a, LAST_VALUE(b) AS b, SUM(c) AS sum_c], updateAsRetraction=[true], accMode=[AccRetract])
       +- Exchange(distribution=[hash[a]], updateAsRetraction=[true], accMode=[Acc])
          +- Calc(select=[a, b, c], updateAsRetraction=[true], accMode=[Acc])
-            +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime], updateAsRetraction=[true], accMode=[Acc])
+            +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime], updateAsRetraction=[true], accMode=[Acc])
 ]]>
     </Resource>
   </TestCase>
@@ -879,7 +879,7 @@ Calc(select=[row_num, a, c], where=[IS NOT NULL(b)], updateAsRetraction=[false],
 +- Rank(strategy=[AppendFastStrategy], rankType=[ROW_NUMBER], rankRange=[rankStart=1, rankEnd=10], partitionBy=[a], orderBy=[b DESC], select=[a, b, c, row_num], updateAsRetraction=[false], accMode=[Acc])
    +- Exchange(distribution=[hash[a]], updateAsRetraction=[false], accMode=[Acc])
       +- Calc(select=[a, b, c], where=[>(c, 1000)], updateAsRetraction=[false], accMode=[Acc])
-         +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime], updateAsRetraction=[false], accMode=[Acc])
+         +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime], updateAsRetraction=[false], accMode=[Acc])
 ]]>
     </Resource>
   </TestCase>
diff --git a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/RelTimeIndicatorConverterTest.xml b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/RelTimeIndicatorConverterTest.xml
index ad32672..5ed43c8 100644
--- a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/RelTimeIndicatorConverterTest.xml
+++ b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/RelTimeIndicatorConverterTest.xml
@@ -34,7 +34,7 @@ Calc(select=[EXPR$0])
 +- GroupAggregate(groupBy=[long], select=[long, MIN(proctime) AS EXPR$0])
    +- Exchange(distribution=[hash[long]])
       +- Calc(select=[long, PROCTIME_MATERIALIZE(proctime) AS proctime])
-         +- DataStreamScan(table=[[_DataStreamTable_2]], fields=[long, int, proctime])
+         +- DataStreamScan(table=[[MyTable2]], fields=[long, int, proctime])
 ]]>
     </Resource>
   </TestCase>
@@ -56,7 +56,7 @@ Calc(select=[EXPR$0])
 +- GroupAggregate(groupBy=[long], select=[long, MIN(rowtime) AS EXPR$0])
    +- Exchange(distribution=[hash[long]])
       +- Calc(select=[long, CAST(rowtime) AS rowtime])
-         +- DataStreamScan(table=[[_DataStreamTable_1]], fields=[rowtime, long, int])
+         +- DataStreamScan(table=[[MyTable1]], fields=[rowtime, long, int])
 ]]>
     </Resource>
   </TestCase>
@@ -74,7 +74,7 @@ LogicalProject(rowtime=[$0])
     <Resource name="planAfter">
       <![CDATA[
 Calc(select=[rowtime], where=[>(CAST(rowtime), 1990-12-02 12:11:11:TIMESTAMP(3))])
-+- DataStreamScan(table=[[_DataStreamTable_1]], fields=[rowtime, long, int])
++- DataStreamScan(table=[[MyTable1]], fields=[rowtime, long, int])
 ]]>
     </Resource>
   </TestCase>
@@ -96,7 +96,7 @@ Calc(select=[EXPR$0])
 +- GroupAggregate(groupBy=[proctime], select=[proctime, COUNT(long) AS EXPR$0])
    +- Exchange(distribution=[hash[proctime]])
       +- Calc(select=[PROCTIME_MATERIALIZE(proctime) AS proctime, long])
-         +- DataStreamScan(table=[[_DataStreamTable_2]], fields=[long, int, proctime])
+         +- DataStreamScan(table=[[MyTable2]], fields=[long, int, proctime])
 ]]>
     </Resource>
   </TestCase>
@@ -118,7 +118,7 @@ Calc(select=[EXPR$0])
 +- GroupAggregate(groupBy=[rowtime], select=[rowtime, COUNT(long) AS EXPR$0])
    +- Exchange(distribution=[hash[rowtime]])
       +- Calc(select=[CAST(rowtime) AS rowtime, long])
-         +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[rowtime, long, int, proctime])
+         +- DataStreamScan(table=[[MyTable]], fields=[rowtime, long, int, proctime])
 ]]>
     </Resource>
   </TestCase>
@@ -153,7 +153,7 @@ Calc(select=[CAST(w$end) AS EXPR$0, long, EXPR$2])
       +- Calc(select=[w$rowtime AS $f0, long, int])
          +- GroupWindowAggregate(groupBy=[long], window=[TumblingGroupWindow], properties=[w$start, w$end, w$rowtime, w$proctime], select=[long, SUM(int) AS int, start('w$) AS w$start, end('w$) AS w$end, rowtime('w$) AS w$rowtime, proctime('w$) AS w$proctime])
             +- Exchange(distribution=[hash[long]])
-               +- DataStreamScan(table=[[_DataStreamTable_1]], fields=[rowtime, long, int])
+               +- DataStreamScan(table=[[MyTable1]], fields=[rowtime, long, int])
 ]]>
     </Resource>
   </TestCase>
@@ -170,7 +170,7 @@ LogicalProject(rowtime=[$0], long=[$1], int=[$2], proctime=[$3])
     <Resource name="planAfter">
       <![CDATA[
 Calc(select=[rowtime, long, int, PROCTIME_MATERIALIZE(proctime) AS proctime])
-+- DataStreamScan(table=[[_DataStreamTable_0]], fields=[rowtime, long, int, proctime])
++- DataStreamScan(table=[[MyTable]], fields=[rowtime, long, int, proctime])
 ]]>
     </Resource>
   </TestCase>
@@ -191,7 +191,7 @@ LogicalProject(rowtime=[FLOOR($0, FLAG(DAY))])
     <Resource name="planAfter">
       <![CDATA[
 Calc(select=[FLOOR(CAST(rowtime), FLAG(DAY)) AS rowtime], where=[>(long, 0)])
-+- DataStreamScan(table=[[_DataStreamTable_0]], fields=[rowtime, long, int, proctime])
++- DataStreamScan(table=[[MyTable]], fields=[rowtime, long, int, proctime])
 ]]>
     </Resource>
   </TestCase>
@@ -214,7 +214,7 @@ LogicalProject(rowtime=[$0], proctime=[$3], s=[$4])
       <![CDATA[
 Calc(select=[rowtime, PROCTIME_MATERIALIZE(proctime) AS proctime, f0 AS s])
 +- Correlate(invocation=[tableFunc(CAST($cor0.rowtime):TIMESTAMP(3) NOT NULL, PROCTIME_MATERIALIZE($cor0.proctime), _UTF-16LE'')], correlate=[table(tableFunc(CAST($cor0.rowtime),PROCTIME_MATERIALIZE($cor0.proctime),_UTF-16LE''))], select=[rowtime,long,int,proctime,f0], rowType=[RecordType(TIME ATTRIBUTE(ROWTIME) rowtime, BIGINT long, INTEGER int, TIME ATTRIBUTE(PROCTIME) proctime, VARCHAR(2147483647) f0)], joinType=[INNER])
-   +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[rowtime, long, int, proctime])
+   +- DataStreamScan(table=[[MyTable]], fields=[rowtime, long, int, proctime])
 ]]>
     </Resource>
   </TestCase>
@@ -239,7 +239,7 @@ Calc(select=[EXPR$0, long])
 +- GroupWindowAggregate(groupBy=[long], window=[TumblingGroupWindow], select=[long, MIN(rowtime0) AS EXPR$0])
    +- Exchange(distribution=[hash[long]])
       +- Calc(select=[long, rowtime, CAST(rowtime) AS rowtime0])
-         +- DataStreamScan(table=[[_DataStreamTable_1]], fields=[rowtime, long, int])
+         +- DataStreamScan(table=[[MyTable1]], fields=[rowtime, long, int])
 ]]>
     </Resource>
   </TestCase>
@@ -260,7 +260,7 @@ LogicalUnion(all=[true])
       <![CDATA[
 Union(all=[true], union=[rowtime])
 :- Calc(select=[rowtime], reuse_id=[1])
-:  +- DataStreamScan(table=[[_DataStreamTable_1]], fields=[rowtime, long, int])
+:  +- DataStreamScan(table=[[MyTable1]], fields=[rowtime, long, int])
 +- Reused(reference_id=[1])
 ]]>
     </Resource>
@@ -288,7 +288,7 @@ LogicalProject(EXPR$0=[TUMBLE_END($0)], long=[$1], EXPR$2=[$2])
 Calc(select=[CAST(w$end) AS EXPR$0, long, EXPR$2])
 +- GroupWindowAggregate(groupBy=[long], window=[TumblingGroupWindow], properties=[w$start, w$end, w$rowtime, w$proctime], select=[long, SUM(int) AS EXPR$2, start('w$) AS w$start, end('w$) AS w$end, rowtime('w$) AS w$rowtime, proctime('w$) AS w$proctime])
    +- Exchange(distribution=[hash[long]])
-      +- DataStreamScan(table=[[_DataStreamTable_1]], fields=[rowtime, long, int])
+      +- DataStreamScan(table=[[MyTable1]], fields=[rowtime, long, int])
 ]]>
     </Resource>
   </TestCase>
@@ -315,7 +315,7 @@ Calc(select=[EXPR$0, long], where=[=(EXTRACT(FLAG(QUARTER), CAST(w$end)), 1:BIGI
 +- GroupWindowAggregate(groupBy=[long], window=[TumblingGroupWindow], properties=[w$start, w$end, w$rowtime, w$proctime], select=[long, MIN(rowtime0) AS EXPR$0, start('w$) AS w$start, end('w$) AS w$end, rowtime('w$) AS w$rowtime, proctime('w$) AS w$proctime])
    +- Exchange(distribution=[hash[long]])
       +- Calc(select=[long, rowtime, CAST(rowtime) AS rowtime0])
-         +- DataStreamScan(table=[[_DataStreamTable_1]], fields=[rowtime, long, int])
+         +- DataStreamScan(table=[[MyTable1]], fields=[rowtime, long, int])
 ]]>
     </Resource>
   </TestCase>
@@ -343,7 +343,7 @@ LogicalProject(rowtime=[TUMBLE_END($1)], long=[$0], EXPR$2=[$2])
 Calc(select=[CAST(w$end) AS rowtime, long, EXPR$2])
 +- GroupWindowAggregate(groupBy=[long], window=[TumblingGroupWindow], properties=[w$start, w$end, w$rowtime, w$proctime], select=[long, SUM(int) AS EXPR$2, start('w$) AS w$start, end('w$) AS w$end, rowtime('w$) AS w$rowtime, proctime('w$) AS w$proctime])
    +- Exchange(distribution=[hash[long]])
-      +- DataStreamScan(table=[[_DataStreamTable_1]], fields=[rowtime, long, int])
+      +- DataStreamScan(table=[[MyTable1]], fields=[rowtime, long, int])
 ]]>
     </Resource>
   </TestCase>
diff --git a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/SinkTest.xml b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/SinkTest.xml
index fd7b949..5a06bba 100644
--- a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/SinkTest.xml
+++ b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/SinkTest.xml
@@ -33,7 +33,7 @@ Sink(fields=[a], updateAsRetraction=[false], accMode=[Acc])
    +- GroupAggregate(groupBy=[a], select=[a, COUNT(*) AS cnt], updateAsRetraction=[false], accMode=[Acc])
       +- Exchange(distribution=[hash[a]], updateAsRetraction=[true], accMode=[Acc])
          +- Calc(select=[a], updateAsRetraction=[true], accMode=[Acc])
-            +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c], updateAsRetraction=[true], accMode=[Acc])
+            +- DataStreamScan(table=[[MyTable]], fields=[a, b, c], updateAsRetraction=[true], accMode=[Acc])
 ]]>
     </Resource>
   </TestCase>
@@ -46,14 +46,14 @@ LogicalSink(fields=[b, cnt])
       +- LogicalFilter(condition=[<($0, 4)])
          +- LogicalAggregate(group=[{0}], cnt=[COUNT($1)])
             +- LogicalProject(b=[$1], a=[$0])
-               +- LogicalTableScan(table=[[_DataStreamTable_0]])
+               +- LogicalTableScan(table=[[MyTable]])
 
 LogicalSink(fields=[b, cnt])
 +- LogicalProject(b=[$0], cnt=[$1])
    +- LogicalFilter(condition=[AND(>=($0, 4), <($0, 6))])
       +- LogicalAggregate(group=[{0}], cnt=[COUNT($1)])
          +- LogicalProject(b=[$1], a=[$0])
-            +- LogicalTableScan(table=[[_DataStreamTable_0]])
+            +- LogicalTableScan(table=[[MyTable]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -61,7 +61,7 @@ LogicalSink(fields=[b, cnt])
 GroupAggregate(groupBy=[b], select=[b, COUNT(a) AS cnt], updateAsRetraction=[true], accMode=[AccRetract], reuse_id=[1])
 +- Exchange(distribution=[hash[b]], updateAsRetraction=[true], accMode=[Acc])
    +- Calc(select=[b, a], updateAsRetraction=[true], accMode=[Acc])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c], updateAsRetraction=[true], accMode=[Acc])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c], updateAsRetraction=[true], accMode=[Acc])
 
 Sink(fields=[b, cnt], updateAsRetraction=[false], accMode=[Acc])
 +- GroupAggregate(groupBy=[cnt], select=[cnt, COUNT_RETRACT(b) AS frequency], updateAsRetraction=[false], accMode=[Acc])
@@ -81,9 +81,9 @@ Sink(fields=[b, cnt], updateAsRetraction=[false], accMode=[AccRetract])
 LogicalSink(fields=[a, b])
 +- LogicalUnion(all=[true])
    :- LogicalProject(a=[$0], b=[$1])
-   :  +- LogicalTableScan(table=[[_DataStreamTable_0]])
+   :  +- LogicalTableScan(table=[[MyTable]])
    +- LogicalProject(d=[$0], e=[$1])
-      +- LogicalTableScan(table=[[_DataStreamTable_1]])
+      +- LogicalTableScan(table=[[MyTable2]])
 
 LogicalSink(fields=[total_sum])
 +- LogicalAggregate(group=[{}], total_sum=[SUM($0)])
@@ -92,11 +92,11 @@ LogicalSink(fields=[total_sum])
          :- LogicalProject(a=[$0], b=[$1])
          :  +- LogicalUnion(all=[true])
          :     :- LogicalProject(a=[$0], b=[$1])
-         :     :  +- LogicalTableScan(table=[[_DataStreamTable_0]])
+         :     :  +- LogicalTableScan(table=[[MyTable]])
          :     +- LogicalProject(d=[$0], e=[$1])
-         :        +- LogicalTableScan(table=[[_DataStreamTable_1]])
+         :        +- LogicalTableScan(table=[[MyTable2]])
          +- LogicalProject(i=[$0], j=[$1])
-            +- LogicalTableScan(table=[[_DataStreamTable_2]])
+            +- LogicalTableScan(table=[[MyTable3]])
 
 LogicalSink(fields=[total_min])
 +- LogicalAggregate(group=[{}], total_min=[MIN($0)])
@@ -105,20 +105,20 @@ LogicalSink(fields=[total_min])
          :- LogicalProject(a=[$0], b=[$1])
          :  +- LogicalUnion(all=[true])
          :     :- LogicalProject(a=[$0], b=[$1])
-         :     :  +- LogicalTableScan(table=[[_DataStreamTable_0]])
+         :     :  +- LogicalTableScan(table=[[MyTable]])
          :     +- LogicalProject(d=[$0], e=[$1])
-         :        +- LogicalTableScan(table=[[_DataStreamTable_1]])
+         :        +- LogicalTableScan(table=[[MyTable2]])
          +- LogicalProject(i=[$0], j=[$1])
-            +- LogicalTableScan(table=[[_DataStreamTable_2]])
+            +- LogicalTableScan(table=[[MyTable3]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
 Union(all=[true], union=[a, b], updateAsRetraction=[true], accMode=[Acc], reuse_id=[1])
 :- Calc(select=[a, b], updateAsRetraction=[true], accMode=[Acc])
-:  +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c], updateAsRetraction=[true], accMode=[Acc])
+:  +- DataStreamScan(table=[[MyTable]], fields=[a, b, c], updateAsRetraction=[true], accMode=[Acc])
 +- Calc(select=[d, e], updateAsRetraction=[true], accMode=[Acc])
-   +- DataStreamScan(table=[[_DataStreamTable_1]], fields=[d, e, f], updateAsRetraction=[true], accMode=[Acc])
+   +- DataStreamScan(table=[[MyTable2]], fields=[d, e, f], updateAsRetraction=[true], accMode=[Acc])
 
 Sink(fields=[a, b], updateAsRetraction=[false], accMode=[Acc])
 +- Reused(reference_id=[1])
@@ -128,7 +128,7 @@ Exchange(distribution=[single], updateAsRetraction=[true], accMode=[Acc], reuse_
    +- Union(all=[true], union=[a, b], updateAsRetraction=[true], accMode=[Acc])
       :- Reused(reference_id=[1])
       +- Calc(select=[i, j], updateAsRetraction=[true], accMode=[Acc])
-         +- DataStreamScan(table=[[_DataStreamTable_2]], fields=[i, j, k], updateAsRetraction=[true], accMode=[Acc])
+         +- DataStreamScan(table=[[MyTable3]], fields=[i, j, k], updateAsRetraction=[true], accMode=[Acc])
 
 Sink(fields=[total_sum], updateAsRetraction=[true], accMode=[AccRetract])
 +- GroupAggregate(select=[SUM(a) AS total_sum], updateAsRetraction=[true], accMode=[AccRetract])
@@ -148,14 +148,14 @@ LogicalSink(fields=[b, cnt])
    +- LogicalFilter(condition=[<($0, 4)])
       +- LogicalAggregate(group=[{0}], cnt=[COUNT($1)])
          +- LogicalProject(b=[$1], a=[$0])
-            +- LogicalTableScan(table=[[_DataStreamTable_0]])
+            +- LogicalTableScan(table=[[MyTable]])
 
 LogicalSink(fields=[b, cnt])
 +- LogicalProject(b=[$0], cnt=[$1])
    +- LogicalFilter(condition=[AND(>=($0, 4), <($0, 6))])
       +- LogicalAggregate(group=[{0}], cnt=[COUNT($1)])
          +- LogicalProject(b=[$1], a=[$0])
-            +- LogicalTableScan(table=[[_DataStreamTable_0]])
+            +- LogicalTableScan(table=[[MyTable]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -163,7 +163,7 @@ LogicalSink(fields=[b, cnt])
 GroupAggregate(groupBy=[b], select=[b, COUNT(a) AS cnt], updateAsRetraction=[true], accMode=[AccRetract], reuse_id=[1])
 +- Exchange(distribution=[hash[b]], updateAsRetraction=[true], accMode=[Acc])
    +- Calc(select=[b, a], updateAsRetraction=[true], accMode=[Acc])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c], updateAsRetraction=[true], accMode=[Acc])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c], updateAsRetraction=[true], accMode=[Acc])
 
 Sink(fields=[b, cnt], updateAsRetraction=[true], accMode=[AccRetract])
 +- Calc(select=[b, cnt], where=[<(b, 4)], updateAsRetraction=[true], accMode=[AccRetract])
@@ -190,7 +190,7 @@ Sink(fields=[a, cnt], updateAsRetraction=[true], accMode=[AccRetract])
 +- GroupAggregate(groupBy=[a], select=[a, COUNT(*) AS cnt], updateAsRetraction=[true], accMode=[AccRetract])
    +- Exchange(distribution=[hash[a]], updateAsRetraction=[true], accMode=[Acc])
       +- Calc(select=[a], updateAsRetraction=[true], accMode=[Acc])
-         +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c], updateAsRetraction=[true], accMode=[Acc])
+         +- DataStreamScan(table=[[MyTable]], fields=[a, b, c], updateAsRetraction=[true], accMode=[Acc])
 ]]>
     </Resource>
   </TestCase>
@@ -213,7 +213,7 @@ Sink(fields=[cnt, a], updateAsRetraction=[true], accMode=[AccRetract])
       +- GroupAggregate(groupBy=[a], select=[a, COUNT(*) AS cnt], updateAsRetraction=[true], accMode=[AccRetract])
          +- Exchange(distribution=[hash[a]], updateAsRetraction=[true], accMode=[Acc])
             +- Calc(select=[a], updateAsRetraction=[true], accMode=[Acc])
-               +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c], updateAsRetraction=[true], accMode=[Acc])
+               +- DataStreamScan(table=[[MyTable]], fields=[a, b, c], updateAsRetraction=[true], accMode=[Acc])
 ]]>
     </Resource>
   </TestCase>
@@ -232,7 +232,7 @@ Sink(fields=[a, cnt], updateAsRetraction=[false], accMode=[Acc])
 +- GroupAggregate(groupBy=[a], select=[a, COUNT(*) AS cnt], updateAsRetraction=[false], accMode=[Acc])
    +- Exchange(distribution=[hash[a]], updateAsRetraction=[true], accMode=[Acc])
       +- Calc(select=[a], updateAsRetraction=[true], accMode=[Acc])
-         +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c], updateAsRetraction=[true], accMode=[Acc])
+         +- DataStreamScan(table=[[MyTable]], fields=[a, b, c], updateAsRetraction=[true], accMode=[Acc])
 ]]>
     </Resource>
   </TestCase>
@@ -268,7 +268,7 @@ Sink(fields=[a1, b, c1], updateAsRetraction=[false], accMode=[Acc])
    +- Join(joinType=[InnerJoin], where=[=(a1, a3)], select=[a3, c1, a1, b, c2], leftInputSpec=[NoUniqueKey], rightInputSpec=[NoUniqueKey], updateAsRetraction=[false], accMode=[Acc])
       :- Exchange(distribution=[hash[a3]], updateAsRetraction=[true], accMode=[Acc])
       :  +- Calc(select=[a AS a3, c AS c1], where=[AND(>=(a, 0), <(b, 5))], updateAsRetraction=[true], accMode=[Acc])
-      :     +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c], updateAsRetraction=[true], accMode=[Acc], reuse_id=[1])
+      :     +- DataStreamScan(table=[[MyTable]], fields=[a, b, c], updateAsRetraction=[true], accMode=[Acc], reuse_id=[1])
       +- Exchange(distribution=[hash[a1]], updateAsRetraction=[true], accMode=[Acc])
          +- Calc(select=[a1, b, c AS c2], updateAsRetraction=[true], accMode=[Acc])
             +- Join(joinType=[InnerJoin], where=[=(a1, a2)], select=[a1, b, a2, c], leftInputSpec=[NoUniqueKey], rightInputSpec=[NoUniqueKey], updateAsRetraction=[true], accMode=[Acc])
diff --git a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/SortLimitTest.xml b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/SortLimitTest.xml
index 256ca26..e7f3b51 100644
--- a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/SortLimitTest.xml
+++ b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/SortLimitTest.xml
@@ -32,7 +32,7 @@ LogicalSort(sort0=[$0], sort1=[$1], dir0=[ASC-nulls-first], dir1=[DESC-nulls-las
 Calc(select=[a, b, c, PROCTIME_MATERIALIZE(proctime) AS proctime, rowtime], updateAsRetraction=[false], accMode=[Acc])
 +- SortLimit(orderBy=[a ASC, b DESC], offset=[0], fetch=[10], updateAsRetraction=[false], accMode=[Acc])
    +- Exchange(distribution=[single], updateAsRetraction=[false], accMode=[Acc])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime], updateAsRetraction=[false], accMode=[Acc])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime], updateAsRetraction=[false], accMode=[Acc])
 ]]>
     </Resource>
   </TestCase>
@@ -52,7 +52,7 @@ LogicalSort(sort0=[$0], sort1=[$1], dir0=[ASC-nulls-first], dir1=[DESC-nulls-las
 Calc(select=[a, b, c, PROCTIME_MATERIALIZE(proctime) AS proctime, rowtime], updateAsRetraction=[false], accMode=[Acc])
 +- SortLimit(orderBy=[a ASC, b DESC], offset=[0], fetch=[10], updateAsRetraction=[false], accMode=[Acc])
    +- Exchange(distribution=[single], updateAsRetraction=[false], accMode=[Acc])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime], updateAsRetraction=[false], accMode=[Acc])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime], updateAsRetraction=[false], accMode=[Acc])
 ]]>
     </Resource>
   </TestCase>
@@ -73,7 +73,7 @@ LogicalProject(a=[$0])
 Calc(select=[a])
 +- SortLimit(orderBy=[proctime ASC], offset=[0], fetch=[1])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -94,7 +94,7 @@ LogicalProject(a=[$0])
 Calc(select=[a])
 +- SortLimit(orderBy=[proctime ASC], offset=[0], fetch=[1])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -115,7 +115,7 @@ LogicalProject(a=[$0])
 Calc(select=[a])
 +- SortLimit(orderBy=[proctime ASC], offset=[1], fetch=[1])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -136,7 +136,7 @@ LogicalProject(a=[$0])
 Calc(select=[a])
 +- SortLimit(orderBy=[proctime DESC, c ASC], offset=[0], fetch=[2])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -157,7 +157,7 @@ LogicalProject(a=[$0])
 Calc(select=[a])
 +- SortLimit(orderBy=[proctime DESC, c ASC], offset=[2], fetch=[unlimited])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -178,7 +178,7 @@ LogicalProject(a=[$0])
 Calc(select=[a])
 +- SortLimit(orderBy=[proctime DESC], offset=[0], fetch=[1])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -199,7 +199,7 @@ LogicalProject(a=[$0])
 Calc(select=[a])
 +- SortLimit(orderBy=[proctime DESC], offset=[1], fetch=[1])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -238,7 +238,7 @@ LogicalProject(a=[$0])
 Calc(select=[a])
 +- SortLimit(orderBy=[proctime ASC, c ASC], offset=[0], fetch=[1])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -277,7 +277,7 @@ LogicalProject(a=[$0])
 Calc(select=[a])
 +- SortLimit(orderBy=[proctime ASC, c ASC], offset=[1], fetch=[1])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -316,7 +316,7 @@ LogicalProject(a=[$0])
 Calc(select=[a])
 +- SortLimit(orderBy=[proctime DESC], offset=[0], fetch=[1])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -337,7 +337,7 @@ LogicalProject(a=[$0])
 Calc(select=[a])
 +- SortLimit(orderBy=[proctime ASC, c DESC], offset=[0], fetch=[1])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -358,7 +358,7 @@ LogicalProject(a=[$0])
 Calc(select=[a])
 +- SortLimit(orderBy=[proctime ASC, c DESC], offset=[1], fetch=[1])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -379,7 +379,7 @@ LogicalProject(a=[$0])
 Calc(select=[a])
 +- SortLimit(orderBy=[c ASC, proctime ASC], offset=[0], fetch=[1])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -400,7 +400,7 @@ LogicalProject(a=[$0])
 Calc(select=[a])
 +- SortLimit(orderBy=[c ASC, proctime DESC], offset=[0], fetch=[2])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -439,7 +439,7 @@ LogicalProject(a=[$0])
 Calc(select=[a])
 +- SortLimit(orderBy=[c ASC, proctime DESC], offset=[0], fetch=[1])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -460,7 +460,7 @@ LogicalProject(a=[$0])
 Calc(select=[a])
 +- SortLimit(orderBy=[c ASC, proctime DESC], offset=[2], fetch=[unlimited])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -481,7 +481,7 @@ LogicalProject(a=[$0])
 Calc(select=[a])
 +- SortLimit(orderBy=[c ASC, proctime ASC], offset=[0], fetch=[2])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -502,7 +502,7 @@ LogicalProject(a=[$0])
 Calc(select=[a])
 +- SortLimit(orderBy=[c ASC, proctime ASC], offset=[2], fetch=[unlimited])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -523,7 +523,7 @@ LogicalProject(a=[$0])
 Calc(select=[a])
 +- SortLimit(orderBy=[proctime ASC, c ASC], offset=[0], fetch=[2])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -544,7 +544,7 @@ LogicalProject(a=[$0])
 Calc(select=[a])
 +- SortLimit(orderBy=[proctime ASC, c ASC], offset=[2], fetch=[unlimited])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -583,7 +583,7 @@ LogicalProject(a=[$0])
 Calc(select=[a])
 +- SortLimit(orderBy=[rowtime ASC], offset=[0], fetch=[1])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -622,7 +622,7 @@ LogicalProject(a=[$0])
 Calc(select=[a])
 +- SortLimit(orderBy=[rowtime ASC], offset=[0], fetch=[1])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -661,7 +661,7 @@ LogicalProject(a=[$0])
 Calc(select=[a])
 +- SortLimit(orderBy=[rowtime ASC], offset=[1], fetch=[1])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -682,7 +682,7 @@ LogicalProject(a=[$0])
 Calc(select=[a])
 +- SortLimit(orderBy=[c ASC, rowtime DESC], offset=[0], fetch=[2])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -703,7 +703,7 @@ LogicalProject(a=[$0])
 Calc(select=[a])
 +- SortLimit(orderBy=[c ASC, rowtime DESC], offset=[2], fetch=[unlimited])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -724,7 +724,7 @@ LogicalProject(a=[$0])
 Calc(select=[a])
 +- SortLimit(orderBy=[rowtime DESC, c ASC], offset=[0], fetch=[2])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -745,7 +745,7 @@ LogicalProject(a=[$0])
 Calc(select=[a])
 +- SortLimit(orderBy=[rowtime DESC, c ASC], offset=[2], fetch=[unlimited])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -784,7 +784,7 @@ LogicalProject(a=[$0])
 Calc(select=[a])
 +- SortLimit(orderBy=[rowtime DESC], offset=[0], fetch=[1])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -823,7 +823,7 @@ LogicalProject(a=[$0])
 Calc(select=[a])
 +- SortLimit(orderBy=[rowtime DESC], offset=[1], fetch=[1])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -862,7 +862,7 @@ LogicalProject(a=[$0])
 Calc(select=[a])
 +- SortLimit(orderBy=[rowtime ASC, c ASC], offset=[0], fetch=[1])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -901,7 +901,7 @@ LogicalProject(a=[$0])
 Calc(select=[a])
 +- SortLimit(orderBy=[rowtime ASC, c ASC], offset=[1], fetch=[1])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -940,7 +940,7 @@ LogicalProject(a=[$0])
 Calc(select=[a])
 +- SortLimit(orderBy=[rowtime DESC], offset=[0], fetch=[1])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -979,7 +979,7 @@ LogicalProject(a=[$0])
 Calc(select=[a])
 +- SortLimit(orderBy=[rowtime ASC, c DESC], offset=[1], fetch=[1])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -1018,7 +1018,7 @@ LogicalProject(a=[$0])
 Calc(select=[a])
 +- SortLimit(orderBy=[c ASC, rowtime ASC], offset=[0], fetch=[1])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -1057,7 +1057,7 @@ LogicalProject(a=[$0])
 Calc(select=[a])
 +- SortLimit(orderBy=[c ASC, rowtime DESC], offset=[0], fetch=[1])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -1078,7 +1078,7 @@ LogicalProject(a=[$0])
 Calc(select=[a])
 +- SortLimit(orderBy=[c ASC, rowtime ASC], offset=[0], fetch=[2])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -1099,7 +1099,7 @@ LogicalProject(a=[$0])
 Calc(select=[a])
 +- SortLimit(orderBy=[c ASC, rowtime ASC], offset=[2], fetch=[unlimited])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -1120,7 +1120,7 @@ LogicalProject(a=[$0])
 Calc(select=[a])
 +- SortLimit(orderBy=[c ASC], offset=[0], fetch=[2])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -1141,7 +1141,7 @@ LogicalProject(a=[$0])
 Calc(select=[a])
 +- SortLimit(orderBy=[rowtime ASC, c ASC], offset=[0], fetch=[2])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -1162,7 +1162,7 @@ LogicalProject(a=[$0])
 Calc(select=[a])
 +- SortLimit(orderBy=[rowtime ASC, c ASC], offset=[2], fetch=[unlimited])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -1201,7 +1201,7 @@ LogicalProject(a=[$0])
 Calc(select=[a])
 +- SortLimit(orderBy=[c ASC], offset=[2], fetch=[unlimited])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
diff --git a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/SortTest.xml b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/SortTest.xml
index e48b558..863d47f 100644
--- a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/SortTest.xml
+++ b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/SortTest.xml
@@ -32,7 +32,7 @@ LogicalProject(a=[$0])
       <![CDATA[
 Calc(select=[a])
 +- TemporalSort(orderBy=[proctime ASC, c ASC])
-   +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+   +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -53,7 +53,7 @@ LogicalProject(a=[$0])
 Calc(select=[a])
 +- Sort(orderBy=[proctime DESC, c ASC])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -74,7 +74,7 @@ LogicalProject(a=[$0])
 Calc(select=[a])
 +- Sort(orderBy=[c ASC, rowtime DESC])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -95,7 +95,7 @@ LogicalProject(a=[$0])
 Calc(select=[a])
 +- Sort(orderBy=[c ASC, proctime ASC])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -116,7 +116,7 @@ LogicalProject(a=[$0])
 Calc(select=[a])
 +- Sort(orderBy=[c ASC, proctime DESC])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -136,7 +136,7 @@ LogicalProject(a=[$0])
       <![CDATA[
 Calc(select=[a])
 +- TemporalSort(orderBy=[rowtime ASC, c ASC])
-   +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+   +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -157,7 +157,7 @@ LogicalProject(a=[$0])
 Calc(select=[a])
 +- Sort(orderBy=[c ASC, rowtime ASC])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -178,7 +178,7 @@ LogicalProject(a=[$0])
 Calc(select=[a])
 +- Sort(orderBy=[c ASC])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -199,7 +199,7 @@ LogicalProject(a=[$0])
 Calc(select=[a])
 +- Sort(orderBy=[rowtime DESC, c ASC])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
diff --git a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/TableScanTest.xml b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/TableScanTest.xml
index 539d0ac..38bb7be 100644
--- a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/TableScanTest.xml
+++ b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/TableScanTest.xml
@@ -44,7 +44,7 @@ LogicalProject(a=[$0], b=[$1], c=[$2])
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
-DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c])
+DataStreamScan(table=[[DataStreamTable]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
diff --git a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/UnnestTest.xml b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/UnnestTest.xml
index 331e2f8..0a07b57 100644
--- a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/UnnestTest.xml
+++ b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/UnnestTest.xml
@@ -71,7 +71,7 @@ Calc(select=[b, s])
    +- GroupWindowAggregate(groupBy=[b], window=[TumblingGroupWindow], select=[b, COLLECT(b) AS set])
       +- Exchange(distribution=[hash[b]])
          +- Calc(select=[b, rowtime], where=[<(b, 3)])
-            +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, rowtime])
+            +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -158,7 +158,7 @@ Calc(select=[a, s])
    +- GroupAggregate(groupBy=[a], select=[a, COLLECT(b) AS set])
       +- Exchange(distribution=[hash[a]])
          +- Calc(select=[a, b], where=[<(a, 5)])
-            +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c])
+            +- DataStreamScan(table=[[MyTable]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -213,7 +213,7 @@ Calc(select=[b, id, point])
    +- GroupAggregate(groupBy=[b], select=[b, COLLECT(c) AS set])
       +- Exchange(distribution=[hash[b]])
          +- Calc(select=[b, c], where=[<(b, 3)])
-            +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c])
+            +- DataStreamScan(table=[[MyTable]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
diff --git a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/agg/OverAggregateTest.xml b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/agg/OverAggregateTest.xml
index 1632eac..f0a6297 100644
--- a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/agg/OverAggregateTest.xml
+++ b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/agg/OverAggregateTest.xml
@@ -39,7 +39,7 @@ Calc(select=[c, w0$o0 AS cnt1, CASE(>(w0$o0, 0:BIGINT), w0$o1, null:INTEGER) AS
 +- OverAggregate(partitionBy=[c], orderBy=[proctime ASC], window=[ ROWS BETWEEN 2 PRECEDING AND CURRENT ROW], select=[a, c, proctime, COUNT(DISTINCT a) AS w0$o0, $SUM0(DISTINCT a) AS w0$o1])
    +- Exchange(distribution=[hash[c]])
       +- Calc(select=[a, c, proctime])
-         +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+         +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -70,7 +70,7 @@ Calc(select=[b, w0$o0 AS cnt1, CASE(>(w0$o0, 0:BIGINT), w0$o1, null:INTEGER) AS
 +- OverAggregate(partitionBy=[b], orderBy=[proctime ASC], window=[ ROWS BETWEEN 2 PRECEDING AND CURRENT ROW], select=[a, b, c, proctime, COUNT(a) AS w0$o0, $SUM0(a) AS w0$o1, COUNT(DISTINCT a) AS w0$o2, COUNT(DISTINCT c) AS w0$o3, $SUM0(DISTINCT c) AS w0$o4])
    +- Exchange(distribution=[hash[b]])
       +- Calc(select=[a, b, c, proctime])
-         +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+         +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -95,7 +95,7 @@ Calc(select=[a, w0$o0 AS $1])
 +- OverAggregate(orderBy=[proctime ASC], window=[ RANG BETWEEN 10000 PRECEDING AND CURRENT ROW], select=[a, c, proctime, COUNT(c) AS w0$o0])
    +- Exchange(distribution=[single])
       +- Calc(select=[a, c, proctime])
-         +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+         +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -119,7 +119,7 @@ Calc(select=[c, w0$o0 AS $1])
 +- OverAggregate(orderBy=[proctime ASC], window=[ ROWS BETWEEN 2 PRECEDING AND CURRENT ROW], select=[a, c, proctime, COUNT(a) AS w0$o0])
    +- Exchange(distribution=[single])
       +- Calc(select=[a, c, proctime])
-         +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+         +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -144,7 +144,7 @@ Calc(select=[a, /(CAST(CASE(>(w0$o0, 0:BIGINT), w0$o1, null:BIGINT)), w0$o0) AS
 +- OverAggregate(partitionBy=[a], orderBy=[proctime ASC], window=[ RANG BETWEEN 7200000 PRECEDING AND CURRENT ROW], select=[a, c, proctime, COUNT(c) AS w0$o0, $SUM0(c) AS w0$o1])
    +- Exchange(distribution=[hash[a]])
       +- Calc(select=[a, c, proctime])
-         +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+         +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -171,7 +171,7 @@ Calc(select=[c, w0$o0 AS cnt1, CASE(>(w0$o0, 0:BIGINT), w0$o1, null:INTEGER) AS
 +- OverAggregate(partitionBy=[c], orderBy=[proctime ASC], window=[ ROWS BETWEEN 2 PRECEDING AND CURRENT ROW], select=[a, c, proctime, COUNT(a) AS w0$o0, $SUM0(a) AS w0$o1])
    +- Exchange(distribution=[hash[c]])
       +- Calc(select=[a, c, proctime])
-         +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+         +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -196,7 +196,7 @@ Calc(select=[c, w0$o0 AS cnt1, CASE(>(w0$o0, 0:BIGINT), w0$o1, null:INTEGER) AS
 +- OverAggregate(orderBy=[proctime ASC], window=[ RANG BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW], select=[a, c, proctime, COUNT(a) AS w0$o0, $SUM0(a) AS w0$o1])
    +- Exchange(distribution=[single])
       +- Calc(select=[a, c, proctime])
-         +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+         +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -219,7 +219,7 @@ LogicalProject(c=[$2], EXPR$1=[COUNT($0) OVER (ORDER BY $3 NULLS FIRST ROWS BETW
 Calc(select=[c, w0$o0 AS $1])
 +- OverAggregate(orderBy=[proctime ASC], window=[ ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW], select=[a, b, c, proctime, rowtime, COUNT(a) AS w0$o0])
    +- Exchange(distribution=[single])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -244,7 +244,7 @@ Calc(select=[c, w0$o0 AS cnt1, CASE(>(w0$o0, 0:BIGINT), w0$o1, null:INTEGER) AS
 +- OverAggregate(partitionBy=[c], orderBy=[proctime ASC], window=[ RANG BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW], select=[a, c, proctime, COUNT(a) AS w0$o0, $SUM0(a) AS w0$o1])
    +- Exchange(distribution=[hash[c]])
       +- Calc(select=[a, c, proctime])
-         +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+         +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -268,7 +268,7 @@ LogicalProject(c=[$2], EXPR$1=[COUNT($0) OVER (PARTITION BY $2 ORDER BY $3 NULLS
 Calc(select=[c, w0$o0 AS $1])
 +- OverAggregate(partitionBy=[c], orderBy=[proctime ASC], window=[ ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW], select=[a, b, c, proctime, rowtime, COUNT(a) AS w0$o0])
    +- Exchange(distribution=[hash[c]])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -293,7 +293,7 @@ Calc(select=[c, w0$o0 AS $1])
 +- OverAggregate(orderBy=[rowtime ASC], window=[ RANG BETWEEN 1000 PRECEDING AND CURRENT ROW], select=[a, c, rowtime, COUNT(a) AS w0$o0])
    +- Exchange(distribution=[single])
       +- Calc(select=[a, c, rowtime])
-         +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+         +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -318,7 +318,7 @@ Calc(select=[c, w0$o0 AS $1])
 +- OverAggregate(partitionBy=[c], orderBy=[rowtime ASC], window=[ RANG BETWEEN 1000 PRECEDING AND CURRENT ROW], select=[a, c, rowtime, COUNT(a) AS w0$o0])
    +- Exchange(distribution=[hash[c]])
       +- Calc(select=[a, c, rowtime])
-         +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+         +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -342,7 +342,7 @@ Calc(select=[c, w0$o0 AS $1])
 +- OverAggregate(orderBy=[rowtime ASC], window=[ ROWS BETWEEN 5 PRECEDING AND CURRENT ROW], select=[a, c, rowtime, COUNT(a) AS w0$o0])
    +- Exchange(distribution=[single])
       +- Calc(select=[a, c, rowtime])
-         +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+         +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -367,7 +367,7 @@ Calc(select=[c, w0$o0 AS $1])
 +- OverAggregate(partitionBy=[c], orderBy=[rowtime ASC], window=[ ROWS BETWEEN 5 PRECEDING AND CURRENT ROW], select=[a, c, rowtime, COUNT(a) AS w0$o0])
    +- Exchange(distribution=[hash[c]])
       +- Calc(select=[a, c, rowtime])
-         +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+         +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -392,7 +392,7 @@ Calc(select=[c, w0$o0 AS cnt1, CASE(>(w0$o0, 0:BIGINT), w0$o1, null:INTEGER) AS
 +- OverAggregate(orderBy=[rowtime ASC], window=[ RANG BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW], select=[a, c, rowtime, COUNT(a) AS w0$o0, $SUM0(a) AS w0$o1])
    +- Exchange(distribution=[single])
       +- Calc(select=[a, c, rowtime])
-         +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+         +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -417,7 +417,7 @@ Calc(select=[c, w0$o0 AS cnt1, CASE(>(w0$o0, 0:BIGINT), w0$o1, null:INTEGER) AS
 +- OverAggregate(orderBy=[rowtime ASC], window=[ ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW], select=[a, c, rowtime, COUNT(a) AS w0$o0, $SUM0(a) AS w0$o1])
    +- Exchange(distribution=[single])
       +- Calc(select=[a, c, rowtime])
-         +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+         +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -442,7 +442,7 @@ Calc(select=[c, w0$o0 AS cnt1, CASE(>(w0$o0, 0:BIGINT), w0$o1, null:INTEGER) AS
 +- OverAggregate(partitionBy=[c], orderBy=[rowtime ASC], window=[ ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW], select=[a, c, rowtime, COUNT(a) AS w0$o0, $SUM0(a) AS w0$o1])
    +- Exchange(distribution=[hash[c]])
       +- Calc(select=[a, c, rowtime])
-         +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+         +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -467,7 +467,7 @@ Calc(select=[c, w0$o0 AS cnt1, CASE(>(w0$o0, 0:BIGINT), w0$o1, null:INTEGER) AS
 +- OverAggregate(partitionBy=[c], orderBy=[rowtime ASC], window=[ RANG BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW], select=[a, c, rowtime, COUNT(a) AS w0$o0, $SUM0(a) AS w0$o1])
    +- Exchange(distribution=[hash[c]])
       +- Calc(select=[a, c, rowtime])
-         +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+         +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
diff --git a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/agg/WindowAggregateTest.xml b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/agg/WindowAggregateTest.xml
index 190929a..01b9550 100644
--- a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/agg/WindowAggregateTest.xml
+++ b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/agg/WindowAggregateTest.xml
@@ -44,7 +44,7 @@ Calc(select=[/(-($f0, /(*(CAST($f1), CAST($f1)), $f2)), $f2) AS EXPR$0, /(-($f0,
 +- GroupWindowAggregate(window=[TumblingGroupWindow], properties=[w$start, w$end, w$rowtime, w$proctime], select=[SUM($f2) AS $f0, SUM(c) AS $f1, COUNT(c) AS $f2, start('w$) AS w$start, end('w$) AS w$end, rowtime('w$) AS w$rowtime, proctime('w$) AS w$proctime])
    +- Exchange(distribution=[single])
       +- Calc(select=[rowtime, c, *(CAST(c), CAST(c)) AS $f2])
-         +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+         +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -71,7 +71,7 @@ Calc(select=[EXPR$0, +(CAST(w$end), 60000:INTERVAL MINUTE) AS EXPR$1])
 +- GroupWindowAggregate(window=[TumblingGroupWindow], properties=[w$start, w$end, w$rowtime, w$proctime], select=[COUNT(*) AS EXPR$0, start('w$) AS w$start, end('w$) AS w$end, rowtime('w$) AS w$rowtime, proctime('w$) AS w$proctime])
    +- Exchange(distribution=[single])
       +- Calc(select=[rowtime])
-         +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+         +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -101,7 +101,7 @@ Calc(select=[EXPR$0, CAST(w$start) AS EXPR$1], where=[AND(>($f1, 0), =(EXTRACT(F
 +- GroupWindowAggregate(window=[SlidingGroupWindow('w$, rowtime, 60000, 900000)], properties=[w$start, w$end, w$rowtime, w$proctime], select=[COUNT(*) AS EXPR$0, SUM(a) AS $f1, start('w$) AS w$start, end('w$) AS w$end, rowtime('w$) AS w$rowtime, proctime('w$) AS w$proctime])
    +- Exchange(distribution=[single])
       +- Calc(select=[rowtime, a])
-         +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+         +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -130,7 +130,7 @@ Calc(select=[EXPR$0, wAvg, CAST(w$start) AS EXPR$2, CAST(w$end) AS EXPR$3])
 +- GroupWindowAggregate(window=[SlidingGroupWindow('w$, proctime, 3600000, 900000)], properties=[w$start, w$end, w$proctime], select=[COUNT(*) AS EXPR$0, weightedAvg(c, a) AS wAvg, start('w$) AS w$start, end('w$) AS w$end, proctime('w$) AS w$proctime])
    +- Exchange(distribution=[single])
       +- Calc(select=[proctime, c, a])
-         +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+         +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -163,7 +163,7 @@ Calc(select=[EXPR$0])
       +- GroupWindowAggregate(groupBy=[a, b, c], window=[TumblingGroupWindow], select=[a, b, c])
          +- Exchange(distribution=[hash[a, b, c]])
             +- Calc(select=[a, b, c, rowtime])
-               +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+               +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -207,7 +207,7 @@ Union(all=[true], union=[EXPR$0, EXPR$1, EXPR$2, EXPR$3])
 :  +- GroupWindowAggregate(window=[SlidingGroupWindow('w$, rowtime, 3600000, 60000)], properties=[w$start, w$end, w$rowtime, w$proctime], select=[COUNT(*) AS EXPR$2, SUM(c) AS EXPR$3, start('w$) AS w$start, end('w$) AS w$end, rowtime('w$) AS w$rowtime, proctime('w$) AS w$proctime])
 :     +- Exchange(distribution=[single], reuse_id=[1])
 :        +- Calc(select=[rowtime, c])
-:           +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+:           +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 +- Calc(select=[CAST(w$start) AS EXPR$0, CAST(w$end) AS EXPR$1, EXPR$2, EXPR$3])
    +- GroupWindowAggregate(window=[SlidingGroupWindow('w$, rowtime, 86400000, 60000)], properties=[w$start, w$end, w$rowtime, w$proctime], select=[COUNT(*) AS EXPR$2, SUM(c) AS EXPR$3, start('w$) AS w$start, end('w$) AS w$end, rowtime('w$) AS w$rowtime, proctime('w$) AS w$proctime])
       +- Reused(reference_id=[1])
@@ -259,7 +259,7 @@ Join(joinType=[InnerJoin], where=[=(he1, he2)], select=[hs1, he1, c1, s1, hs2, h
 :     +- GroupWindowAggregate(window=[SlidingGroupWindow('w$, rowtime, 3600000, 60000)], properties=[w$start, w$end, w$rowtime, w$proctime], select=[COUNT(*) AS c1, SUM(c) AS s1, start('w$) AS w$start, end('w$) AS w$end, rowtime('w$) AS w$rowtime, proctime('w$) AS w$proctime])
 :        +- Exchange(distribution=[single], reuse_id=[1])
 :           +- Calc(select=[rowtime, c])
-:              +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+:              +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 +- Exchange(distribution=[hash[he2]])
    +- Calc(select=[CAST(w$start) AS hs2, CAST(w$end) AS he2, c2, s2])
       +- GroupWindowAggregate(window=[SlidingGroupWindow('w$, rowtime, 86400000, 60000)], properties=[w$start, w$end, w$rowtime, w$proctime], select=[COUNT(*) AS c2, SUM(c) AS s2, start('w$) AS w$start, end('w$) AS w$end, rowtime('w$) AS w$rowtime, proctime('w$) AS w$proctime])
@@ -303,7 +303,7 @@ Calc(select=[w$rowtime AS EXPR$0, CAST(w$end) AS EXPR$1, a])
          +- GroupWindowAggregate(window=[TumblingGroupWindow], properties=[w$start, w$end, w$rowtime, w$proctime], select=[COUNT(a) AS a, start('w$) AS w$start, end('w$) AS w$end, rowtime('w$) AS w$rowtime, proctime('w$) AS w$proctime])
             +- Exchange(distribution=[single])
                +- Calc(select=[rowtime, a])
-                  +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+                  +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -336,7 +336,7 @@ Calc(select=[EXPR$0])
       +- GroupWindowAggregate(groupBy=[a, b, c], window=[TumblingGroupWindow], select=[a, b, c, COUNT(*) AS d])
          +- Exchange(distribution=[hash[a, b, c]])
             +- Calc(select=[a, b, c, rowtime])
-               +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+               +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -365,7 +365,7 @@ Calc(select=[EXPR$0, wAvg, CAST(w$start) AS EXPR$2, CAST(w$end) AS EXPR$3])
 +- GroupWindowAggregate(window=[SessionGroupWindow('w$, proctime, 900000)], properties=[w$start, w$end, w$proctime], select=[COUNT(*) AS EXPR$0, weightedAvg(c, a) AS wAvg, start('w$) AS w$start, end('w$) AS w$end, proctime('w$) AS w$proctime])
    +- Exchange(distribution=[single])
       +- Calc(select=[proctime, c, a])
-         +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+         +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -399,7 +399,7 @@ Calc(select=[EXPR$0])
          +- GroupWindowAggregate(groupBy=[a, b, c], window=[TumblingGroupWindow], properties=[w$start, w$end, w$rowtime, w$proctime], select=[a, b, c, COUNT(*) AS d, start('w$) AS w$start, end('w$) AS w$end, rowtime('w$) AS w$rowtime, proctime('w$) AS w$proctime])
             +- Exchange(distribution=[hash[a, b, c]])
                +- Calc(select=[a, b, c, rowtime])
-                  +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+                  +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -434,7 +434,7 @@ Calc(select=[EXPR$0])
          +- GroupWindowAggregate(groupBy=[a, b, c], window=[TumblingGroupWindow], properties=[w$start, w$end, w$rowtime, w$proctime], select=[a, b, c, start('w$) AS w$start, end('w$) AS w$end, rowtime('w$) AS w$rowtime, proctime('w$) AS w$proctime])
             +- Exchange(distribution=[hash[a, b, c]])
                +- Calc(select=[a, b, c, rowtime])
-                  +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+                  +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -463,7 +463,7 @@ Calc(select=[EXPR$0, wAvg, CAST(w$start) AS EXPR$2, CAST(w$end) AS EXPR$3])
 +- GroupWindowAggregate(window=[TumblingGroupWindow], properties=[w$start, w$end, w$rowtime, w$proctime], select=[COUNT(*) AS EXPR$0, weightedAvg(c, a) AS wAvg, start('w$) AS w$start, end('w$) AS w$end, rowtime('w$) AS w$rowtime, proctime('w$) AS w$proctime])
    +- Exchange(distribution=[single])
       +- Calc(select=[rowtime, c, a])
-         +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+         +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
diff --git a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/join/LookupJoinTest.xml b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/join/LookupJoinTest.xml
index c4b3e27..5a184a4 100644
--- a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/join/LookupJoinTest.xml
+++ b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/join/LookupJoinTest.xml
@@ -40,7 +40,7 @@ LogicalProject(a=[$0], b=[$1], c=[$2], proctime=[$3], rowtime=[$4], id=[$5], nam
       <![CDATA[
 Calc(select=[a, b, c, PROCTIME_MATERIALIZE(proctime) AS proctime, rowtime, id, name, CAST(10) AS age])
 +- LookupJoin(table=[TestTemporalTable(id, name, age)], joinType=[InnerJoin], async=[false], on=[a=id], where=[AND(=(age, 10), >(CAST(name), 1000))], select=[a, b, c, proctime, rowtime, id, name, age])
-   +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+   +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -84,7 +84,7 @@ GroupAggregate(groupBy=[b], select=[b, COUNT_RETRACT(a) AS EXPR$1, SUM_RETRACT(c
          +- Calc(select=[b, a, c, d])
             +- GroupAggregate(groupBy=[a, b], select=[a, b, SUM(c) AS c, SUM(d) AS d])
                +- Exchange(distribution=[hash[a, b]])
-                  +- DataStreamScan(table=[[_DataStreamTable_1]], fields=[a, b, c, d])
+                  +- DataStreamScan(table=[[T1]], fields=[a, b, c, d])
 ]]>
     </Resource>
   </TestCase>
@@ -106,7 +106,7 @@ LogicalProject(a=[$0], b=[$1], c=[$2], proctime=[$3], rowtime=[$4], id=[$5], nam
       <![CDATA[
 Calc(select=[a, b, c, PROCTIME_MATERIALIZE(proctime) AS proctime, rowtime, id, name, age])
 +- LookupJoin(table=[TestTemporalTable(id, name, age)], joinType=[InnerJoin], async=[false], on=[a=id], select=[a, b, c, proctime, rowtime, id, name, age])
-   +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+   +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -135,7 +135,7 @@ LogicalProject(a=[$0], b=[$1], c=[$2], proctime=[$3], rowtime=[$4], id=[$5], nam
 Calc(select=[a, b, c, PROCTIME_MATERIALIZE(proctime) AS proctime, rowtime, id, name, CAST(10) AS age])
 +- LookupJoin(table=[TestTemporalTable(id, name, age)], joinType=[InnerJoin], async=[false], on=[a=id], where=[=(age, 10)], select=[a, b, c, proctime, rowtime, id, name, age])
    +- Calc(select=[a, b, c, proctime, rowtime], where=[>(c, 1000)])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -164,7 +164,7 @@ LogicalProject(a=[$0], b=[$1], c=[$2], proctime=[$3], rowtime=[$4], id=[$5], nam
 Calc(select=[a, b, c, PROCTIME_MATERIALIZE(proctime) AS proctime, rowtime, id, CAST(_UTF-16LE'AAA':VARCHAR(2147483647) CHARACTER SET "UTF-16LE") AS name, CAST(10) AS age])
 +- LookupJoin(table=[TestTemporalTable(id, name, age)], joinType=[InnerJoin], async=[false], on=[a=id], where=[AND(=(age, 10), =(name, _UTF-16LE'AAA':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"))], select=[a, b, c, proctime, rowtime, id, name, age])
    +- Calc(select=[a, b, c, proctime, rowtime], where=[>(c, 1000)])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -189,7 +189,7 @@ LogicalProject(a=[$0], b=[$1], proctime=[$2], id=[$3], name=[$4], age=[$5])
 Calc(select=[a, b, PROCTIME_MATERIALIZE(proctime) AS proctime, id, name, age])
 +- LookupJoin(table=[TestTemporalTable(id, name, age)], joinType=[InnerJoin], async=[false], on=[a=id], select=[a, b, proctime, id, name, age])
    +- Calc(select=[a, b, proctime], where=[>(c, 1000)])
-      +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+      +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -211,7 +211,7 @@ LogicalProject(a=[$0], b=[$1], c=[$2], proctime=[$3], rowtime=[$4], id=[$5], nam
       <![CDATA[
 Calc(select=[a, b, c, PROCTIME_MATERIALIZE(proctime) AS proctime, rowtime, id, name, age])
 +- LookupJoin(table=[TestTemporalTable(id, name, age)], joinType=[LeftOuterJoin], async=[false], on=[a=id], select=[a, b, c, proctime, rowtime, id, name, age])
-   +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+   +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -238,7 +238,7 @@ LogicalProject(a=[$0], b=[$1], c=[$2], proctime=[$3], rowtime=[$4], id=[$5])
       <![CDATA[
 Calc(select=[a, b, c, PROCTIME_MATERIALIZE(proctime) AS proctime, rowtime, id])
 +- LookupJoin(table=[TestTemporalTable(id, name, age)], joinType=[InnerJoin], async=[false], on=[a=id], select=[a, b, c, proctime, rowtime, id, name, age])
-   +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+   +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
diff --git a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/join/WindowJoinTest.xml b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/join/WindowJoinTest.xml
index de3380f..d523aec 100644
--- a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/join/WindowJoinTest.xml
+++ b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/stream/sql/join/WindowJoinTest.xml
@@ -38,10 +38,10 @@ Calc(select=[a, b])
 +- Join(joinType=[InnerJoin], where=[AND(=(a, a0), =($f5, $f50))], select=[a, $f5, a0, b, $f50], leftInputSpec=[NoUniqueKey], rightInputSpec=[NoUniqueKey])
    :- Exchange(distribution=[hash[a, $f5]])
    :  +- Calc(select=[a, PROCTIME_MATERIALIZE(proctime) AS $f5])
-   :     +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+   :     +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
    +- Exchange(distribution=[hash[a, $f5]])
       +- Calc(select=[a, b, PROCTIME_MATERIALIZE(proctime) AS $f5])
-         +- DataStreamScan(table=[[_DataStreamTable_1]], fields=[a, b, c, proctime, rowtime])
+         +- DataStreamScan(table=[[MyTable2]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -67,10 +67,10 @@ Calc(select=[a, b])
 +- Join(joinType=[InnerJoin], where=[AND(=(a, a0), =(rowtime0, rowtime00))], select=[a, rowtime0, a0, b, rowtime00], leftInputSpec=[NoUniqueKey], rightInputSpec=[NoUniqueKey])
    :- Exchange(distribution=[hash[a, rowtime0]])
    :  +- Calc(select=[a, CAST(rowtime) AS rowtime0])
-   :     +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+   :     +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
    +- Exchange(distribution=[hash[a, rowtime0]])
       +- Calc(select=[a, b, CAST(rowtime) AS rowtime0])
-         +- DataStreamScan(table=[[_DataStreamTable_1]], fields=[a, b, c, proctime, rowtime])
+         +- DataStreamScan(table=[[MyTable2]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -128,10 +128,10 @@ Calc(select=[a, b0 AS b])
 +- WindowJoin(joinType=[InnerJoin], windowBounds=[isRowTime=true, leftLowerBound=-10000, leftUpperBound=3600000, leftTimeIndex=2, rightTimeIndex=2], where=[AND(=(a, a0), >=(rowtime, -(rowtime0, 10000:INTERVAL SECOND)), <=(rowtime, +(rowtime0, 3600000:INTERVAL HOUR)), LIKE(b, b0))], select=[a, b, rowtime, a0, b0, rowtime0])
    :- Exchange(distribution=[hash[a]])
    :  +- Calc(select=[a, b, rowtime])
-   :     +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+   :     +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
    +- Exchange(distribution=[hash[a]])
       +- Calc(select=[a, b, rowtime])
-         +- DataStreamScan(table=[[_DataStreamTable_1]], fields=[a, b, c, proctime, rowtime])
+         +- DataStreamScan(table=[[MyTable2]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -157,10 +157,10 @@ Calc(select=[a, b])
 +- WindowJoin(joinType=[InnerJoin], windowBounds=[isRowTime=false, leftLowerBound=-3600000, leftUpperBound=3600000, leftTimeIndex=1, rightTimeIndex=2], where=[AND(=(a, a0), >=(proctime, -(proctime0, 3600000:INTERVAL HOUR)), <=(proctime, +(proctime0, 3600000:INTERVAL HOUR)))], select=[a, proctime, a0, b, proctime0])
    :- Exchange(distribution=[hash[a]])
    :  +- Calc(select=[a, proctime])
-   :     +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+   :     +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
    +- Exchange(distribution=[hash[a]])
       +- Calc(select=[a, b, proctime])
-         +- DataStreamScan(table=[[_DataStreamTable_1]], fields=[a, b, c, proctime, rowtime])
+         +- DataStreamScan(table=[[MyTable2]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -187,10 +187,10 @@ Calc(select=[a, b])
 +- WindowJoin(joinType=[InnerJoin], windowBounds=[isRowTime=false, leftLowerBound=-3600000, leftUpperBound=3600000, leftTimeIndex=1, rightTimeIndex=2], where=[AND(=(a, a0), >=(PROCTIME_MATERIALIZE(proctime), -(PROCTIME_MATERIALIZE(proctime0), 3600000:INTERVAL HOUR)), <=(PROCTIME_MATERIALIZE(proctime), +(PROCTIME_MATERIALIZE(proctime0), 3600000:INTERVAL HOUR)))], select=[a, proctime, a0, b, proctime0])
    :- Exchange(distribution=[hash[a]])
    :  +- Calc(select=[a, proctime])
-   :     +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+   :     +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
    +- Exchange(distribution=[hash[a]])
       +- Calc(select=[a, b, proctime])
-         +- DataStreamScan(table=[[_DataStreamTable_1]], fields=[a, b, c, proctime, rowtime])
+         +- DataStreamScan(table=[[MyTable2]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -223,10 +223,10 @@ GroupWindowAggregate(groupBy=[b], window=[TumblingGroupWindow], select=[b, SUM(a
       +- WindowJoin(joinType=[InnerJoin], windowBounds=[isRowTime=true, leftLowerBound=-600000, leftUpperBound=3600000, leftTimeIndex=2, rightTimeIndex=2], where=[AND(=(a, a0), >=(CAST(rowtime), -(CAST(rowtime0), 600000:INTERVAL MINUTE)), <=(CAST(rowtime), +(CAST(rowtime0), 3600000:INTERVAL HOUR)))], select=[a, b, rowtime, a0, b0, rowtime0])
          :- Exchange(distribution=[hash[a]])
          :  +- Calc(select=[a, b, rowtime])
-         :     +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+         :     +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
          +- Exchange(distribution=[hash[a]])
             +- Calc(select=[a, b, rowtime])
-               +- DataStreamScan(table=[[_DataStreamTable_1]], fields=[a, b, c, proctime, rowtime])
+               +- DataStreamScan(table=[[MyTable2]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -253,10 +253,10 @@ Calc(select=[a, b])
 +- WindowJoin(joinType=[FullOuterJoin], windowBounds=[isRowTime=false, leftLowerBound=-3600000, leftUpperBound=3600000, leftTimeIndex=1, rightTimeIndex=2], where=[AND(=(a, a0), >=(proctime, -(proctime0, 3600000:INTERVAL HOUR)), <=(proctime, +(proctime0, 3600000:INTERVAL HOUR)))], select=[a, proctime, a0, b, proctime0])
    :- Exchange(distribution=[hash[a]])
    :  +- Calc(select=[a, proctime])
-   :     +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+   :     +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
    +- Exchange(distribution=[hash[a]])
       +- Calc(select=[a, b, proctime])
-         +- DataStreamScan(table=[[_DataStreamTable_1]], fields=[a, b, c, proctime, rowtime])
+         +- DataStreamScan(table=[[MyTable2]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -283,10 +283,10 @@ Calc(select=[a, b])
 +- WindowJoin(joinType=[RightOuterJoin], windowBounds=[isRowTime=false, leftLowerBound=-3600000, leftUpperBound=3600000, leftTimeIndex=1, rightTimeIndex=2], where=[AND(=(a, a0), >=(proctime, -(proctime0, 3600000:INTERVAL HOUR)), <=(proctime, +(proctime0, 3600000:INTERVAL HOUR)))], select=[a, proctime, a0, b, proctime0])
    :- Exchange(distribution=[hash[a]])
    :  +- Calc(select=[a, proctime])
-   :     +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+   :     +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
    +- Exchange(distribution=[hash[a]])
       +- Calc(select=[a, b, proctime])
-         +- DataStreamScan(table=[[_DataStreamTable_1]], fields=[a, b, c, proctime, rowtime])
+         +- DataStreamScan(table=[[MyTable2]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -313,10 +313,10 @@ Calc(select=[a, b])
 +- WindowJoin(joinType=[LeftOuterJoin], windowBounds=[isRowTime=false, leftLowerBound=-3600000, leftUpperBound=3600000, leftTimeIndex=1, rightTimeIndex=2], where=[AND(=(a, a0), >=(proctime, -(proctime0, 3600000:INTERVAL HOUR)), <=(proctime, +(proctime0, 3600000:INTERVAL HOUR)))], select=[a, proctime, a0, b, proctime0])
    :- Exchange(distribution=[hash[a]])
    :  +- Calc(select=[a, proctime])
-   :     +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+   :     +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
    +- Exchange(distribution=[hash[a]])
       +- Calc(select=[a, b, proctime])
-         +- DataStreamScan(table=[[_DataStreamTable_1]], fields=[a, b, c, proctime, rowtime])
+         +- DataStreamScan(table=[[MyTable2]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -343,10 +343,10 @@ Calc(select=[a, b])
 +- WindowJoin(joinType=[RightOuterJoin], windowBounds=[isRowTime=true, leftLowerBound=-10000, leftUpperBound=3600000, leftTimeIndex=1, rightTimeIndex=2], where=[AND(=(a, a0), >=(rowtime, -(rowtime0, 10000:INTERVAL SECOND)), <=(rowtime, +(rowtime0, 3600000:INTERVAL HOUR)))], select=[a, rowtime, a0, b, rowtime0])
    :- Exchange(distribution=[hash[a]])
    :  +- Calc(select=[a, rowtime])
-   :     +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+   :     +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
    +- Exchange(distribution=[hash[a]])
       +- Calc(select=[a, b, rowtime])
-         +- DataStreamScan(table=[[_DataStreamTable_1]], fields=[a, b, c, proctime, rowtime])
+         +- DataStreamScan(table=[[MyTable2]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -373,10 +373,10 @@ Calc(select=[a, b])
 +- WindowJoin(joinType=[FullOuterJoin], windowBounds=[isRowTime=true, leftLowerBound=-10000, leftUpperBound=3600000, leftTimeIndex=1, rightTimeIndex=2], where=[AND(=(a, a0), >=(rowtime, -(rowtime0, 10000:INTERVAL SECOND)), <=(rowtime, +(rowtime0, 3600000:INTERVAL HOUR)))], select=[a, rowtime, a0, b, rowtime0])
    :- Exchange(distribution=[hash[a]])
    :  +- Calc(select=[a, rowtime])
-   :     +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+   :     +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
    +- Exchange(distribution=[hash[a]])
       +- Calc(select=[a, b, rowtime])
-         +- DataStreamScan(table=[[_DataStreamTable_1]], fields=[a, b, c, proctime, rowtime])
+         +- DataStreamScan(table=[[MyTable2]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -409,10 +409,10 @@ GroupWindowAggregate(groupBy=[b0], window=[TumblingGroupWindow], select=[b0, SUM
       +- WindowJoin(joinType=[InnerJoin], windowBounds=[isRowTime=true, leftLowerBound=-600000, leftUpperBound=3600000, leftTimeIndex=2, rightTimeIndex=2], where=[AND(=(a, a0), >=(CAST(rowtime), -(CAST(rowtime0), 600000:INTERVAL MINUTE)), <=(CAST(rowtime), +(CAST(rowtime0), 3600000:INTERVAL HOUR)))], select=[a, b, rowtime, a0, b0, rowtime0])
          :- Exchange(distribution=[hash[a]])
          :  +- Calc(select=[a, b, rowtime])
-         :     +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+         :     +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
          +- Exchange(distribution=[hash[a]])
             +- Calc(select=[a, b, rowtime])
-               +- DataStreamScan(table=[[_DataStreamTable_1]], fields=[a, b, c, proctime, rowtime])
+               +- DataStreamScan(table=[[MyTable2]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -439,10 +439,10 @@ Calc(select=[a, b])
 +- WindowJoin(joinType=[InnerJoin], windowBounds=[isRowTime=true, leftLowerBound=-600000, leftUpperBound=3600000, leftTimeIndex=1, rightTimeIndex=2], where=[AND(=(a, a0), >=(CAST(rowtime), -(CAST(rowtime0), 600000:INTERVAL MINUTE)), <=(CAST(rowtime), +(CAST(rowtime0), 3600000:INTERVAL HOUR)))], select=[a, rowtime, a0, b, rowtime0])
    :- Exchange(distribution=[hash[a]])
    :  +- Calc(select=[a, rowtime])
-   :     +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+   :     +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
    +- Exchange(distribution=[hash[a]])
       +- Calc(select=[a, b, rowtime])
-         +- DataStreamScan(table=[[_DataStreamTable_1]], fields=[a, b, c, proctime, rowtime])
+         +- DataStreamScan(table=[[MyTable2]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -468,10 +468,10 @@ Calc(select=[a, b])
 +- WindowJoin(joinType=[InnerJoin], windowBounds=[isRowTime=true, leftLowerBound=-10000, leftUpperBound=3600000, leftTimeIndex=1, rightTimeIndex=2], where=[AND(=(a, a0), >=(rowtime, -(rowtime0, 10000:INTERVAL SECOND)), <=(rowtime, +(rowtime0, 3600000:INTERVAL HOUR)))], select=[a, rowtime, a0, b, rowtime0])
    :- Exchange(distribution=[hash[a]])
    :  +- Calc(select=[a, rowtime])
-   :     +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+   :     +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
    +- Exchange(distribution=[hash[a]])
       +- Calc(select=[a, b, rowtime])
-         +- DataStreamScan(table=[[_DataStreamTable_1]], fields=[a, b, c, proctime, rowtime])
+         +- DataStreamScan(table=[[MyTable2]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -498,10 +498,10 @@ Calc(select=[a, b])
 +- WindowJoin(joinType=[LeftOuterJoin], windowBounds=[isRowTime=true, leftLowerBound=-10000, leftUpperBound=3600000, leftTimeIndex=1, rightTimeIndex=2], where=[AND(=(a, a0), >=(rowtime, -(rowtime0, 10000:INTERVAL SECOND)), <=(rowtime, +(rowtime0, 3600000:INTERVAL HOUR)))], select=[a, rowtime, a0, b, rowtime0])
    :- Exchange(distribution=[hash[a]])
    :  +- Calc(select=[a, rowtime])
-   :     +- DataStreamScan(table=[[_DataStreamTable_0]], fields=[a, b, c, proctime, rowtime])
+   :     +- DataStreamScan(table=[[MyTable]], fields=[a, b, c, proctime, rowtime])
    +- Exchange(distribution=[hash[a]])
       +- Calc(select=[a, b, rowtime])
-         +- DataStreamScan(table=[[_DataStreamTable_1]], fields=[a, b, c, proctime, rowtime])
+         +- DataStreamScan(table=[[MyTable2]], fields=[a, b, c, proctime, rowtime])
 ]]>
     </Resource>
   </TestCase>
diff --git a/flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/plan/stream/sql/join/LookupJoinTest.scala b/flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/plan/stream/sql/join/LookupJoinTest.scala
index ffd0c4d..b4d9a58 100644
--- a/flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/plan/stream/sql/join/LookupJoinTest.scala
+++ b/flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/plan/stream/sql/join/LookupJoinTest.scala
@@ -19,24 +19,25 @@
 package org.apache.flink.table.plan.stream.sql.join
 
 import org.apache.flink.api.common.typeinfo.TypeInformation
+import org.apache.flink.api.scala._
 import org.apache.flink.streaming.api.functions.async.ResultFuture
 import org.apache.flink.table.api._
 import org.apache.flink.table.dataformat.{BaseRow, BinaryString}
 import org.apache.flink.table.functions.{AsyncTableFunction, TableFunction}
 import org.apache.flink.table.sources._
-import org.apache.flink.api.scala._
 import org.apache.flink.table.types.logical.{IntType, TimestampType, VarCharType}
 import org.apache.flink.table.typeutils.BaseRowTypeInfo
 import org.apache.flink.table.util.{StreamTableTestUtil, TableTestBase}
 import org.apache.flink.types.Row
+
 import org.junit.Assert.{assertTrue, fail}
 import org.junit.Test
 
+import _root_.java.lang.{Long => JLong}
+import _root_.java.sql.Timestamp
 import _root_.java.util
 import _root_.java.util.concurrent.CompletableFuture
 import _root_.java.util.{Collection => JCollection}
-import _root_.java.lang.{Long => JLong}
-import _root_.java.sql.Timestamp
 
 import _root_.scala.annotation.varargs
 
@@ -213,8 +214,8 @@ class LookupJoinTest extends TableTestBase with Serializable {
     expectExceptionThrown(
       "SELECT * FROM MyTable AS T JOIN nonTemporal " +
         "FOR SYSTEM_TIME AS OF T.rowtime AS D ON T.a = D.id",
-      "Table 'nonTemporal' is not a temporal table",
-      classOf[ValidationException])
+      "Temporal table join only support join on a LookupableTableSource",
+      classOf[TableException])
   }
 
   @Test
diff --git a/flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/runtime/batch/sql/agg/AggregateRemoveITCase.scala b/flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/runtime/batch/sql/agg/AggregateRemoveITCase.scala
index 929f49b1..79ffc57 100644
--- a/flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/runtime/batch/sql/agg/AggregateRemoveITCase.scala
+++ b/flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/runtime/batch/sql/agg/AggregateRemoveITCase.scala
@@ -40,7 +40,7 @@ class AggregateRemoveITCase extends BatchTestBase {
         row(6, 3, "C", "Hello world")),
       new RowTypeInfo(Types.INT, Types.INT, Types.STRING, Types.STRING),
       "a, b, c, d",
-      Array(true, true, true),
+      Array(true, true, true, true),
       FlinkStatistic.builder().uniqueKeys(Set(Set("a").asJava).asJava).build()
     )
 
diff --git a/flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/runtime/utils/BatchTableEnvUtil.scala b/flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/runtime/utils/BatchTableEnvUtil.scala
index 35ba61c..a082a75 100644
--- a/flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/runtime/utils/BatchTableEnvUtil.scala
+++ b/flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/runtime/utils/BatchTableEnvUtil.scala
@@ -24,16 +24,13 @@ import org.apache.flink.api.common.typeinfo.TypeInformation
 import org.apache.flink.api.common.typeutils.TypeSerializer
 import org.apache.flink.api.java.io.CollectionInputFormat
 import org.apache.flink.streaming.api.datastream.DataStream
-import org.apache.flink.table.api.{BatchTableEnvironment, Table, TableEnvironment}
-import org.apache.flink.table.plan.schema.DataStreamTable
+import org.apache.flink.table.api.{BatchTableEnvironment, Table, TableEnvironment, TableImpl}
 import org.apache.flink.table.plan.stats.FlinkStatistic
 import org.apache.flink.table.sinks.CollectTableSink
-import org.apache.flink.table.types.utils.TypeConversions
-import org.apache.flink.table.types.utils.TypeConversions.fromLegacyInfoToDataType
+import org.apache.flink.table.types.utils.TypeConversions.fromDataTypeToLegacyInfo
 import org.apache.flink.util.AbstractID
-import _root_.java.util.{ArrayList => JArrayList}
 
-import org.apache.flink.table.types.utils.TypeConversions.fromDataTypeToLegacyInfo
+import _root_.java.util.{ArrayList => JArrayList}
 
 import _root_.scala.collection.JavaConversions._
 import _root_.scala.collection.JavaConverters._
@@ -150,12 +147,8 @@ object BatchTableEnvUtil {
       fieldNames: Option[Array[String]],
       fieldNullables: Option[Array[Boolean]],
       statistic: Option[FlinkStatistic]): Unit = {
-    val (typeFieldNames, fieldIdxs) =
-      tEnv.getFieldInfo(fromLegacyInfoToDataType(boundedStream.getTransformation.getOutputType))
-    val boundedStreamTable = new DataStreamTable[T](
-      boundedStream, fieldIdxs, fieldNames.getOrElse(typeFieldNames), fieldNullables)
-    val withStatistic = boundedStreamTable.copy(statistic.getOrElse(FlinkStatistic.UNKNOWN))
-    tEnv.registerTableInternal(name, withStatistic)
+    val queryOperation = tEnv.asQueryOperation(boundedStream, fieldNames, fieldNullables, statistic)
+    tEnv.registerTable(name, new TableImpl(tEnv, queryOperation))
   }
 
   /**
diff --git a/flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/runtime/utils/StreamTableEnvUtil.scala b/flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/runtime/utils/StreamTableEnvUtil.scala
index 1fe036c..3a276fd 100644
--- a/flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/runtime/utils/StreamTableEnvUtil.scala
+++ b/flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/runtime/utils/StreamTableEnvUtil.scala
@@ -19,10 +19,8 @@
 package org.apache.flink.table.runtime.utils
 
 import org.apache.flink.streaming.api.datastream.DataStream
-import org.apache.flink.table.api.{StreamTableEnvironment, TableEnvironment}
-import org.apache.flink.table.plan.schema.DataStreamTable
+import org.apache.flink.table.api.{StreamTableEnvironment, TableEnvironment, TableImpl}
 import org.apache.flink.table.plan.stats.FlinkStatistic
-import org.apache.flink.table.types.utils.TypeConversions
 
 object StreamTableEnvUtil {
 
@@ -42,13 +40,8 @@ object StreamTableEnvUtil {
       fieldNames: Option[Array[String]],
       fieldNullables: Option[Array[Boolean]],
       statistic: Option[FlinkStatistic]): Unit = {
-    val (typeFieldNames, fieldIdxs) =
-      tEnv.getFieldInfo(
-        TypeConversions.fromLegacyInfoToDataType(dataStream.getTransformation.getOutputType))
-    val boundedStreamTable = new DataStreamTable[T](
-      dataStream, fieldIdxs, fieldNames.getOrElse(typeFieldNames), fieldNullables)
-    val withStatistic = boundedStreamTable.copy(statistic.getOrElse(FlinkStatistic.UNKNOWN))
-    tEnv.registerTableInternal(name, withStatistic)
+    val queryOperation = tEnv.asQueryOperation(dataStream, fieldNames, fieldNullables, statistic)
+    tEnv.registerTable(name, new TableImpl(tEnv, queryOperation))
   }
 
 }
diff --git a/flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/util/TableTestBase.scala b/flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/util/TableTestBase.scala
index 6342018..de0b33b 100644
--- a/flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/util/TableTestBase.scala
+++ b/flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/util/TableTestBase.scala
@@ -96,11 +96,11 @@ abstract class TableTestUtil(test: TableTestBase) {
   // scala env
   val env = new StreamExecutionEnvironment(javaEnv)
 
-  def getTableEnv: TableEnvironment
-
   // a counter for unique table names
   private var counter = 0
 
+  def getTableEnv: TableEnvironment
+
   /**
     * Create a [[TestTableSource]] with the given schema,
     * and registers this TableSource under a unique name into the TableEnvironment's catalog.
@@ -153,7 +153,15 @@ abstract class TableTestUtil(test: TableTestBase) {
       name: String,
       types: Array[TypeInformation[_]],
       fields: Array[String],
-      statistic: FlinkStatistic = FlinkStatistic.UNKNOWN): Table
+      statistic: FlinkStatistic = FlinkStatistic.UNKNOWN): Table = {
+    val tableEnv = getTableEnv
+    val schema = new TableSchema(fields, types)
+    val isBatch = tableEnv.isBatch
+    val tableSource = new TestTableSource(isBatch, schema)
+    val table = new TableSourceTable[BaseRow](tableSource, isBatch, statistic)
+    tableEnv.registerTableInternal(name, table)
+    tableEnv.scan(name)
+  }
 
   /**
     * Create a [[DataStream]] with the given schema,
@@ -490,19 +498,6 @@ case class StreamTableTestUtil(test: TableTestBase) extends TableTestUtil(test)
     tableEnv.scan(name)
   }
 
-  override def addTableSource(
-      name: String,
-      types: Array[TypeInformation[_]],
-      names: Array[String],
-      statistic: FlinkStatistic = FlinkStatistic.UNKNOWN): Table = {
-    val tableEnv = getTableEnv
-    val schema = new TableSchema(names, types)
-    val tableSource = new TestTableSource(true, schema)
-    val table = new TableSourceTable[BaseRow](tableSource, true, statistic)
-    tableEnv.registerTableInternal(name, table)
-    tableEnv.scan(name)
-  }
-
   def verifyPlanWithTrait(): Unit = {
     doVerifyPlan(
       SqlExplainLevel.EXPPLAN_ATTRIBUTES,
@@ -603,19 +598,6 @@ case class BatchTableTestUtil(test: TableTestBase) extends TableTestUtil(test) {
     tableEnv.scan(name)
   }
 
-  override def addTableSource(
-      name: String,
-      types: Array[TypeInformation[_]],
-      names: Array[String],
-      statistic: FlinkStatistic = FlinkStatistic.UNKNOWN): Table = {
-    val tableEnv = getTableEnv
-    val schema = new TableSchema(names, types)
-    val tableSource = new TestTableSource(true, schema)
-    val table = new TableSourceTable[BaseRow](tableSource, false, statistic)
-    tableEnv.registerTableInternal(name, table)
-    tableEnv.scan(name)
-  }
-
   def buildBatchProgram(firstProgramNameToRemove: String): Unit = {
     val program = FlinkBatchProgram.buildProgram(tableEnv.getConfig.getConf)
     var startRemove = false


[flink] 01/03: [FLINK-12815] [table-planner-blink] Do not register the intermediate optimization result as a table in batch and stream CommonSubGraphBasedOptimizer

Posted by ku...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kurt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git

commit 9a292e228533520fc4be4da6cca99f6fb7dde80a
Author: godfreyhe <go...@163.com>
AuthorDate: Wed Jun 12 19:50:08 2019 +0800

    [FLINK-12815] [table-planner-blink] Do not register the intermediate optimization result as a table in batch and stream CommonSubGraphBasedOptimizer
---
 .../BatchCommonSubGraphBasedOptimizer.scala        | 15 ++++-------
 .../optimize/CommonSubGraphBasedOptimizer.scala    | 29 +++++++++++++++++++--
 .../flink/table/plan/optimize/RelNodeBlock.scala   |  4 +--
 .../StreamCommonSubGraphBasedOptimizer.scala       | 30 +++++++++-------------
 4 files changed, 46 insertions(+), 32 deletions(-)

diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/optimize/BatchCommonSubGraphBasedOptimizer.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/optimize/BatchCommonSubGraphBasedOptimizer.scala
index 6071cf1..073d673 100644
--- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/optimize/BatchCommonSubGraphBasedOptimizer.scala
+++ b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/optimize/BatchCommonSubGraphBasedOptimizer.scala
@@ -18,7 +18,7 @@
 
 package org.apache.flink.table.plan.optimize
 
-import org.apache.flink.table.api.{BatchTableEnvironment, TableConfig, TableImpl}
+import org.apache.flink.table.api.{BatchTableEnvironment, TableConfig}
 import org.apache.flink.table.plan.nodes.physical.batch.BatchExecSink
 import org.apache.flink.table.plan.optimize.program.{BatchOptimizeContext, FlinkBatchProgram}
 import org.apache.flink.table.plan.schema.IntermediateRelTable
@@ -53,20 +53,15 @@ class BatchCommonSubGraphBasedOptimizer(tEnv: BatchTableEnvironment)
     optimizedTree match {
       case _: BatchExecSink[_] => // ignore
       case _ =>
-        val name = tEnv.createUniqueTableName()
-        registerIntermediateTable(name, optimizedTree)
-        val newTable = tEnv.scan(name)
-        block.setNewOutputNode(newTable.asInstanceOf[TableImpl].getRelNode)
+        val name = createUniqueIntermediateRelTableName
+        val intermediateRelTable =  new IntermediateRelTable(optimizedTree)
+        val newTableScan = wrapIntermediateRelTableToTableScan(intermediateRelTable, name)
+        block.setNewOutputNode(newTableScan)
         block.setOutputTableName(name)
     }
     block.setOptimizedPlan(optimizedTree)
   }
 
-  private def registerIntermediateTable(name: String, relNode: RelNode): Unit = {
-    val table = new IntermediateRelTable(relNode)
-    tEnv.registerTableInternal(name, table)
-  }
-
   /**
     * Generates the optimized [[RelNode]] tree from the original relational node tree.
     *
diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/optimize/CommonSubGraphBasedOptimizer.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/optimize/CommonSubGraphBasedOptimizer.scala
index 8627d86..e7f720b 100644
--- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/optimize/CommonSubGraphBasedOptimizer.scala
+++ b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/optimize/CommonSubGraphBasedOptimizer.scala
@@ -18,12 +18,15 @@
 
 package org.apache.flink.table.plan.optimize
 
-import org.apache.flink.table.plan.schema.IntermediateRelTable
+import org.apache.flink.table.plan.schema.{FlinkRelOptTable, IntermediateRelTable}
 
 import org.apache.calcite.rel.core.TableScan
+import org.apache.calcite.rel.logical.LogicalTableScan
 import org.apache.calcite.rel.{RelNode, RelShuttleImpl}
 
 import java.util
+import java.util.Collections
+import java.util.concurrent.atomic.AtomicInteger
 
 import scala.collection.JavaConversions._
 
@@ -38,7 +41,7 @@ import scala.collection.JavaConversions._
   * 1. Decompose [[RelNode]] DAG into multiple [[RelNodeBlock]]s, and build [[RelNodeBlock]] DAG.
   * Each [[RelNodeBlock]] has only one sink output, and represents a common sub-graph.
   * 2. optimize recursively each [[RelNodeBlock]] from leaf block to root(sink) block,
-  * and register the optimized result of non-root block as an [[IntermediateRelTable]].
+  * and wrap the optimized result of non-root block as an [[IntermediateRelTable]].
   * 3. expand [[IntermediateRelTable]] into RelNode tree in each [[RelNodeBlock]].
   *
   * Currently, we choose this strategy based on the following considerations:
@@ -54,6 +57,16 @@ import scala.collection.JavaConversions._
 abstract class CommonSubGraphBasedOptimizer extends Optimizer {
 
   /**
+    * ID for IntermediateRelTable.
+    */
+  private val NEXT_ID = new AtomicInteger(0)
+
+  protected def createUniqueIntermediateRelTableName: String = {
+    val id = NEXT_ID.getAndIncrement()
+    s"IntermediateRelTable_$id"
+  }
+
+  /**
     * Generates the optimized [[RelNode]] DAG from the original relational nodes.
     * NOTES: the reused node in result DAG will be converted to the same RelNode,
     * and the result doesn't contain [[IntermediateRelTable]].
@@ -80,6 +93,18 @@ abstract class CommonSubGraphBasedOptimizer extends Optimizer {
   protected def doOptimize(roots: Seq[RelNode]): Seq[RelNodeBlock]
 
   /**
+    * Returns a new table scan which wraps the given IntermediateRelTable.
+    */
+  protected def wrapIntermediateRelTableToTableScan(
+      relTable: IntermediateRelTable,
+      name: String): TableScan = {
+    val cluster = relTable.relNode.getCluster
+    val table = FlinkRelOptTable.create(
+      null, relTable.getRowType(cluster.getTypeFactory), Collections.singletonList(name), relTable)
+    new LogicalTableScan(cluster, cluster.traitSet, table)
+  }
+
+  /**
     * Expand [[IntermediateRelTable]] in each RelNodeBlock.
     */
   private def expandIntermediateTableScan(nodes: Seq[RelNode]): Seq[RelNode] = {
diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/optimize/RelNodeBlock.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/optimize/RelNodeBlock.scala
index b25e3c1..6a464ff 100644
--- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/optimize/RelNodeBlock.scala
+++ b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/optimize/RelNodeBlock.scala
@@ -103,8 +103,8 @@ import scala.collection.mutable
   * }}}
   *
   * The optimizing order is from child block to parent. The optimized result (RelNode)
-  * will be registered into tables first, and then be converted to a new TableScan which is the
-  * new output node of current block and is also the input of its parent blocks.
+  * will be wrapped as an IntermediateRelTable first, and then be converted to a new TableScan
+  * which is the new output node of current block and is also the input of its parent blocks.
   *
   * @param outputNode A RelNode of the output in the block, which could be a [[Sink]] or
   * other RelNode which data outputs to multiple [[Sink]]s.
diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/optimize/StreamCommonSubGraphBasedOptimizer.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/optimize/StreamCommonSubGraphBasedOptimizer.scala
index 1ae7151..a30f1d2 100644
--- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/optimize/StreamCommonSubGraphBasedOptimizer.scala
+++ b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/optimize/StreamCommonSubGraphBasedOptimizer.scala
@@ -18,7 +18,7 @@
 
 package org.apache.flink.table.plan.optimize
 
-import org.apache.flink.table.api.{StreamTableEnvironment, TableConfig, TableImpl}
+import org.apache.flink.table.api.{StreamTableEnvironment, TableConfig}
 import org.apache.flink.table.plan.`trait`.{AccMode, AccModeTraitDef, UpdateAsRetractionTraitDef}
 import org.apache.flink.table.plan.metadata.FlinkRelMetadataQuery
 import org.apache.flink.table.plan.nodes.calcite.Sink
@@ -111,10 +111,10 @@ class StreamCommonSubGraphBasedOptimizer(tEnv: StreamTableEnvironment)
           isSinkBlock = isSinkBlock)
         val isAccRetract = optimizedPlan.getTraitSet
           .getTrait(AccModeTraitDef.INSTANCE).getAccMode == AccMode.AccRetract
-        val name = tEnv.createUniqueTableName()
-        registerIntermediateTable(tEnv, name, optimizedPlan, isAccRetract)
-        val newTable = tEnv.scan(name)
-        block.setNewOutputNode(newTable.asInstanceOf[TableImpl].getRelNode)
+        val name = createUniqueIntermediateRelTableName
+        val intermediateRelTable = createIntermediateRelTable(optimizedPlan, isAccRetract)
+        val newTableScan = wrapIntermediateRelTableToTableScan(intermediateRelTable, name)
+        block.setNewOutputNode(newTableScan)
         block.setOutputTableName(name)
         block.setOptimizedPlan(optimizedPlan)
     }
@@ -181,10 +181,10 @@ class StreamCommonSubGraphBasedOptimizer(tEnv: StreamTableEnvironment)
       case o =>
         val optimizedPlan = optimizeTree(
           o, retractionFromRoot, isSinkBlock = isSinkBlock)
-        val name = tEnv.createUniqueTableName()
-        registerIntermediateTable(tEnv, name, optimizedPlan, isAccRetract = false)
-        val newTable = tEnv.scan(name)
-        block.setNewOutputNode(newTable.asInstanceOf[TableImpl].getRelNode)
+        val name = createUniqueIntermediateRelTableName
+        val intermediateRelTable = createIntermediateRelTable(optimizedPlan, isAccRetract = false)
+        val newTableScan = wrapIntermediateRelTableToTableScan(intermediateRelTable, name)
+        block.setNewOutputNode(newTableScan)
         block.setOutputTableName(name)
         block.setOptimizedPlan(optimizedPlan)
     }
@@ -242,11 +242,9 @@ class StreamCommonSubGraphBasedOptimizer(tEnv: StreamTableEnvironment)
     }
   }
 
-  private def registerIntermediateTable(
-      tEnv: StreamTableEnvironment,
-      name: String,
+  private def createIntermediateRelTable(
       relNode: RelNode,
-      isAccRetract: Boolean): Unit = {
+      isAccRetract: Boolean): IntermediateRelTable = {
     val uniqueKeys = getUniqueKeys(relNode)
     val monotonicity = FlinkRelMetadataQuery
       .reuseOrCreate(tEnv.getRelBuilder.getCluster.getMetadataQuery)
@@ -256,11 +254,7 @@ class StreamCommonSubGraphBasedOptimizer(tEnv: StreamTableEnvironment)
       .relModifiedMonotonicity(monotonicity)
       .build()
 
-    val table = new IntermediateRelTable(
-      relNode,
-      isAccRetract,
-      statistic)
-    tEnv.registerTableInternal(name, table)
+    new IntermediateRelTable(relNode, isAccRetract, statistic)
   }
 
   private def getUniqueKeys(relNode: RelNode): util.Set[_ <: util.Set[String]] = {


[flink] 03/03: [FLINK-12815] [table-planner-blink] Support CatalogManager in blink planner

Posted by ku...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kurt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git

commit 4a727c0a224921ec03d9ecc81455dd2815c89d15
Author: godfreyhe <go...@163.com>
AuthorDate: Thu Jun 20 16:59:24 2019 +0800

    [FLINK-12815] [table-planner-blink] Support CatalogManager in blink planner
    
    This closes #8707
---
 .../apache/calcite/jdbc/CalciteSchemaBuilder.java  |   40 +
 .../table/calcite/FlinkCalciteCatalogReader.java   |   32 +-
 .../flink/table/catalog/CatalogCalciteSchema.java  |   88 ++
 .../table/catalog/CatalogManagerCalciteSchema.java |   88 ++
 .../flink/table/catalog/DatabaseCalciteSchema.java |  133 ++
 .../apache/flink/table/catalog/FlinkSchema.java    |   59 +
 .../catalog/QueryOperationCatalogViewTable.java    |  106 ++
 .../operations/RichTableSourceQueryOperation.java  |   69 +
 .../flink/table/plan/QueryOperationConverter.java  |   46 +-
 .../apache/flink/table/planner/PlannerContext.java |   30 +-
 .../flink/table/api/BatchTableEnvironment.scala    |   10 +-
 .../flink/table/api/StreamTableEnvironment.scala   |    6 +-
 .../org/apache/flink/table/api/TableConfig.scala   |   44 +
 .../apache/flink/table/api/TableEnvironment.scala  |  395 +++---
 .../table/api/java/BatchTableEnvironment.scala     |   37 +-
 .../table/api/java/StreamTableEnvironment.scala    |   39 +-
 .../table/api/scala/BatchTableEnvironment.scala    |   36 +-
 .../table/api/scala/StreamTableEnvironment.scala   |   40 +-
 .../flink/table/calcite/FlinkRelBuilder.scala      |    8 +
 .../flink/table/plan/optimize/RelNodeBlock.scala   |    2 +-
 .../StreamCommonSubGraphBasedOptimizer.scala       |    4 +-
 .../plan/optimize/program/FlinkBatchProgram.scala  |    2 +-
 .../plan/optimize/program/FlinkStreamProgram.scala |    2 +-
 .../flink/table/plan/schema/FlinkRelOptTable.scala |    7 +
 .../table/plan/schema/IntermediateRelTable.scala   |    4 -
 .../apache/flink/table/plan/schema/RelTable.scala  |   51 -
 .../flink/table/plan/stats/FlinkStatistic.scala    |   21 +
 .../apache/flink/table/plan/util/RelShuttles.scala |   80 +-
 .../flink/table/util/JavaScalaConversionUtil.scala |    4 +
 .../digest/testGetDigestWithDynamicFunction.out    |    6 +-
 .../testGetDigestWithDynamicFunctionView.out       |    6 +-
 .../apache/flink/table/api/batch/ExplainTest.xml   |  132 +-
 .../flink/table/api/batch/TableStatsTest.xml       |   28 +-
 .../apache/flink/table/api/stream/ExplainTest.xml  |  132 +-
 .../flink/table/catalog/PathResolutionTest.xml     |  195 +++
 .../apache/flink/table/plan/batch/sql/CalcTest.xml |   76 +-
 .../table/plan/batch/sql/DagOptimizationTest.xml   |  208 +--
 .../table/plan/batch/sql/DeadlockBreakupTest.xml   |   54 +-
 .../flink/table/plan/batch/sql/LimitTest.xml       |   32 +-
 .../apache/flink/table/plan/batch/sql/RankTest.xml |   28 +-
 .../table/plan/batch/sql/RemoveCollationTest.xml   |  160 +--
 .../table/plan/batch/sql/RemoveShuffleTest.xml     |  312 ++---
 .../table/plan/batch/sql/SetOperatorsTest.xml      |   52 +-
 .../apache/flink/table/plan/batch/sql/SinkTest.xml |   10 +-
 .../flink/table/plan/batch/sql/SortLimitTest.xml   |   32 +-
 .../apache/flink/table/plan/batch/sql/SortTest.xml |   20 +-
 .../table/plan/batch/sql/SubplanReuseTest.xml      |  250 ++--
 .../flink/table/plan/batch/sql/TableScanTest.xml   |    4 +-
 .../flink/table/plan/batch/sql/TableSourceTest.xml |   12 +-
 .../flink/table/plan/batch/sql/UnionTest.xml       |   20 +-
 .../flink/table/plan/batch/sql/UnnestTest.xml      |   40 +-
 .../batch/sql/agg/AggregateReduceGroupingTest.xml  |  212 +--
 .../plan/batch/sql/agg/DistinctAggregateTest.xml   |   40 +-
 .../table/plan/batch/sql/agg/GroupingSetsTest.xml  |  144 +-
 .../table/plan/batch/sql/agg/HashAggregateTest.xml |  156 +--
 .../table/plan/batch/sql/agg/OverAggregateTest.xml |   92 +-
 .../table/plan/batch/sql/agg/SortAggregateTest.xml |  192 +--
 .../plan/batch/sql/agg/WindowAggregateTest.xml     |  228 +--
 .../plan/batch/sql/join/BroadcastHashJoinTest.xml  |  110 +-
 .../sql/join/BroadcastHashSemiAntiJoinTest.xml     |  598 ++++----
 .../table/plan/batch/sql/join/LookupJoinTest.xml   |   54 +-
 .../plan/batch/sql/join/NestedLoopJoinTest.xml     |  226 +--
 .../batch/sql/join/NestedLoopSemiAntiJoinTest.xml  |  800 +++++------
 .../table/plan/batch/sql/join/SemiAntiJoinTest.xml |  800 +++++------
 .../plan/batch/sql/join/ShuffledHashJoinTest.xml   |  136 +-
 .../sql/join/ShuffledHashSemiAntiJoinTest.xml      |  598 ++++----
 .../plan/batch/sql/join/SingleRowJoinTest.xml      |   58 +-
 .../plan/batch/sql/join/SortMergeJoinTest.xml      |  142 +-
 .../batch/sql/join/SortMergeSemiAntiJoinTest.xml   |  622 ++++----
 .../plan/nodes/resource/ExecNodeResourceTest.xml   |   56 +-
 .../logical/AggregateReduceGroupingRuleTest.xml    |  212 +--
 .../logical/CalcPruneAggregateCallRuleTest.xml     |   72 +-
 .../rules/logical/CalcRankTransposeRuleTest.xml    |   36 +-
 .../rules/logical/ConvertToNotInOrInRuleTest.xml   |   88 +-
 .../logical/DecomposeGroupingSetsRuleTest.xml      |   28 +-
 ...nkAggregateExpandDistinctAggregatesRuleTest.xml |   84 +-
 .../FlinkAggregateInnerJoinTransposeRuleTest.xml   |   68 +-
 .../FlinkAggregateOuterJoinTransposeRuleTest.xml   |   72 +-
 .../rules/logical/FlinkAggregateRemoveRuleTest.xml |   96 +-
 .../plan/rules/logical/FlinkCalcMergeRuleTest.xml  |   12 +-
 .../plan/rules/logical/FlinkFilterJoinRuleTest.xml |  112 +-
 .../logical/FlinkJoinPushExpressionsRuleTest.xml   |   32 +-
 .../rules/logical/FlinkLimit0RemoveRuleTest.xml    |   38 +-
 .../FlinkLogicalRankRuleForConstantRangeTest.xml   |   60 +-
 .../FlinkLogicalRankRuleForRangeEndTest.xml        |   52 +-
 .../rules/logical/FlinkPruneEmptyRulesTest.xml     |   10 +-
 .../FlinkSemiAntiJoinFilterTransposeRuleTest.xml   |   16 +-
 .../FlinkSemiAntiJoinJoinTransposeRuleTest.xml     |  432 +++---
 .../FlinkSemiAntiJoinProjectTransposeRuleTest.xml  |   24 +-
 .../JoinConditionEqualityTransferRuleTest.xml      |  112 +-
 .../logical/JoinConditionTypeCoerceRuleTest.xml    |   74 +-
 .../JoinDependentConditionDerivationRuleTest.xml   |   68 +-
 .../rules/logical/JoinDeriveNullFilterRuleTest.xml |   72 +-
 .../plan/rules/logical/LogicalUnnestRuleTest.xml   |   40 +-
 .../logical/ProjectPruneAggregateCallRuleTest.xml  |   72 +-
 .../ProjectSemiAntiJoinTransposeRuleTest.xml       |  148 +-
 .../PushProjectIntoTableSourceScanRuleTest.xml     |   20 +-
 .../logical/RankNumberColumnRemoveRuleTest.xml     |   16 +-
 .../ReplaceIntersectWithSemiJoinRuleTest.xml       |   32 +-
 .../logical/ReplaceMinusWithAntiJoinRuleTest.xml   |   32 +-
 .../plan/rules/logical/RewriteCoalesceRuleTest.xml |   40 +-
 .../logical/SimplifyFilterConditionRuleTest.xml    |   68 +-
 .../logical/SimplifyJoinConditionRuleTest.xml      |   18 +-
 .../plan/rules/logical/SplitAggregateRuleTest.xml  |   76 +-
 .../rules/logical/WindowGroupReorderRuleTest.xml   |   40 +-
 .../subquery/FlinkRewriteSubQueryRuleTest.xml      |  152 +-
 .../logical/subquery/SubQueryAntiJoinTest.xml      |  756 +++++-----
 .../logical/subquery/SubQuerySemiJoinTest.xml      | 1480 ++++++++++----------
 .../batch/RemoveRedundantLocalHashAggRuleTest.xml  |   12 +-
 .../batch/RemoveRedundantLocalRankRuleTest.xml     |   12 +-
 .../batch/RemoveRedundantLocalSortAggRuleTest.xml  |   16 +-
 .../rules/physical/stream/RetractionRulesTest.xml  |   20 +-
 .../stream/RetractionRulesWithTwoStageAggTest.xml  |   16 +-
 .../flink/table/plan/stream/sql/CalcTest.xml       |   76 +-
 .../table/plan/stream/sql/DagOptimizationTest.xml  |  236 ++--
 .../flink/table/plan/stream/sql/LimitTest.xml      |  112 +-
 .../plan/stream/sql/ModifiedMonotonicityTest.xml   |   24 +-
 .../flink/table/plan/stream/sql/RankTest.xml       |  104 +-
 .../stream/sql/RelTimeIndicatorConverterTest.xml   |   58 +-
 .../table/plan/stream/sql/SetOperatorsTest.xml     |   52 +-
 .../flink/table/plan/stream/sql/SinkTest.xml       |   58 +-
 .../flink/table/plan/stream/sql/SortLimitTest.xml  |  204 +--
 .../flink/table/plan/stream/sql/SortTest.xml       |   36 +-
 .../table/plan/stream/sql/SubplanReuseTest.xml     |  156 +--
 .../flink/table/plan/stream/sql/TableScanTest.xml  |    8 +-
 .../table/plan/stream/sql/TableSourceTest.xml      |   36 +-
 .../flink/table/plan/stream/sql/UnionTest.xml      |   20 +-
 .../flink/table/plan/stream/sql/UnnestTest.xml     |   40 +-
 .../table/plan/stream/sql/agg/AggregateTest.xml    |   68 +-
 .../plan/stream/sql/agg/DistinctAggregateTest.xml  |  272 ++--
 .../table/plan/stream/sql/agg/GroupingSetsTest.xml |  144 +-
 .../stream/sql/agg/IncrementalAggregateTest.xml    |   68 +-
 .../plan/stream/sql/agg/OverAggregateTest.xml      |   72 +-
 .../plan/stream/sql/agg/TwoStageAggregateTest.xml  |   28 +-
 .../plan/stream/sql/agg/WindowAggregateTest.xml    |   56 +-
 .../flink/table/plan/stream/sql/join/JoinTest.xml  |  278 ++--
 .../table/plan/stream/sql/join/LookupJoinTest.xml  |   48 +-
 .../plan/stream/sql/join/SemiAntiJoinTest.xml      |  792 +++++------
 .../table/plan/stream/sql/join/WindowJoinTest.xml  |  124 +-
 .../flink/table/api/TableEnvironmentTest.scala     |   18 +-
 .../flink/table/codegen/agg/AggTestBase.scala      |    2 +-
 .../plan/metadata/FlinkRelMdHandlerTestBase.scala  |    3 +-
 .../plan/nodes/resource/ExecNodeResourceTest.scala |   12 +-
 .../table/plan/util/FlinkRelOptUtilTest.scala      |    4 +-
 .../apache/flink/table/util/TableTestBase.scala    |   98 +-
 145 files changed, 8936 insertions(+), 7863 deletions(-)

diff --git a/flink-table/flink-table-planner-blink/src/main/java/org/apache/calcite/jdbc/CalciteSchemaBuilder.java b/flink-table/flink-table-planner-blink/src/main/java/org/apache/calcite/jdbc/CalciteSchemaBuilder.java
new file mode 100644
index 0000000..fe7f7c1
--- /dev/null
+++ b/flink-table/flink-table-planner-blink/src/main/java/org/apache/calcite/jdbc/CalciteSchemaBuilder.java
@@ -0,0 +1,40 @@
+/*
+ * 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.calcite.jdbc;
+
+import org.apache.calcite.schema.Schema;
+
+/**
+ * This class is used to create a {@link CalciteSchema} with a given {@link Schema} as the root.
+ */
+public class CalciteSchemaBuilder {
+
+	/**
+	 * Creates a {@link CalciteSchema} with a given {@link Schema} as the root.
+	 *
+	 * @param root schema to use as a root schema
+	 * @return calcite schema with given schema as the root
+	 */
+	public static CalciteSchema asRootSchema(Schema root) {
+		return new SimpleCalciteSchema(null, root, "");
+	}
+
+	private CalciteSchemaBuilder() {
+	}
+}
diff --git a/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/calcite/FlinkCalciteCatalogReader.java b/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/calcite/FlinkCalciteCatalogReader.java
index fda0f80..c83f629 100644
--- a/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/calcite/FlinkCalciteCatalogReader.java
+++ b/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/calcite/FlinkCalciteCatalogReader.java
@@ -21,19 +21,17 @@ package org.apache.flink.table.calcite;
 import org.apache.flink.table.plan.schema.FlinkRelOptTable;
 import org.apache.flink.table.plan.schema.FlinkTable;
 
-import org.apache.flink.shaded.guava18.com.google.common.collect.ImmutableList;
-
 import org.apache.calcite.config.CalciteConnectionConfig;
 import org.apache.calcite.jdbc.CalciteSchema;
 import org.apache.calcite.prepare.CalciteCatalogReader;
 import org.apache.calcite.prepare.Prepare;
 import org.apache.calcite.rel.type.RelDataTypeFactory;
-import org.apache.calcite.sql.validate.SqlNameMatcher;
 import org.apache.calcite.sql.validate.SqlNameMatchers;
 
-import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
 
 /**
  * Flink specific {@link CalciteCatalogReader} that changes the RelOptTable which wrapped a
@@ -43,35 +41,21 @@ public class FlinkCalciteCatalogReader extends CalciteCatalogReader {
 
 	public FlinkCalciteCatalogReader(
 		CalciteSchema rootSchema,
-		List<String> defaultSchemas,
+		List<List<String>> defaultSchemas,
 		RelDataTypeFactory typeFactory,
 		CalciteConnectionConfig config) {
 
-		this(
+		super(
 			rootSchema,
 			SqlNameMatchers.withCaseSensitive(config != null && config.caseSensitive()),
-			getDefaultSchemas(defaultSchemas),
+				Stream.concat(
+					defaultSchemas.stream(),
+					Stream.of(Collections.<String>emptyList())
+				).collect(Collectors.toList()),
 			typeFactory,
 			config);
 	}
 
-	protected FlinkCalciteCatalogReader(
-		CalciteSchema rootSchema,
-		SqlNameMatcher nameMatcher,
-		List<List<String>> schemaPaths,
-		RelDataTypeFactory typeFactory,
-		CalciteConnectionConfig config) {
-
-		super(rootSchema, nameMatcher, schemaPaths, typeFactory, config);
-	}
-
-	private static List<List<String>> getDefaultSchemas(List<String> defaultSchemas) {
-		List<List<String>> paths = new ArrayList<>(ImmutableList.of(defaultSchemas));
-		paths.add(new ArrayList<>());
-
-		return Collections.unmodifiableList(paths);
-	}
-
 	@Override
 	public Prepare.PreparingTable getTable(List<String> names) {
 		Prepare.PreparingTable originRelOptTable = super.getTable(names);
diff --git a/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/catalog/CatalogCalciteSchema.java b/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/catalog/CatalogCalciteSchema.java
new file mode 100644
index 0000000..e816c8f
--- /dev/null
+++ b/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/catalog/CatalogCalciteSchema.java
@@ -0,0 +1,88 @@
+/*
+ * 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.catalog;
+
+import org.apache.flink.annotation.Internal;
+
+import org.apache.calcite.linq4j.tree.Expression;
+import org.apache.calcite.schema.Schema;
+import org.apache.calcite.schema.SchemaPlus;
+import org.apache.calcite.schema.Schemas;
+import org.apache.calcite.schema.Table;
+
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * A mapping between Flink's catalog and Calcite's schema. This enables to look up and access objects(tables, views,
+ * functions, types) in SQL queries without registering them in advance. Databases are registered as sub-schemas
+ * in the schema.
+ */
+@Internal
+public class CatalogCalciteSchema extends FlinkSchema {
+
+	private final String catalogName;
+	private final Catalog catalog;
+
+	public CatalogCalciteSchema(String catalogName, Catalog catalog) {
+		this.catalogName = catalogName;
+		this.catalog = catalog;
+	}
+
+	/**
+	 * Look up a sub-schema (database) by the given sub-schema name.
+	 *
+	 * @param schemaName name of sub-schema to look up
+	 * @return the sub-schema with a given database name, or null
+	 */
+	@Override
+	public Schema getSubSchema(String schemaName) {
+		if (catalog.databaseExists(schemaName)) {
+			return new DatabaseCalciteSchema(schemaName, catalogName, catalog);
+		} else {
+			return null;
+		}
+	}
+
+	@Override
+	public Set<String> getSubSchemaNames() {
+		return new HashSet<>(catalog.listDatabases());
+	}
+
+	@Override
+	public Table getTable(String name) {
+		return null;
+	}
+
+	@Override
+	public Set<String> getTableNames() {
+		return new HashSet<>();
+	}
+
+	@Override
+	public Expression getExpression(SchemaPlus parentSchema, String name) {
+		return  Schemas.subSchemaExpression(parentSchema, name, getClass());
+	}
+
+	@Override
+	public boolean isMutable() {
+		return true;
+	}
+
+}
diff --git a/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/catalog/CatalogManagerCalciteSchema.java b/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/catalog/CatalogManagerCalciteSchema.java
new file mode 100644
index 0000000..c7238eb
--- /dev/null
+++ b/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/catalog/CatalogManagerCalciteSchema.java
@@ -0,0 +1,88 @@
+/*
+ * 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.catalog;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.api.TableException;
+
+import org.apache.calcite.linq4j.tree.Expression;
+import org.apache.calcite.schema.Schema;
+import org.apache.calcite.schema.SchemaPlus;
+import org.apache.calcite.schema.Table;
+
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * Bridge between the {@link CatalogManager} and the {@link Schema}. This way we can query Flink's specific catalogs
+ * from Calcite.
+ *
+ * <p>The mapping for {@link Catalog}s is modeled as a strict two-level reference structure for Flink in Calcite,
+ * the full path of objects is of format [catalog_name].[db_name].[meta-object_name].
+ *
+ * <p>It also supports {@link ExternalCatalog}s. An external catalog maps 1:1 to the Calcite's schema.
+ */
+@Internal
+public class CatalogManagerCalciteSchema extends FlinkSchema {
+
+	private final CatalogManager catalogManager;
+
+	public CatalogManagerCalciteSchema(CatalogManager catalogManager) {
+		this.catalogManager = catalogManager;
+	}
+
+	@Override
+	public Table getTable(String name) {
+		return null;
+	}
+
+	@Override
+	public Set<String> getTableNames() {
+		return Collections.emptySet();
+	}
+
+	@Override
+	public Schema getSubSchema(String name) {
+		Schema schema = catalogManager.getCatalog(name)
+			.map(catalog -> new CatalogCalciteSchema(name, catalog))
+			.orElse(null);
+
+		if (schema == null && catalogManager.getExternalCatalog(name).isPresent()) {
+			throw new TableException("ExternalCatalog is deprecated and is not supported in blink planner");
+		}
+		return schema;
+	}
+
+	@Override
+	public Set<String> getSubSchemaNames() {
+		return new HashSet<>(catalogManager.getCatalogs());
+	}
+
+	@Override
+	public Expression getExpression(SchemaPlus parentSchema, String name) {
+		return null;
+	}
+
+	@Override
+	public boolean isMutable() {
+		return false;
+	}
+
+}
diff --git a/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/catalog/DatabaseCalciteSchema.java b/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/catalog/DatabaseCalciteSchema.java
new file mode 100644
index 0000000..8b8b0861
--- /dev/null
+++ b/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/catalog/DatabaseCalciteSchema.java
@@ -0,0 +1,133 @@
+/*
+ * 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.catalog;
+
+import org.apache.flink.table.api.TableException;
+import org.apache.flink.table.catalog.exceptions.CatalogException;
+import org.apache.flink.table.catalog.exceptions.DatabaseNotExistException;
+import org.apache.flink.table.catalog.exceptions.TableNotExistException;
+import org.apache.flink.table.operations.DataStreamQueryOperation;
+import org.apache.flink.table.operations.QueryOperation;
+import org.apache.flink.table.operations.RichTableSourceQueryOperation;
+import org.apache.flink.table.plan.schema.TableSourceTable;
+import org.apache.flink.table.plan.stats.FlinkStatistic;
+
+import org.apache.calcite.linq4j.tree.Expression;
+import org.apache.calcite.schema.Schema;
+import org.apache.calcite.schema.SchemaPlus;
+import org.apache.calcite.schema.Schemas;
+import org.apache.calcite.schema.Table;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import static java.lang.String.format;
+
+/**
+ * A mapping between Flink catalog's database and Calcite's schema.
+ * Tables are registered as tables in the schema.
+ */
+class DatabaseCalciteSchema extends FlinkSchema {
+	private final String databaseName;
+	private final String catalogName;
+	private final Catalog catalog;
+
+	public DatabaseCalciteSchema(String databaseName, String catalogName, Catalog catalog) {
+		this.databaseName = databaseName;
+		this.catalogName = catalogName;
+		this.catalog = catalog;
+	}
+
+	@Override
+	public Table getTable(String tableName) {
+		ObjectPath tablePath = new ObjectPath(databaseName, tableName);
+
+		try {
+			if (!catalog.tableExists(tablePath)) {
+				return null;
+			}
+
+			CatalogBaseTable table = catalog.getTable(tablePath);
+
+			// TODO supports GenericCatalogView
+			if (table instanceof QueryOperationCatalogView) {
+				QueryOperationCatalogView view = (QueryOperationCatalogView) table;
+				QueryOperation operation = view.getQueryOperation();
+				if (operation instanceof DataStreamQueryOperation) {
+					List<String> qualifiedName = Arrays.asList(catalogName, databaseName, tableName);
+					((DataStreamQueryOperation) operation).setQualifiedName(qualifiedName);
+				} else if (operation instanceof RichTableSourceQueryOperation) {
+					List<String> qualifiedName = Arrays.asList(catalogName, databaseName, tableName);
+					((RichTableSourceQueryOperation) operation).setQualifiedName(qualifiedName);
+				}
+				return QueryOperationCatalogViewTable.createCalciteTable(view);
+			} else if (table instanceof ConnectorCatalogTable) {
+				ConnectorCatalogTable<?, ?> connectorTable = (ConnectorCatalogTable<?, ?>) table;
+				return connectorTable.getTableSource()
+					.map(tableSource -> new TableSourceTable<>(
+						tableSource,
+						!connectorTable.isBatch(),
+						FlinkStatistic.UNKNOWN())
+					).orElseThrow(() -> new TableException("Cannot query a sink only table."));
+			} else {
+				throw new TableException("Unsupported table type: " + table);
+			}
+		} catch (TableNotExistException | CatalogException e) {
+			// TableNotExistException should never happen, because we are checking it exists
+			// via catalog.tableExists
+			throw new TableException(format(
+				"A failure occurred when accessing table. Table path [%s, %s, %s]",
+				catalogName,
+				databaseName,
+				tableName), e);
+		}
+	}
+
+	@Override
+	public Set<String> getTableNames() {
+		try {
+			return new HashSet<>(catalog.listTables(databaseName));
+		} catch (DatabaseNotExistException e) {
+			throw new CatalogException(e);
+		}
+	}
+
+	@Override
+	public Schema getSubSchema(String s) {
+		return null;
+	}
+
+	@Override
+	public Set<String> getSubSchemaNames() {
+		return new HashSet<>();
+	}
+
+	@Override
+	public Expression getExpression(SchemaPlus parentSchema, String name) {
+		return Schemas.subSchemaExpression(parentSchema, name, getClass());
+	}
+
+	@Override
+	public boolean isMutable() {
+		return true;
+	}
+
+}
diff --git a/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/catalog/FlinkSchema.java b/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/catalog/FlinkSchema.java
new file mode 100644
index 0000000..c849f4b1
--- /dev/null
+++ b/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/catalog/FlinkSchema.java
@@ -0,0 +1,59 @@
+/*
+ * 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.catalog;
+
+import org.apache.calcite.rel.type.RelProtoDataType;
+import org.apache.calcite.schema.Function;
+import org.apache.calcite.schema.Schema;
+import org.apache.calcite.schema.SchemaVersion;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Set;
+
+/**
+ * Base class for flink {@link Schema}, which provides some default implementations.
+ */
+public abstract class FlinkSchema implements Schema {
+
+	@Override
+	public RelProtoDataType getType(String name) {
+		return null;
+	}
+
+	@Override
+	public Set<String> getTypeNames() {
+		return Collections.emptySet();
+	}
+
+	@Override
+	public Collection<Function> getFunctions(String name) {
+		return Collections.emptyList();
+	}
+
+	@Override
+	public Set<String> getFunctionNames() {
+		return Collections.emptySet();
+	}
+
+	@Override
+	public Schema snapshot(SchemaVersion version) {
+		return this;
+	}
+}
diff --git a/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/catalog/QueryOperationCatalogViewTable.java b/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/catalog/QueryOperationCatalogViewTable.java
new file mode 100644
index 0000000..5835397
--- /dev/null
+++ b/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/catalog/QueryOperationCatalogViewTable.java
@@ -0,0 +1,106 @@
+/*
+ * 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.catalog;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.api.TableSchema;
+import org.apache.flink.table.calcite.FlinkRelBuilder;
+import org.apache.flink.table.calcite.FlinkTypeFactory;
+import org.apache.flink.table.plan.schema.FlinkTable;
+import org.apache.flink.table.plan.stats.FlinkStatistic;
+import org.apache.flink.table.types.LogicalTypeDataTypeConverter;
+import org.apache.flink.table.types.logical.LogicalType;
+import org.apache.flink.table.util.JavaScalaConversionUtil;
+
+import org.apache.calcite.plan.RelOptTable;
+import org.apache.calcite.plan.RelOptUtil;
+import org.apache.calcite.rel.RelNode;
+import org.apache.calcite.rel.type.RelDataType;
+import org.apache.calcite.rel.type.RelDataTypeFactory;
+import org.apache.calcite.rel.type.RelProtoDataType;
+import org.apache.calcite.schema.TranslatableTable;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * A bridge between a Flink's specific {@link QueryOperationCatalogView} and a Calcite's
+ * {@link org.apache.calcite.schema.Table}. It implements {@link TranslatableTable} interface. This enables
+ * direct translation from {@link org.apache.flink.table.operations.QueryOperation} to {@link RelNode}.
+ *
+ * <p>NOTE: Due to legacy inconsistency in null handling in the {@link TableSchema} the translation might introduce
+ * additional cast to comply with manifested schema in
+ * {@link QueryOperationCatalogViewTable#getRowType(RelDataTypeFactory)}.
+ */
+@Internal
+public class QueryOperationCatalogViewTable extends FlinkTable implements TranslatableTable {
+	private final QueryOperationCatalogView catalogView;
+	private final RelProtoDataType rowType;
+	private final FlinkStatistic statistic;
+
+	public static QueryOperationCatalogViewTable createCalciteTable(QueryOperationCatalogView catalogView) {
+		return new QueryOperationCatalogViewTable(catalogView, typeFactory -> {
+			TableSchema tableSchema = catalogView.getSchema();
+			List<String> fieldNames = Arrays.asList(tableSchema.getFieldNames());
+			List<LogicalType> fieldTypes = Arrays.stream(tableSchema.getFieldDataTypes()).map(
+					LogicalTypeDataTypeConverter::fromDataTypeToLogicalType).collect(Collectors.toList());
+			return ((FlinkTypeFactory) typeFactory).buildRelNodeRowType(
+					JavaScalaConversionUtil.toScala(fieldNames),
+					JavaScalaConversionUtil.toScala(fieldTypes));
+		}, FlinkStatistic.UNKNOWN()); // TODO supports statistic
+	}
+
+	private QueryOperationCatalogViewTable(
+			QueryOperationCatalogView catalogView,
+			RelProtoDataType rowType,
+			FlinkStatistic statistic) {
+		this.catalogView = catalogView;
+		this.rowType = rowType;
+		this.statistic = statistic;
+	}
+
+	@Override
+	public RelNode toRel(RelOptTable.ToRelContext context, RelOptTable relOptTable) {
+		FlinkRelBuilder relBuilder = FlinkRelBuilder.of(context.getCluster(), relOptTable);
+
+		RelNode relNode = relBuilder.queryOperation(catalogView.getQueryOperation()).build();
+		return RelOptUtil.createCastRel(relNode, rowType.apply(relBuilder.getTypeFactory()), false);
+	}
+
+	@Override
+	public RelDataType getRowType(RelDataTypeFactory typeFactory) {
+		return rowType.apply(typeFactory);
+	}
+
+	public QueryOperationCatalogView getCatalogView() {
+		return catalogView;
+	}
+
+	@Override
+	public FlinkStatistic getStatistic() {
+		return statistic;
+	}
+
+	@Override
+	public FlinkTable copy(FlinkStatistic statistic) {
+		return new QueryOperationCatalogViewTable(catalogView, rowType, statistic);
+	}
+
+}
diff --git a/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/operations/RichTableSourceQueryOperation.java b/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/operations/RichTableSourceQueryOperation.java
new file mode 100644
index 0000000..62e2a42
--- /dev/null
+++ b/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/operations/RichTableSourceQueryOperation.java
@@ -0,0 +1,69 @@
+/*
+ * 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.operations;
+
+import org.apache.flink.annotation.Internal;
+import org.apache.flink.table.plan.stats.FlinkStatistic;
+import org.apache.flink.table.sources.TableSource;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * A {@link TableSourceQueryOperation} with {@link FlinkStatistic} and qualifiedName.
+ * TODO this class should be deleted after unique key in TableSchema is ready
+ * and setting catalog statistic to TableSourceTable in DatabaseCalciteSchema is ready
+ */
+@Internal
+public class RichTableSourceQueryOperation<T> extends TableSourceQueryOperation<T> {
+	private final FlinkStatistic statistic;
+	private List<String> qualifiedName;
+
+	public RichTableSourceQueryOperation(
+		TableSource<T> tableSource,
+		boolean isBatch,
+		FlinkStatistic statistic) {
+		super(tableSource, isBatch);
+		this.statistic = statistic;
+	}
+
+	@Override
+	public String asSummaryString() {
+		Map<String, Object> args = new HashMap<>();
+		args.put("fields", getTableSource().getTableSchema().getFieldNames());
+		if (statistic != FlinkStatistic.UNKNOWN()) {
+			args.put("statistic", statistic.toString());
+		}
+
+		return OperationUtils.formatWithChildren("TableSource", args, getChildren(), Operation::asSummaryString);
+	}
+
+	public List<String> getQualifiedName() {
+		return qualifiedName;
+	}
+
+	public void setQualifiedName(List<String> qualifiedName) {
+		this.qualifiedName = qualifiedName;
+	}
+
+	public FlinkStatistic getStatistic() {
+		return statistic;
+	}
+}
diff --git a/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/plan/QueryOperationConverter.java b/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/plan/QueryOperationConverter.java
index d7277f7..0c35431 100644
--- a/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/plan/QueryOperationConverter.java
+++ b/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/plan/QueryOperationConverter.java
@@ -33,12 +33,18 @@ import org.apache.flink.table.operations.ProjectQueryOperation;
 import org.apache.flink.table.operations.QueryOperation;
 import org.apache.flink.table.operations.QueryOperationDefaultVisitor;
 import org.apache.flink.table.operations.QueryOperationVisitor;
+import org.apache.flink.table.operations.RichTableSourceQueryOperation;
 import org.apache.flink.table.operations.SetQueryOperation;
 import org.apache.flink.table.operations.SortQueryOperation;
 import org.apache.flink.table.operations.TableSourceQueryOperation;
 import org.apache.flink.table.operations.WindowAggregateQueryOperation;
 import org.apache.flink.table.plan.schema.DataStreamTable;
 import org.apache.flink.table.plan.schema.FlinkRelOptTable;
+import org.apache.flink.table.plan.schema.TableSourceTable;
+import org.apache.flink.table.plan.stats.FlinkStatistic;
+import org.apache.flink.table.sources.LookupableTableSource;
+import org.apache.flink.table.sources.StreamTableSource;
+import org.apache.flink.table.sources.TableSource;
 
 import org.apache.calcite.rel.RelNode;
 import org.apache.calcite.rel.logical.LogicalTableScan;
@@ -130,8 +136,38 @@ public class QueryOperationConverter extends QueryOperationDefaultVisitor<RelNod
 		}
 
 		@Override
-		public <U> RelNode visit(TableSourceQueryOperation<U> tableSourceTable) {
-			throw new UnsupportedOperationException("Unsupported now");
+		public <U> RelNode visit(TableSourceQueryOperation<U> tableSourceOperation) {
+			TableSource<?> tableSource = tableSourceOperation.getTableSource();
+			boolean isBatch;
+			if (tableSource instanceof LookupableTableSource) {
+				isBatch = tableSourceOperation.isBatch();
+			} else if (tableSource instanceof StreamTableSource) {
+				isBatch = ((StreamTableSource<?>) tableSource).isBounded();
+			} else {
+				throw new TableException(String.format("%s is not supported.", tableSource.getClass().getSimpleName()));
+			}
+
+			FlinkStatistic statistic;
+			List<String> names;
+			if (tableSourceOperation instanceof RichTableSourceQueryOperation &&
+				((RichTableSourceQueryOperation<U>) tableSourceOperation).getQualifiedName() != null) {
+				statistic = ((RichTableSourceQueryOperation<U>) tableSourceOperation).getStatistic();
+				names = ((RichTableSourceQueryOperation<U>) tableSourceOperation).getQualifiedName();
+			} else {
+				statistic = FlinkStatistic.UNKNOWN();
+				// TableSourceScan requires a unique name of a Table for computing a digest.
+				// We are using the identity hash of the TableSource object.
+				String refId = "Unregistered_TableSource_" + System.identityHashCode(tableSource);
+				names = Collections.singletonList(refId);
+			}
+
+			TableSourceTable<?> tableSourceTable = new TableSourceTable<>(tableSource, !isBatch, statistic);
+			FlinkRelOptTable table = FlinkRelOptTable.create(
+				relBuilder.getRelOptSchema(),
+				tableSourceTable.getRowType(relBuilder.getTypeFactory()),
+				names,
+				tableSourceTable);
+			return LogicalTableScan.create(relBuilder.getCluster(), table);
 		}
 
 		private RelNode convertToDataStreamScan(DataStreamQueryOperation<?> operation) {
@@ -148,15 +184,15 @@ public class QueryOperationConverter extends QueryOperationDefaultVisitor<RelNod
 			if (operation.getQualifiedName() != null) {
 				names = operation.getQualifiedName();
 			} else {
-				names = Collections.singletonList(String.format("DataStream_%s", operation.getDataStream().getId()));
+				String refId = String.format("Unregistered_DataStream_%s", operation.getDataStream().getId());
+				names = Collections.singletonList(refId);
 			}
 
 			FlinkRelOptTable table = FlinkRelOptTable.create(
-					null,
+					relBuilder.getRelOptSchema(),
 					dataStreamTable.getRowType(relBuilder.getTypeFactory()),
 					names,
 					dataStreamTable);
-
 			return LogicalTableScan.create(relBuilder.getCluster(), table);
 		}
 	}
diff --git a/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/PlannerContext.java b/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/PlannerContext.java
index 205f0e7..7e39daf 100644
--- a/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/PlannerContext.java
+++ b/flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/PlannerContext.java
@@ -52,9 +52,11 @@ import org.apache.calcite.sql2rel.SqlToRelConverter;
 import org.apache.calcite.tools.FrameworkConfig;
 import org.apache.calcite.tools.Frameworks;
 
-import java.util.Collections;
 import java.util.List;
 
+import static java.util.Arrays.asList;
+import static java.util.Collections.singletonList;
+
 /**
  * Utility class to create {@link org.apache.calcite.tools.RelBuilder} or {@link FrameworkConfig} used to create
  * a corresponding {@link org.apache.calcite.tools.Planner}. It tries to separate static elements in a
@@ -107,34 +109,37 @@ public class PlannerContext {
 		return typeFactory;
 	}
 
-	public SchemaPlus getRootSchema() {
-		return frameworkConfig.getDefaultSchema();
-	}
-
 	/**
 	 * Creates a configured {@link FlinkRelBuilder} for a planning session.
 	 *
+	 * @param currentCatalog the current default catalog to look for first during planning.
+	 * @param currentDatabase the current default database to look for first during planning.
 	 * @return configured rel builder
 	 */
-	public FlinkRelBuilder createRelBuilder() {
-		FlinkCalciteCatalogReader relOptSchema = createCatalogReader(false);
+	public FlinkRelBuilder createRelBuilder(String currentCatalog, String currentDatabase) {
+		FlinkCalciteCatalogReader relOptSchema = createCatalogReader(false, currentCatalog, currentDatabase);
 		return new FlinkRelBuilder(frameworkConfig.getContext(), cluster, relOptSchema);
 	}
 
 	/**
 	 * Creates a configured {@link FlinkPlannerImpl} for a planning session.
 	 *
+	 * @param currentCatalog the current default catalog to look for first during planning.
+	 * @param currentDatabase the current default database to look for first during planning.
 	 * @return configured flink planner
 	 */
-	public FlinkPlannerImpl createFlinkPlanner() {
+	public FlinkPlannerImpl createFlinkPlanner(String currentCatalog, String currentDatabase) {
 		return new FlinkPlannerImpl(
 				frameworkConfig,
-				this::createCatalogReader,
+				isLenient -> createCatalogReader(isLenient, currentCatalog, currentDatabase),
 				typeFactory,
 				cluster);
 	}
 
-	private FlinkCalciteCatalogReader createCatalogReader(boolean lenientCaseSensitivity) {
+	private FlinkCalciteCatalogReader createCatalogReader(
+			boolean lenientCaseSensitivity,
+			String currentCatalog,
+			String currentDatabase) {
 		SqlParser.Config sqlParserConfig = frameworkConfig.getParserConfig();
 		final boolean caseSensitive;
 		if (lenientCaseSensitivity) {
@@ -150,7 +155,10 @@ public class PlannerContext {
 		SchemaPlus rootSchema = getRootSchema(frameworkConfig.getDefaultSchema());
 		return new FlinkCalciteCatalogReader(
 				CalciteSchema.from(rootSchema),
-				Collections.emptyList(),
+				asList(
+						asList(currentCatalog, currentDatabase),
+						singletonList(currentCatalog)
+				),
 				typeFactory,
 				CalciteConfig$.MODULE$.connectionConfig(newSqlParserConfig));
 	}
diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/BatchTableEnvironment.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/BatchTableEnvironment.scala
index 8f354ed..8d8f3e0 100644
--- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/BatchTableEnvironment.scala
+++ b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/BatchTableEnvironment.scala
@@ -26,6 +26,7 @@ import org.apache.flink.streaming.api.datastream.DataStream
 import org.apache.flink.streaming.api.environment.{CheckpointConfig, StreamExecutionEnvironment}
 import org.apache.flink.streaming.api.graph.{StreamGraph, StreamGraphGenerator}
 import org.apache.flink.streaming.api.transformations.StreamTransformation
+import org.apache.flink.table.catalog.CatalogManager
 import org.apache.flink.table.operations.DataStreamQueryOperation
 import org.apache.flink.table.plan.`trait`.FlinkRelDistributionTraitDef
 import org.apache.flink.table.plan.nodes.exec.{BatchExecNode, ExecNode}
@@ -54,10 +55,11 @@ import _root_.scala.collection.JavaConversions._
   *  3. Add [[TableSink]] to the [[Table]].
   * @param config The [[TableConfig]] of this [[BatchTableEnvironment]].
   */
-class BatchTableEnvironment(
+abstract class BatchTableEnvironment(
     val execEnv: StreamExecutionEnvironment,
-    config: TableConfig)
-  extends TableEnvironment(execEnv, config) {
+    config: TableConfig,
+    catalogManager: CatalogManager)
+  extends TableEnvironment(execEnv, config, catalogManager) {
 
   // prefix for unique table names.
   override private[flink] val tableNamePrefix = "_DataStreamTable_"
@@ -102,7 +104,7 @@ class BatchTableEnvironment(
       case _: LookupableTableSource[_] => // ok
       // not a batch table source
       case _ =>
-        throw new TableException("Only LookupableTableSouce and BatchTableSource can be " +
+        throw new TableException("Only LookupableTableSouce and bounded StreamTableSource can be " +
           "registered in BatchTableEnvironment.")
     }
   }
diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/StreamTableEnvironment.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/StreamTableEnvironment.scala
index 248114a..400136e 100644
--- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/StreamTableEnvironment.scala
+++ b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/StreamTableEnvironment.scala
@@ -29,6 +29,7 @@ import org.apache.flink.streaming.api.datastream.DataStream
 import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment
 import org.apache.flink.streaming.api.graph.{StreamGraph, StreamGraphGenerator}
 import org.apache.flink.streaming.api.transformations.StreamTransformation
+import org.apache.flink.table.catalog.CatalogManager
 import org.apache.flink.table.dataformat.BaseRow
 import org.apache.flink.table.operations.DataStreamQueryOperation
 import org.apache.flink.table.plan.`trait`.{AccModeTraitDef, FlinkRelDistributionTraitDef, MiniBatchIntervalTraitDef, UpdateAsRetractionTraitDef}
@@ -70,8 +71,9 @@ import _root_.scala.collection.JavaConversions._
   */
 abstract class StreamTableEnvironment(
     private[flink] val execEnv: StreamExecutionEnvironment,
-    config: TableConfig)
-  extends TableEnvironment(execEnv, config) {
+    config: TableConfig,
+    catalogManager: CatalogManager)
+  extends TableEnvironment(execEnv, config, catalogManager) {
 
   // prefix  for unique table names.
   override private[flink] val tableNamePrefix = "_DataStreamTable_"
diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/TableConfig.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/TableConfig.scala
index cedfc08..2289714 100644
--- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/TableConfig.scala
+++ b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/TableConfig.scala
@@ -88,6 +88,19 @@ class TableConfig {
   private var conf = GlobalConfiguration.loadConfiguration()
 
   /**
+    * Specifies the name of the initial catalog to be created when instantiating
+    * TableEnvironment.
+    */
+  private var builtInCatalogName = "default_catalog"
+
+  /**
+    * Specifies the name of the default database in the initial catalog to be created when
+    * instantiating
+    * TableEnvironment.
+    */
+  private var builtInDatabaseName = "default_database"
+
+  /**
    * Sets the timezone for date/time/timestamp conversions.
    */
   def setTimeZone(timeZone: TimeZone): Unit = {
@@ -265,6 +278,37 @@ class TableConfig {
   }
 
   def getLateFireInterval: Long = lateFireInterval
+
+  /**
+    * Gets the specified name of the initial catalog to be created when instantiating
+    * a [[TableEnvironment]].
+    */
+  def getBuiltInCatalogName: String = builtInCatalogName
+
+  /**
+    * Specifies the name of the initial catalog to be created when instantiating
+    * a [[TableEnvironment]]. This method has no effect if called on the
+    * [[TableEnvironment#getConfig()]].
+    */
+  def setBuiltInCatalogName(builtInCatalogName: String): Unit = {
+    this.builtInCatalogName = builtInCatalogName
+  }
+
+  /**
+    * Gets the specified name of the default database in the initial catalog to be created when
+    * instantiating a [[TableEnvironment]].
+    */
+  def getBuiltInDatabaseName: String = builtInDatabaseName
+
+  /**
+    * Specifies the name of the default database in the initial catalog to be created when
+    * instantiating a [[TableEnvironment]]. This method has no effect if called on the
+    * [[TableEnvironment#getConfig()]].
+    */
+  def setBuiltInDatabaseName(builtInDatabaseName: String): Unit = {
+    this.builtInDatabaseName = builtInDatabaseName
+  }
+
 }
 
 object TableConfig {
diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/TableEnvironment.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/TableEnvironment.scala
index 63a9260..ae7c7f2 100644
--- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/TableEnvironment.scala
+++ b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/TableEnvironment.scala
@@ -30,17 +30,16 @@ import org.apache.flink.streaming.api.transformations.StreamTransformation
 import org.apache.flink.table.api.java.{BatchTableEnvironment => JavaBatchTableEnvironment, StreamTableEnvironment => JavaStreamTableEnv}
 import org.apache.flink.table.api.scala.{BatchTableEnvironment => ScalaBatchTableEnvironment, StreamTableEnvironment => ScalaStreamTableEnv}
 import org.apache.flink.table.calcite._
+import org.apache.flink.table.catalog.{CatalogBaseTable, CatalogManager, CatalogManagerCalciteSchema, ConnectorCatalogTable, GenericInMemoryCatalog, ObjectPath, QueryOperationCatalogView}
 import org.apache.flink.table.dataformat.BaseRow
 import org.apache.flink.table.functions.utils.UserDefinedFunctionUtils.{checkForInstantiation, checkNotSingleton, extractResultTypeFromTableFunction, getAccumulatorTypeOfAggregateFunction, getResultTypeOfAggregateFunction}
 import org.apache.flink.table.functions.{AggregateFunction, ScalarFunction, TableFunction}
-import org.apache.flink.table.operations.{DataStreamQueryOperation, PlannerQueryOperation}
+import org.apache.flink.table.operations.{CatalogQueryOperation, PlannerQueryOperation}
 import org.apache.flink.table.plan.nodes.calcite.{LogicalSink, Sink}
 import org.apache.flink.table.plan.nodes.exec.ExecNode
 import org.apache.flink.table.plan.nodes.physical.FlinkPhysicalRel
 import org.apache.flink.table.plan.optimize.Optimizer
 import org.apache.flink.table.plan.reuse.SubplanReuser
-import org.apache.flink.table.plan.schema.{RelTable, TableSourceSinkTable, TableSourceTable}
-import org.apache.flink.table.plan.stats.FlinkStatistic
 import org.apache.flink.table.plan.util.SameRelObjectShuttle
 import org.apache.flink.table.planner.PlannerContext
 import org.apache.flink.table.sinks.TableSink
@@ -50,20 +49,18 @@ import org.apache.flink.table.types.logical.{LogicalType, RowType, TypeInformati
 import org.apache.flink.table.types.utils.TypeConversions.fromLegacyInfoToDataType
 import org.apache.flink.table.types.{ClassLogicalTypeConverter, DataType}
 import org.apache.flink.table.typeutils.TimeIndicatorTypeInfo
+import org.apache.flink.table.util.JavaScalaConversionUtil
 import org.apache.flink.table.validate.FunctionCatalog
 import org.apache.flink.types.Row
 
-import org.apache.calcite.jdbc.CalciteSchema
+import org.apache.calcite.jdbc.CalciteSchemaBuilder.asRootSchema
 import org.apache.calcite.plan.{RelTrait, RelTraitDef}
 import org.apache.calcite.rel.RelNode
-import org.apache.calcite.schema.SchemaPlus
-import org.apache.calcite.schema.impl.AbstractTable
 import org.apache.calcite.sql._
 import org.apache.calcite.tools._
 
 import _root_.java.lang.reflect.Modifier
 import _root_.java.util.concurrent.atomic.AtomicInteger
-import _root_.java.util.{Arrays => JArrays}
 
 import _root_.scala.annotation.varargs
 import _root_.scala.collection.JavaConversions._
@@ -76,12 +73,16 @@ import _root_.scala.collection.mutable
   * @param streamEnv The [[JavaStreamExecEnv]] which is wrapped in this
   *                [[StreamTableEnvironment]].
   * @param config The configuration of the TableEnvironment
+  * @param catalogManager a catalog manager that encapsulates all available catalogs.
   */
 abstract class TableEnvironment(
     val streamEnv: JavaStreamExecEnv,
-    val config: TableConfig) {
+    val config: TableConfig,
+    val catalogManager: CatalogManager) {
 
   protected val DEFAULT_JOB_NAME = "Flink Exec Table Job"
+  protected val defaultCatalogName: String = config.getBuiltInCatalogName
+  protected val defaultDatabaseName: String = config.getBuiltInDatabaseName
 
   private val functionCatalog = new FunctionCatalog
 
@@ -89,27 +90,28 @@ abstract class TableEnvironment(
     new PlannerContext(
       config,
       functionCatalog,
-      // the catalog to hold all registered and translated tables
-      // we disable caching here to prevent side effects
-      CalciteSchema.createRootSchema(false, false),
+      asRootSchema(new CatalogManagerCalciteSchema(catalogManager)),
       getTraitDefs.toList
     )
 
-  private lazy val rootSchema: SchemaPlus = plannerContext.getRootSchema
-
   /** Returns the [[FlinkRelBuilder]] of this TableEnvironment. */
-  private[flink] def getRelBuilder: FlinkRelBuilder = plannerContext.createRelBuilder()
+  private[flink] def getRelBuilder: FlinkRelBuilder = {
+    val currentCatalogName = catalogManager.getCurrentCatalog
+    val currentDatabase = catalogManager.getCurrentDatabase
+    plannerContext.createRelBuilder(currentCatalogName, currentDatabase)
+  }
 
   /** Returns the Calcite [[FrameworkConfig]] of this TableEnvironment. */
   @VisibleForTesting
-  private[flink] def getFlinkPlanner: FlinkPlannerImpl = plannerContext.createFlinkPlanner()
+  private[flink] def getFlinkPlanner: FlinkPlannerImpl = {
+    val currentCatalogName = catalogManager.getCurrentCatalog
+    val currentDatabase = catalogManager.getCurrentDatabase
+    plannerContext.createFlinkPlanner(currentCatalogName, currentDatabase)
+  }
 
   /** Returns the [[FlinkTypeFactory]] of this TableEnvironment. */
   private[flink] def getTypeFactory: FlinkTypeFactory = plannerContext.getTypeFactory
 
-  // a counter for unique attribute names
-  private[flink] val attrNameCntr: AtomicInteger = new AtomicInteger(0)
-
   // a counter for unique table names
   private[flink] val tableNameCntr: AtomicInteger = new AtomicInteger(0)
 
@@ -283,29 +285,69 @@ abstract class TableEnvironment(
         "Only tables that belong to this TableEnvironment can be registered.")
     }
 
-    // TODO improve this
-    table.getQueryOperation match {
-      case dsq: DataStreamQueryOperation[_] => dsq.setQualifiedName(List(name))
-      case _ => // do nothing
+    val tableTable = new QueryOperationCatalogView(table.getQueryOperation)
+    registerTableInternal(name, tableTable)
+  }
+
+  private[flink] def registerTableInternal(name: String, table: CatalogBaseTable): Unit = {
+    val path = new ObjectPath(defaultDatabaseName, name)
+    JavaScalaConversionUtil.toScala(catalogManager.getCatalog(defaultCatalogName)) match {
+      case Some(catalog) => catalog.createTable(path, table, false)
+      case None => throw new TableException("The default catalog does not exist.")
     }
+  }
 
-    val tableTable = new RelTable(table.asInstanceOf[TableImpl].getRelNode)
-    registerTableInternal(name, tableTable)
+  /**
+    * Registers an external [[TableSource]] in this [[TableEnvironment]]'s catalog.
+    * Registered tables can be referenced in SQL queries.
+    *
+    * @param name        The name under which the [[TableSource]] is registered.
+    * @param tableSource The [[TableSource]] to register.
+    */
+  def registerTableSource(name: String, tableSource: TableSource[_]): Unit = {
+    checkValidTableName(name)
+    validateTableSource(tableSource)
+    registerTableSourceInternal(name, tableSource)
   }
 
   /**
-    * Replaces a registered Table with another Table under the same name.
-    * We use this method to replace a [[org.apache.flink.table.plan.schema.DataStreamTable]]
-    * with a [[org.apache.calcite.schema.TranslatableTable]].
+    * Registers an internal [[TableSource]] in this [[TableEnvironment]]'s catalog without
+    * name checking. Registered tables can be referenced in SQL queries.
     *
-    * @param name Name of the table to replace.
-    * @param table The table that replaces the previous table.
+    * @param name        The name under which the [[TableSource]] is registered.
+    * @param tableSource The [[TableSource]] to register.
     */
-  protected def replaceRegisteredTable(name: String, table: AbstractTable): Unit = {
-    if (isRegistered(name)) {
-      rootSchema.add(name, table)
-    } else {
-      throw new TableException(s"Table \'$name\' is not registered.")
+  protected def registerTableSourceInternal(name: String, tableSource: TableSource[_]): Unit = {
+    // register
+    getCatalogTable(defaultCatalogName, defaultDatabaseName, name) match {
+      // check if a table (source or sink) is registered
+      case Some(table: ConnectorCatalogTable[_, _]) =>
+        if (table.getTableSource.isPresent) {
+          // wrapper contains source
+          throw new TableException(s"Table '$name' already exists. Please choose a different name.")
+        } else {
+          // wrapper contains only sink (not source)
+          replaceTableInternal(
+            name,
+            ConnectorCatalogTable.sourceAndSink(tableSource, table.getTableSink.get, isBatch))
+        }
+      // no table is registered
+      case _ =>
+        registerTableInternal(name, ConnectorCatalogTable.source(tableSource, isBatch))
+    }
+  }
+
+  protected def getCatalogTable(name: String*): Option[CatalogBaseTable] = {
+    JavaScalaConversionUtil.toScala(catalogManager.resolveTable(name: _*))
+      .flatMap(t => JavaScalaConversionUtil.toScala(t.getCatalogTable))
+  }
+
+  protected def replaceTableInternal(name: String, table: CatalogBaseTable): Unit = {
+    checkValidTableName(name)
+    val path = new ObjectPath(defaultDatabaseName, name)
+    JavaScalaConversionUtil.toScala(catalogManager.getCatalog(defaultCatalogName)) match {
+      case Some(catalog) => catalog.alterTable(path, table, false)
+      case None => throw new TableException("The default catalog does not exist.")
     }
   }
 
@@ -335,35 +377,14 @@ abstract class TableEnvironment(
   @varargs
   def scan(tablePath: String*): Table = {
     scanInternal(tablePath.toArray) match {
-      case Some(table) => table
+      case Some(table) => new TableImpl(this, table)
       case None => throw new TableException(s"Table '${tablePath.mkString(".")}' was not found.")
     }
   }
 
-  private[flink] def scanInternal(tablePath: Array[String]): Option[Table] = {
-    require(tablePath != null && !tablePath.isEmpty, "tablePath must not be null or empty.")
-    val schemaPaths = tablePath.slice(0, tablePath.length - 1)
-    val schema = getSchema(schemaPaths)
-    if (schema != null) {
-      val tableName = tablePath(tablePath.length - 1)
-      val table = schema.getTable(tableName)
-      if (table != null) {
-        val scan = getRelBuilder.scan(JArrays.asList(tablePath: _*)).build()
-        return Some(new TableImpl(this, new PlannerQueryOperation(scan)))
-      }
-    }
-    None
-  }
-
-  private def getSchema(schemaPath: Array[String]): SchemaPlus = {
-    var schema = rootSchema
-    for (schemaName <- schemaPath) {
-      schema = schema.getSubSchema(schemaName)
-      if (schema == null) {
-        return schema
-      }
-    }
-    schema
+  private[flink] def scanInternal(tablePath: Array[String]): Option[CatalogQueryOperation] = {
+    JavaScalaConversionUtil.toScala(catalogManager.resolveTable(tablePath: _*))
+      .map(t => new CatalogQueryOperation(t.getTablePath, t.getTableSchema))
   }
 
   /**
@@ -372,7 +393,14 @@ abstract class TableEnvironment(
     * @return A list of the names of all registered tables.
     */
   def listTables(): Array[String] = {
-    rootSchema.getTableNames.asScala.toArray
+    val currentCatalogName = catalogManager.getCurrentCatalog
+    val currentCatalog = catalogManager.getCatalog(currentCatalogName)
+    JavaScalaConversionUtil.toScala(currentCatalog) match {
+      case Some(catalog) =>
+        catalog.listTables(catalogManager.getCurrentDatabase).asScala.toArray
+      case None =>
+        throw new TableException(s"The current catalog ($currentCatalogName) does not exist.")
+    }
   }
 
   /**
@@ -453,28 +481,11 @@ abstract class TableEnvironment(
     }
   }
 
-  /**
-    * Registers a Calcite [[AbstractTable]] in the TableEnvironment's catalog.
-    *
-    * @param name The name under which the table will be registered.
-    * @param table The table to register in the catalog
-    * @throws TableException if another table is registered under the provided name.
-    */
-  @throws[TableException]
-  private[flink] def registerTableInternal(name: String, table: AbstractTable): Unit = {
-    if (isRegistered(name)) {
-      throw new TableException(s"Table \'$name\' already exists. " +
-              s"Please, choose a different name.")
-    } else {
-      rootSchema.add(name, table)
-    }
-  }
-
   /** Returns a unique table name according to the internal naming pattern. */
   private[flink] def createUniqueTableName(tableNamePrefix: Option[String] = None): String = {
     val prefix = tableNamePrefix.getOrElse(this.tableNamePrefix)
     var res = prefix + tableNameCntr.getAndIncrement()
-    while (getTable(res).nonEmpty) {
+    while (isRegistered(res)) {
       res = prefix + tableNameCntr.getAndIncrement()
     }
     res
@@ -488,48 +499,22 @@ abstract class TableEnvironment(
   protected def checkValidTableName(name: String): Unit
 
   /**
-    * Checks if a table is registered under the given name.
+    * Perform batch or streaming specific validations of the [[TableSource]].
+    * This method should throw [[ValidationException]] if the [[TableSource]] cannot be used
+    * in this [[TableEnvironment]].
     *
-    * @param name The table name to check.
-    * @return true, if a table is registered under the name, false otherwise.
+    * @param tableSource table source to validate
     */
-  protected[flink] def isRegistered(name: String): Boolean = {
-    rootSchema.getTableNames.contains(name)
-  }
+  protected def validateTableSource(tableSource: TableSource[_]): Unit
 
   /**
-    * Get a table from either internal or external catalogs.
+    * Checks if a table is registered under the given name.
     *
-    * @param name The name of the table.
-    * @return The table registered either internally or externally, None otherwise.
+    * @param name The table name to check.
+    * @return true, if a table is registered under the name, false otherwise.
     */
-  protected def getTable(name: String): Option[org.apache.calcite.schema.Table] = {
-
-    // recursively fetches a table from a schema.
-    def getTableFromSchema(
-      schema: SchemaPlus,
-      path: List[String]): Option[org.apache.calcite.schema.Table] = {
-
-      path match {
-        case tableName :: Nil =>
-          // look up table
-          Option(schema.getTable(tableName))
-        case subschemaName :: remain =>
-          // look up subschema
-          val subschema = Option(schema.getSubSchema(subschemaName))
-          subschema match {
-            case Some(s) =>
-              // search for table in subschema
-              getTableFromSchema(s, remain)
-            case None =>
-              // subschema does not exist
-              None
-          }
-      }
-    }
-
-    val pathNames = name.split('.').toList
-    getTableFromSchema(rootSchema, pathNames)
+  protected[flink] def isRegistered(name: String): Boolean = {
+    catalogManager.resolveTable(name).isPresent
   }
 
   /**
@@ -627,11 +612,6 @@ abstract class TableEnvironment(
       getTypeFactory)
   }
 
-  /** Returns a unique temporary attribute name. */
-  private[flink] def createUniqueAttributeName(): String = {
-    "TMP_" + attrNameCntr.getAndIncrement()
-  }
-
   /**
     * Reference input fields by name:
     * All fields in the schema definition are referenced by name
@@ -689,6 +669,7 @@ abstract class TableEnvironment(
     * @return A tuple of two arrays holding the field names and corresponding field positions.
     */
   // TODO: we should support Expression fields after we introduce [Expression]
+  // TODO remove this method and use FieldInfoUtils#getFieldsInfo
   protected[flink] def getFieldInfo[A](
     inputType: DataType,
     fields: Array[String]): (Array[String], Array[Int]) = {
@@ -748,90 +729,6 @@ abstract class TableEnvironment(
     (fieldNames, fieldIndexes)
   }
 
-  /**
-    * Registers an external [[TableSource]] in this [[TableEnvironment]]'s catalog.
-    * Registered tables can be referenced in SQL queries.
-    *
-    * @param name        The name under which the [[TableSource]] is registered.
-    * @param tableSource The [[TableSource]] to register.
-    */
-  def registerTableSource(name: String, tableSource: TableSource[_]): Unit = {
-    checkValidTableName(name)
-    registerTableSourceInternal(
-      name,
-      tableSource,
-      FlinkStatistic.builder()
-        .tableStats(tableSource.getTableStats.orElse(null))
-        .build(),
-      replace = false)
-  }
-
-  /**
-    * Registers or replace an external [[TableSource]] in this [[TableEnvironment]]'s catalog.
-    * Registered tables can be referenced in SQL queries.
-    *
-    * @param name        The name under which the [[TableSource]] is registered.
-    * @param tableSource The [[TableSource]] to register.
-    */
-  def registerOrReplaceTableSource(name: String,
-      tableSource: TableSource[_]): Unit = {
-    checkValidTableName(name)
-    registerTableSourceInternal(
-      name,
-      tableSource,
-      FlinkStatistic.builder()
-        .tableStats(tableSource.getTableStats.orElse(null))
-        .build(),
-      replace = true)
-  }
-
-  /**
-    * Registers an internal [[TableSource]] in this [[TableEnvironment]]'s catalog without
-    * name checking. Registered tables can be referenced in SQL queries.
-    *
-    * @param name        The name under which the [[TableSource]] is registered.
-    * @param tableSource The [[TableSource]] to register.
-    * @param replace     Whether to replace this [[TableSource]]
-    */
-  protected def registerTableSourceInternal(
-      name: String,
-      tableSource: TableSource[_],
-      statistic: FlinkStatistic,
-      replace: Boolean): Unit = {
-    validateTableSource(tableSource)
-    // register
-    getTable(name) match {
-      // check if a table (source or sink) is registered
-      case Some(table: TableSourceSinkTable[_, _]) => table.tableSourceTable match {
-        // wrapper contains source
-        case Some(_: TableSourceTable[_]) if !replace =>
-          throw new TableException(s"Table '$name' already exists. " +
-            s"Please choose a different name.")
-        // wrapper contains only sink (not source)
-        case Some(_: TableSourceTable[_]) =>
-          val enrichedTable = new TableSourceSinkTable(
-            Some(new TableSourceTable(tableSource, !isBatch, statistic)),
-            table.tableSinkTable)
-          replaceRegisteredTable(name, enrichedTable)
-      }
-      // no table is registered
-      case _ =>
-        val newTable = new TableSourceSinkTable(
-          Some(new TableSourceTable(tableSource, !isBatch, statistic)),
-          None)
-        registerTableInternal(name, newTable)
-    }
-  }
-
-  /**
-    * Perform batch or streaming specific validations of the [[TableSource]].
-    * This method should throw [[ValidationException]] if the [[TableSource]] cannot be used
-    * in this [[TableEnvironment]].
-    *
-    * @param tableSource table source to validate
-    */
-  protected def validateTableSource(tableSource: TableSource[_]): Unit
-
 }
 
 /**
@@ -982,7 +879,7 @@ object TableEnvironment {
     */
   def getBatchTableEnvironment(
       executionEnvironment: JavaStreamExecEnv): JavaBatchTableEnvironment = {
-    new JavaBatchTableEnvironment(executionEnvironment, new TableConfig())
+    getBatchTableEnvironment(executionEnvironment, new TableConfig())
   }
 
   /**
@@ -995,7 +892,28 @@ object TableEnvironment {
   def getBatchTableEnvironment(
       executionEnvironment: JavaStreamExecEnv,
       tableConfig: TableConfig): JavaBatchTableEnvironment = {
-    new JavaBatchTableEnvironment(executionEnvironment, tableConfig)
+    val catalogManager = new CatalogManager(
+      tableConfig.getBuiltInCatalogName,
+      new GenericInMemoryCatalog(
+        tableConfig.getBuiltInCatalogName,
+        tableConfig.getBuiltInDatabaseName)
+    )
+    getBatchTableEnvironment(executionEnvironment, tableConfig, catalogManager)
+  }
+
+  /**
+    * Returns a [[BatchTableEnvironment]] for a Java [[JavaStreamExecEnv]] and a given
+    * [[TableConfig]].
+    *
+    * @param executionEnvironment The Java batch ExecutionEnvironment.
+    * @param tableConfig          The TableConfig for the new TableEnvironment.
+    * @param catalogManager a catalog manager that encapsulates all available catalogs.
+    */
+  def getBatchTableEnvironment(
+      executionEnvironment: JavaStreamExecEnv,
+      tableConfig: TableConfig,
+      catalogManager: CatalogManager): JavaBatchTableEnvironment = {
+    new JavaBatchTableEnvironment(executionEnvironment, tableConfig, catalogManager)
   }
 
   /**
@@ -1005,7 +923,7 @@ object TableEnvironment {
     */
   def getBatchTableEnvironment(
       executionEnvironment: ScalaStreamExecEnv): ScalaBatchTableEnvironment = {
-    new ScalaBatchTableEnvironment(executionEnvironment, new TableConfig())
+    getBatchTableEnvironment(executionEnvironment, new TableConfig())
   }
 
   /**
@@ -1017,8 +935,27 @@ object TableEnvironment {
   def getBatchTableEnvironment(
       executionEnvironment: ScalaStreamExecEnv,
       tableConfig: TableConfig): ScalaBatchTableEnvironment = {
+    val catalogManager = new CatalogManager(
+      tableConfig.getBuiltInCatalogName,
+      new GenericInMemoryCatalog(
+        tableConfig.getBuiltInCatalogName,
+        tableConfig.getBuiltInDatabaseName)
+    )
+    getBatchTableEnvironment(executionEnvironment, tableConfig, catalogManager)
+  }
 
-    new ScalaBatchTableEnvironment(executionEnvironment, tableConfig)
+  /**
+    * Returns a [[ScalaBatchTableEnvironment]] for a Scala stream [[ScalaStreamExecEnv]].
+    *
+    * @param executionEnvironment The Scala StreamExecutionEnvironment.
+    * @param tableConfig The TableConfig for the new TableEnvironment.
+    * @param catalogManager a catalog manager that encapsulates all available catalogs.
+    */
+  def getBatchTableEnvironment(
+      executionEnvironment: ScalaStreamExecEnv,
+      tableConfig: TableConfig,
+      catalogManager: CatalogManager): ScalaBatchTableEnvironment = {
+    new ScalaBatchTableEnvironment(executionEnvironment, tableConfig, catalogManager)
   }
 
   /**
@@ -1027,7 +964,7 @@ object TableEnvironment {
     * @param executionEnvironment The Java StreamExecutionEnvironment.
     */
   def getTableEnvironment(executionEnvironment: JavaStreamExecEnv): JavaStreamTableEnv = {
-    new JavaStreamTableEnv(executionEnvironment, new TableConfig())
+    getTableEnvironment(executionEnvironment, new TableConfig())
   }
 
   /**
@@ -1039,8 +976,26 @@ object TableEnvironment {
   def getTableEnvironment(
       executionEnvironment: JavaStreamExecEnv,
       tableConfig: TableConfig): JavaStreamTableEnv = {
+    val catalogManager = new CatalogManager(
+      tableConfig.getBuiltInCatalogName,
+      new GenericInMemoryCatalog(
+        tableConfig.getBuiltInCatalogName,
+        tableConfig.getBuiltInDatabaseName)
+    )
+    getTableEnvironment(executionEnvironment, tableConfig, catalogManager)
+  }
 
-    new JavaStreamTableEnv(executionEnvironment, tableConfig)
+  /**
+    * Returns a [[JavaStreamTableEnv]] for a Java [[JavaStreamExecEnv]] and a given [[TableConfig]].
+    *
+    * @param executionEnvironment The Java StreamExecutionEnvironment.
+    * @param tableConfig The TableConfig for the new TableEnvironment.
+    */
+  def getTableEnvironment(
+      executionEnvironment: JavaStreamExecEnv,
+      tableConfig: TableConfig,
+      catalogManager: CatalogManager): JavaStreamTableEnv = {
+    new JavaStreamTableEnv(executionEnvironment, tableConfig, catalogManager)
   }
 
   /**
@@ -1049,7 +1004,7 @@ object TableEnvironment {
     * @param executionEnvironment The Scala StreamExecutionEnvironment.
     */
   def getTableEnvironment(executionEnvironment: ScalaStreamExecEnv): ScalaStreamTableEnv = {
-    new ScalaStreamTableEnv(executionEnvironment, new TableConfig())
+    getTableEnvironment(executionEnvironment, new TableConfig())
   }
 
   /**
@@ -1061,7 +1016,25 @@ object TableEnvironment {
   def getTableEnvironment(
       executionEnvironment: ScalaStreamExecEnv,
       tableConfig: TableConfig): ScalaStreamTableEnv = {
+    val catalogManager = new CatalogManager(
+      tableConfig.getBuiltInCatalogName,
+      new GenericInMemoryCatalog(
+        tableConfig.getBuiltInCatalogName,
+        tableConfig.getBuiltInDatabaseName)
+    )
+    getTableEnvironment(executionEnvironment, tableConfig, catalogManager)
+  }
 
-    new ScalaStreamTableEnv(executionEnvironment, tableConfig)
+  /**
+    * Returns a [[ScalaStreamTableEnv]] for a Scala stream [[ScalaStreamExecEnv]].
+    *
+    * @param executionEnvironment The Scala StreamExecutionEnvironment.
+    * @param tableConfig The TableConfig for the new TableEnvironment.
+    */
+  def getTableEnvironment(
+      executionEnvironment: ScalaStreamExecEnv,
+      tableConfig: TableConfig,
+      catalogManager: CatalogManager): ScalaStreamTableEnv = {
+    new ScalaStreamTableEnv(executionEnvironment, tableConfig, catalogManager)
   }
 }
diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/java/BatchTableEnvironment.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/java/BatchTableEnvironment.scala
index 148407b..81f6f5a 100644
--- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/java/BatchTableEnvironment.scala
+++ b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/java/BatchTableEnvironment.scala
@@ -19,14 +19,16 @@ package org.apache.flink.table.api.java
 
 import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment
 import org.apache.flink.table.api.{Table, TableConfig, TableEnvironment}
+import org.apache.flink.table.catalog.{CatalogManager, GenericInMemoryCatalog}
 
 /**
   * The [[TableEnvironment]] for a Java [[StreamExecutionEnvironment]].
   */
 class BatchTableEnvironment(
     execEnv: StreamExecutionEnvironment,
-    config: TableConfig)
-  extends org.apache.flink.table.api.BatchTableEnvironment(execEnv, config) {
+    config: TableConfig,
+    catalogManager: CatalogManager)
+  extends org.apache.flink.table.api.BatchTableEnvironment(execEnv, config, catalogManager) {
 
 }
 
@@ -44,7 +46,7 @@ object BatchTableEnvironment {
     * @param executionEnvironment The Java [[StreamExecutionEnvironment]] of the TableEnvironment.
     */
   def create(executionEnvironment: StreamExecutionEnvironment): BatchTableEnvironment = {
-    new BatchTableEnvironment(executionEnvironment, new TableConfig())
+    create(executionEnvironment, new TableConfig())
   }
 
   /**
@@ -62,6 +64,33 @@ object BatchTableEnvironment {
   def create(
       executionEnvironment: StreamExecutionEnvironment,
       tableConfig: TableConfig): BatchTableEnvironment = {
-    new BatchTableEnvironment(executionEnvironment, tableConfig)
+    val catalogManager = new CatalogManager(
+      tableConfig.getBuiltInCatalogName,
+      new GenericInMemoryCatalog(
+        tableConfig.getBuiltInCatalogName,
+        tableConfig.getBuiltInDatabaseName)
+    )
+    create(executionEnvironment, tableConfig, catalogManager)
   }
+
+  /**
+    * Returns a [[TableEnvironment]] for a Java [[StreamExecutionEnvironment]].
+    *
+    * A TableEnvironment can be used to:
+    * - register a [[Table]] in the [[TableEnvironment]]'s catalog
+    * - scan a registered table to obtain a [[Table]]
+    * - specify a SQL query on registered tables to obtain a [[Table]]
+    * - explain the AST and execution plan of a [[Table]]
+    *
+    * @param executionEnvironment The Java [[StreamExecutionEnvironment]] of the TableEnvironment.
+    * @param tableConfig The configuration of the TableEnvironment.
+    * @param catalogManager a catalog manager that encapsulates all available catalogs.
+    */
+  def create(
+      executionEnvironment: StreamExecutionEnvironment,
+      tableConfig: TableConfig,
+      catalogManager: CatalogManager): BatchTableEnvironment = {
+    new BatchTableEnvironment(executionEnvironment, tableConfig, catalogManager)
+  }
+
 }
diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/java/StreamTableEnvironment.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/java/StreamTableEnvironment.scala
index c660ee3..f8914f91 100644
--- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/java/StreamTableEnvironment.scala
+++ b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/java/StreamTableEnvironment.scala
@@ -20,6 +20,7 @@ package org.apache.flink.table.api.java
 import org.apache.flink.streaming.api.datastream.DataStream
 import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment
 import org.apache.flink.table.api._
+import org.apache.flink.table.catalog.{CatalogManager, GenericInMemoryCatalog}
 
 /**
   * The [[TableEnvironment]] for a Java [[StreamExecutionEnvironment]] that works with
@@ -41,8 +42,9 @@ import org.apache.flink.table.api._
   */
 class StreamTableEnvironment @Deprecated() (
     execEnv: StreamExecutionEnvironment,
-    config: TableConfig)
-  extends org.apache.flink.table.api.StreamTableEnvironment(execEnv, config) {
+    config: TableConfig,
+    catalogManager: CatalogManager)
+  extends org.apache.flink.table.api.StreamTableEnvironment(execEnv, config, catalogManager) {
 
   /**
     * Converts the given [[DataStream]] into a [[Table]].
@@ -136,7 +138,7 @@ object StreamTableEnvironment {
     * @param executionEnvironment The Java [[StreamExecutionEnvironment]] of the TableEnvironment.
     */
   def create(executionEnvironment: StreamExecutionEnvironment): StreamTableEnvironment = {
-    new StreamTableEnvironment(executionEnvironment, new TableConfig())
+    create(executionEnvironment, new TableConfig())
   }
 
   /**
@@ -158,7 +160,36 @@ object StreamTableEnvironment {
   def create(
     executionEnvironment: StreamExecutionEnvironment,
     tableConfig: TableConfig): StreamTableEnvironment = {
+    val catalogManager = new CatalogManager(
+      tableConfig.getBuiltInCatalogName,
+      new GenericInMemoryCatalog(
+        tableConfig.getBuiltInCatalogName,
+        tableConfig.getBuiltInDatabaseName)
+    )
+    new StreamTableEnvironment(executionEnvironment, tableConfig, catalogManager)
+  }
 
-    new StreamTableEnvironment(executionEnvironment, tableConfig)
+  /**
+    * The [[TableEnvironment]] for a Java [[StreamExecutionEnvironment]] that works with
+    * [[DataStream]]s.
+    *
+    * A TableEnvironment can be used to:
+    * - convert a [[DataStream]] to a [[Table]]
+    * - register a [[DataStream]] in the [[TableEnvironment]]'s catalog
+    * - register a [[Table]] in the [[TableEnvironment]]'s catalog
+    * - scan a registered table to obtain a [[Table]]
+    * - specify a SQL query on registered tables to obtain a [[Table]]
+    * - convert a [[Table]] into a [[DataStream]]
+    * - explain the AST and execution plan of a [[Table]]
+    *
+    * @param executionEnvironment The Java [[StreamExecutionEnvironment]] of the TableEnvironment.
+    * @param tableConfig The configuration of the TableEnvironment.
+    * @param catalogManager a catalog manager that encapsulates all available catalogs.
+    */
+  def create(
+      executionEnvironment: StreamExecutionEnvironment,
+      tableConfig: TableConfig,
+      catalogManager: CatalogManager): StreamTableEnvironment = {
+    new StreamTableEnvironment(executionEnvironment, tableConfig, catalogManager)
   }
 }
diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/scala/BatchTableEnvironment.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/scala/BatchTableEnvironment.scala
index 42da996..26c2e3c 100644
--- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/scala/BatchTableEnvironment.scala
+++ b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/scala/BatchTableEnvironment.scala
@@ -20,6 +20,7 @@ package org.apache.flink.table.api.scala
 import org.apache.flink.api.common.typeinfo.TypeInformation
 import org.apache.flink.streaming.api.scala.StreamExecutionEnvironment
 import org.apache.flink.table.api._
+import org.apache.flink.table.catalog.{CatalogManager, GenericInMemoryCatalog}
 import org.apache.flink.table.functions.{AggregateFunction, TableFunction}
 
 /**
@@ -27,10 +28,12 @@ import org.apache.flink.table.functions.{AggregateFunction, TableFunction}
   */
 class BatchTableEnvironment(
     execEnv: StreamExecutionEnvironment,
-    config: TableConfig)
+    config: TableConfig,
+    catalogManager: CatalogManager)
   extends org.apache.flink.table.api.BatchTableEnvironment(
     execEnv.getWrappedStreamExecutionEnvironment,
-    config) {
+    config,
+    catalogManager) {
 
   /**
     * Registers an [[AggregateFunction]] under a unique name in the TableEnvironment's catalog.
@@ -73,7 +76,7 @@ object BatchTableEnvironment {
     * @param executionEnvironment The Java [[StreamExecutionEnvironment]] of the TableEnvironment.
     */
   def create(executionEnvironment: StreamExecutionEnvironment): BatchTableEnvironment = {
-    new BatchTableEnvironment(executionEnvironment, new TableConfig())
+    create(executionEnvironment, new TableConfig())
   }
 
   /**
@@ -91,7 +94,32 @@ object BatchTableEnvironment {
   def create(
       executionEnvironment: StreamExecutionEnvironment,
       tableConfig: TableConfig): BatchTableEnvironment = {
-    new BatchTableEnvironment(executionEnvironment, tableConfig)
+    val catalogManager = new CatalogManager(
+      tableConfig.getBuiltInCatalogName,
+      new GenericInMemoryCatalog(
+        tableConfig.getBuiltInCatalogName,
+        tableConfig.getBuiltInDatabaseName)
+    )
+    create(executionEnvironment, tableConfig, catalogManager)
   }
 
+  /**
+    * Returns a [[TableEnvironment]] for a Scala [[StreamExecutionEnvironment]].
+    *
+    * A TableEnvironment can be used to:
+    * - register a [[Table]] in the [[TableEnvironment]]'s catalog
+    * - scan a registered table to obtain a [[Table]]
+    * - specify a SQL query on registered tables to obtain a [[Table]]
+    * - explain the AST and execution plan of a [[Table]]
+    *
+    * @param executionEnvironment The Java [[StreamExecutionEnvironment]] of the TableEnvironment.
+    * @param tableConfig The configuration of the TableEnvironment.
+    * @param catalogManager a catalog manager that encapsulates all available catalogs.
+    */
+  def create(
+      executionEnvironment: StreamExecutionEnvironment,
+      tableConfig: TableConfig,
+      catalogManager: CatalogManager): BatchTableEnvironment = {
+    new BatchTableEnvironment(executionEnvironment, tableConfig, catalogManager)
+  }
 }
diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/scala/StreamTableEnvironment.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/scala/StreamTableEnvironment.scala
index de16eed..89de5c7 100644
--- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/scala/StreamTableEnvironment.scala
+++ b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/api/scala/StreamTableEnvironment.scala
@@ -21,6 +21,7 @@ import org.apache.flink.api.common.typeinfo.TypeInformation
 import org.apache.flink.api.scala._
 import org.apache.flink.streaming.api.scala.{DataStream, StreamExecutionEnvironment, asScalaStream}
 import org.apache.flink.table.api.{Table, TableConfig, TableEnvironment, TableImpl}
+import org.apache.flink.table.catalog.{CatalogManager, GenericInMemoryCatalog}
 import org.apache.flink.table.functions.{AggregateFunction, TableFunction}
 
 /**
@@ -43,10 +44,12 @@ class StreamTableEnvironment @deprecated(
       "This constructor will be removed. Use StreamTableEnvironment.create() instead.",
       "1.8.0") (
     execEnv: StreamExecutionEnvironment,
-    config: TableConfig)
+    config: TableConfig,
+    catalogManager: CatalogManager)
   extends org.apache.flink.table.api.StreamTableEnvironment(
     execEnv.getWrappedStreamExecutionEnvironment,
-    config) {
+    config,
+    catalogManager) {
 
   /**
     * Converts the given [[DataStream]] into a [[Table]].
@@ -211,7 +214,7 @@ object StreamTableEnvironment {
     * @param executionEnvironment The Scala [[StreamExecutionEnvironment]] of the TableEnvironment.
     */
   def create(executionEnvironment: StreamExecutionEnvironment): StreamTableEnvironment = {
-    new StreamTableEnvironment(executionEnvironment, new TableConfig())
+    create(executionEnvironment, new TableConfig())
   }
 
   /**
@@ -233,7 +236,36 @@ object StreamTableEnvironment {
   def create(
     executionEnvironment: StreamExecutionEnvironment,
     tableConfig: TableConfig): StreamTableEnvironment = {
+    val catalogManager = new CatalogManager(
+      tableConfig.getBuiltInCatalogName,
+      new GenericInMemoryCatalog(
+        tableConfig.getBuiltInCatalogName,
+        tableConfig.getBuiltInDatabaseName)
+    )
+    create(executionEnvironment, tableConfig, catalogManager)
+  }
 
-    new StreamTableEnvironment(executionEnvironment, tableConfig)
+  /**
+    * The [[TableEnvironment]] for a Scala [[StreamExecutionEnvironment]] that works with
+    * [[DataStream]]s.
+    *
+    * A TableEnvironment can be used to:
+    * - convert a [[DataStream]] to a [[Table]]
+    * - register a [[DataStream]] in the [[TableEnvironment]]'s catalog
+    * - register a [[Table]] in the [[TableEnvironment]]'s catalog
+    * - scan a registered table to obtain a [[Table]]
+    * - specify a SQL query on registered tables to obtain a [[Table]]
+    * - convert a [[Table]] into a [[DataStream]]
+    * - explain the AST and execution plan of a [[Table]]
+    *
+    * @param executionEnvironment The Scala [[StreamExecutionEnvironment]] of the TableEnvironment.
+    * @param tableConfig The configuration of the TableEnvironment.
+    * @param catalogManager a catalog manager that encapsulates all available catalogs.
+    */
+  def create(
+      executionEnvironment: StreamExecutionEnvironment,
+      tableConfig: TableConfig,
+      catalogManager: CatalogManager): StreamTableEnvironment = {
+    new StreamTableEnvironment(executionEnvironment, tableConfig, catalogManager)
   }
 }
diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/calcite/FlinkRelBuilder.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/calcite/FlinkRelBuilder.scala
index 29300fb..4683424 100644
--- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/calcite/FlinkRelBuilder.scala
+++ b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/calcite/FlinkRelBuilder.scala
@@ -117,4 +117,12 @@ object FlinkRelBuilder {
     def create(cluster: RelOptCluster, schema: RelOptSchema): RelBuilder =
       new FlinkRelBuilder(context, cluster, schema)
   }
+
+  def of(cluster: RelOptCluster, relTable: RelOptTable): FlinkRelBuilder = {
+    val clusterContext = cluster.getPlanner.getContext
+    new FlinkRelBuilder(
+      clusterContext,
+      cluster,
+      relTable.getRelOptSchema)
+  }
 }
diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/optimize/RelNodeBlock.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/optimize/RelNodeBlock.scala
index f7d9699..29b069d 100644
--- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/optimize/RelNodeBlock.scala
+++ b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/optimize/RelNodeBlock.scala
@@ -380,7 +380,7 @@ object RelNodeBlockPlanBuilder {
       config: TableConfig): Seq[RelNodeBlock] = {
     require(sinkNodes.nonEmpty)
 
-    // expand RelTable in TableScan
+    // expand QueryOperationCatalogViewTable in TableScan
     val shuttle = new ExpandTableScanShuttle
     val convertedRelNodes = sinkNodes.map(_.accept(shuttle))
 
diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/optimize/StreamCommonSubGraphBasedOptimizer.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/optimize/StreamCommonSubGraphBasedOptimizer.scala
index a30f1d2..ac7ac59 100644
--- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/optimize/StreamCommonSubGraphBasedOptimizer.scala
+++ b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/optimize/StreamCommonSubGraphBasedOptimizer.scala
@@ -203,8 +203,8 @@ class StreamCommonSubGraphBasedOptimizer(tEnv: StreamTableEnvironment)
         case _: StreamExecDataStreamScan | _: StreamExecIntermediateTableScan =>
           val scan = rel.asInstanceOf[TableScan]
           val retractionTrait = scan.getTraitSet.getTrait(UpdateAsRetractionTraitDef.INSTANCE)
-          val tableName = scan.getTable.getQualifiedName.last
-          val inputBlocks = block.children.filter(_.getOutputTableName eq tableName)
+          val tableName = scan.getTable.getQualifiedName.mkString(".")
+          val inputBlocks = block.children.filter(b => tableName.equals(b.getOutputTableName))
           Preconditions.checkArgument(inputBlocks.size <= 1)
           if (inputBlocks.size == 1) {
             if (retractionTrait.sendsUpdatesAsRetractions || updateAsRetraction) {
diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/optimize/program/FlinkBatchProgram.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/optimize/program/FlinkBatchProgram.scala
index 921b36f..b866ab5 100644
--- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/optimize/program/FlinkBatchProgram.scala
+++ b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/optimize/program/FlinkBatchProgram.scala
@@ -46,7 +46,7 @@ object FlinkBatchProgram {
        // rewrite sub-queries to joins
       SUBQUERY_REWRITE,
       FlinkGroupProgramBuilder.newBuilder[BatchOptimizeContext]
-        // rewrite RelTable before rewriting sub-queries
+        // rewrite QueryOperationCatalogViewTable before rewriting sub-queries
         .addProgram(FlinkHepRuleSetProgramBuilder.newBuilder
           .setHepRulesExecutionType(HEP_RULES_EXECUTION_TYPE.RULE_SEQUENCE)
           .setHepMatchOrder(HepMatchOrder.BOTTOM_UP)
diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/optimize/program/FlinkStreamProgram.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/optimize/program/FlinkStreamProgram.scala
index 34834d1..5992f0a 100644
--- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/optimize/program/FlinkStreamProgram.scala
+++ b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/optimize/program/FlinkStreamProgram.scala
@@ -46,7 +46,7 @@ object FlinkStreamProgram {
     chainedProgram.addLast(
       SUBQUERY_REWRITE,
       FlinkGroupProgramBuilder.newBuilder[StreamOptimizeContext]
-        // rewrite RelTable before rewriting sub-queries
+        // rewrite QueryOperationCatalogViewTable before rewriting sub-queries
         .addProgram(FlinkHepRuleSetProgramBuilder.newBuilder
           .setHepRulesExecutionType(HEP_RULES_EXECUTION_TYPE.RULE_SEQUENCE)
           .setHepMatchOrder(HepMatchOrder.BOTTOM_UP)
diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/schema/FlinkRelOptTable.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/schema/FlinkRelOptTable.scala
index bf79985..c7131a4 100644
--- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/schema/FlinkRelOptTable.scala
+++ b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/schema/FlinkRelOptTable.scala
@@ -18,6 +18,8 @@
 
 package org.apache.flink.table.plan.schema
 
+import org.apache.flink.table.catalog.QueryOperationCatalogViewTable
+import org.apache.flink.table.operations.TableSourceQueryOperation
 import org.apache.flink.table.plan.`trait`.FlinkRelDistributionTraitDef
 import org.apache.flink.table.plan.stats.FlinkStatistic
 import org.apache.flink.table.sources.TableSource
@@ -119,6 +121,11 @@ class FlinkRelOptTable protected(
         explainSourceAsString(tsst.tableSourceTable.get.tableSource)
       case tst: TableSourceTable[_] =>
         explainSourceAsString(tst.tableSource)
+      case view: QueryOperationCatalogViewTable =>
+        view.getCatalogView.getQueryOperation match {
+          case tsqo: TableSourceQueryOperation[_] => explainSourceAsString(tsqo.getTableSource)
+          case _ => names
+        }
       case _ => names
     }
   }
diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/schema/IntermediateRelTable.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/schema/IntermediateRelTable.scala
index e18fc27..e440bea 100644
--- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/schema/IntermediateRelTable.scala
+++ b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/schema/IntermediateRelTable.scala
@@ -28,10 +28,6 @@ import org.apache.calcite.rel.`type`.{RelDataType, RelDataTypeFactory}
   * An intermediate Table to wrap a optimized RelNode inside. The input data of this Table is
   * generated by the underlying optimized RelNode.
   *
-  * This table is very similar to [[RelTable]], they both wrap a RelNode, however they could not
-  * be unified. Because [[RelTable]] is treated as view which will be expanded before
-  * the optimization is started, this table will be expanded after the optimization is complete.
-  *
   * @param relNode       underlying optimized RelNode
   * @param isAccRetract  true if input data of table contain retraction messages.
   * @param statistic     statistics of current Table
diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/schema/RelTable.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/schema/RelTable.scala
deleted file mode 100644
index 4e5d45e..0000000
--- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/schema/RelTable.scala
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * 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.flink.table.plan.stats.FlinkStatistic
-
-import org.apache.calcite.plan.RelOptTable
-import org.apache.calcite.plan.RelOptTable.ToRelContext
-import org.apache.calcite.rel.RelNode
-import org.apache.calcite.rel.`type`.{RelDataType, RelDataTypeFactory}
-import org.apache.calcite.schema.Schema.TableType
-import org.apache.calcite.schema.TranslatableTable
-
-/**
- * A [[org.apache.calcite.schema.Table]] implementation for registering
- * Table API Tables in the Calcite schema to be used by Flink SQL.
- * It implements [[TranslatableTable]] so that its logical scan
- * can be converted to a relational expression.
- *
- * @see [[DataStreamTable]]
- */
-class RelTable(relNode: RelNode) extends FlinkTable with TranslatableTable {
-
-  override def getJdbcTableType: TableType = ???
-
-  override def getRowType(typeFactory: RelDataTypeFactory): RelDataType = relNode.getRowType
-
-  override def toRel(context: ToRelContext, relOptTable: RelOptTable): RelNode = {
-    relNode
-  }
-
-  override def getStatistic: FlinkStatistic = FlinkStatistic.UNKNOWN
-
-  override def copy(statistic: FlinkStatistic): FlinkTable = this
-}
diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/stats/FlinkStatistic.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/stats/FlinkStatistic.scala
index 30797b7..4565d00 100644
--- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/stats/FlinkStatistic.scala
+++ b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/stats/FlinkStatistic.scala
@@ -107,6 +107,27 @@ class FlinkStatistic(
 
   override def getReferentialConstraints: util.List[RelReferentialConstraint] =
     util.Collections.emptyList()
+
+  override def toString: String = {
+    val builder = new StringBuilder
+    if (tableStats != null) {
+      builder.append(s"TableStats: " +
+        s"{rowCount: ${tableStats.getRowCount}, " +
+        s"columnStats: ${tableStats.getColumnStats}}, ")
+    }
+    if (uniqueKeys != null) {
+      builder.append(s"uniqueKeys: $uniqueKeys, ")
+    }
+    if (relModifiedMonotonicity != null) {
+      builder.append(relModifiedMonotonicity.toString).append(", ")
+    }
+
+    if (builder.nonEmpty && builder.length() > 2) {
+      // delete `, ` if build is not empty
+      builder.delete(builder.length() - 2, builder.length())
+    }
+    builder.toString()
+  }
 }
 
 /**
diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/util/RelShuttles.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/util/RelShuttles.scala
index e7aaae1..28dc8a5 100644
--- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/util/RelShuttles.scala
+++ b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/util/RelShuttles.scala
@@ -17,13 +17,14 @@
  */
 package org.apache.flink.table.plan.util
 
-import org.apache.flink.table.plan.schema.RelTable
+import org.apache.flink.table.catalog.QueryOperationCatalogViewTable
 
 import com.google.common.collect.Sets
 import org.apache.calcite.plan.RelOptUtil
 import org.apache.calcite.rel.core.{TableFunctionScan, TableScan}
 import org.apache.calcite.rel.logical._
 import org.apache.calcite.rel.{RelNode, RelShuttle, RelShuttleImpl}
+import org.apache.calcite.rex.{RexNode, RexShuttle, RexSubQuery}
 
 import scala.collection.JavaConversions._
 
@@ -74,7 +75,8 @@ class DefaultRelShuttle extends RelShuttle {
 }
 
 /**
-  * Convert logical table scan to a relational expression.
+  * Convert all [[QueryOperationCatalogViewTable]]s (including tables in [[RexSubQuery]])
+  * to to a relational expression.
   */
 class ExpandTableScanShuttle extends RelShuttleImpl {
 
@@ -96,15 +98,81 @@ class ExpandTableScanShuttle extends RelShuttleImpl {
     }
   }
 
+  override def visit(filter: LogicalFilter): RelNode = {
+    val newCondition = filter.getCondition.accept(new ExpandTableScanInSubQueryShuttle)
+    if (newCondition ne filter.getCondition) {
+      val newFilter = filter.copy(filter.getTraitSet, filter.getInput, newCondition)
+      super.visit(newFilter)
+    } else {
+      super.visit(filter)
+    }
+  }
+
+  override def visit(project: LogicalProject): RelNode = {
+    val shuttle = new ExpandTableScanInSubQueryShuttle
+    var changed = false
+    val newProjects = project.getProjects.map {
+      project =>
+        val newProject = project.accept(shuttle)
+        if (newProject ne project) {
+          changed = true
+        }
+        newProject
+    }
+    if (changed) {
+      val newProject = project.copy(
+        project.getTraitSet, project.getInput, newProjects, project.getRowType)
+      super.visit(newProject)
+    } else {
+      super.visit(project)
+    }
+  }
+
+  override def visit(join: LogicalJoin): RelNode = {
+    val newCondition = join.getCondition.accept(new ExpandTableScanInSubQueryShuttle)
+    if (newCondition ne join.getCondition) {
+      val newJoin = join.copy(
+        join.getTraitSet, newCondition, join.getLeft, join.getRight,
+        join.getJoinType, join.isSemiJoinDone)
+      super.visit(newJoin)
+    } else {
+      super.visit(join)
+    }
+  }
+
+  class ExpandTableScanInSubQueryShuttle extends RexShuttle {
+    override def visitSubQuery(subQuery: RexSubQuery): RexNode = {
+      val newRel = subQuery.rel.accept(ExpandTableScanShuttle.this)
+      var changed = false
+      val newOperands = subQuery.getOperands.map { op =>
+        val newOp = op.accept(ExpandTableScanInSubQueryShuttle.this)
+        if (op ne newOp) {
+          changed = true
+        }
+        newOp
+      }
+
+      var newSubQuery = subQuery
+      if (newRel ne newSubQuery.rel) {
+        newSubQuery = newSubQuery.clone(newRel)
+      }
+      if (changed) {
+        newSubQuery = newSubQuery.clone(newSubQuery.getType, newOperands)
+      }
+      newSubQuery
+    }
+  }
+
   /**
-    * Converts [[LogicalTableScan]] the result [[RelNode]] tree by calling [[RelTable]]#toRel
+    * Converts [[LogicalTableScan]] the result [[RelNode]] tree
+    * by calling [[QueryOperationCatalogViewTable]]#toRel
     */
   override def visit(scan: TableScan): RelNode = {
     scan match {
       case tableScan: LogicalTableScan =>
-        val relTable = tableScan.getTable.unwrap(classOf[RelTable])
-        if (relTable != null) {
-          val rel = relTable.toRel(RelOptUtil.getContext(tableScan.getCluster), tableScan.getTable)
+        val viewTable = tableScan.getTable.unwrap(classOf[QueryOperationCatalogViewTable])
+        if (viewTable != null) {
+          val rel = viewTable.toRel(RelOptUtil.getContext(tableScan.getCluster), tableScan.getTable)
           rel.accept(this)
         } else {
           tableScan
diff --git a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/util/JavaScalaConversionUtil.scala b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/util/JavaScalaConversionUtil.scala
index bee0b0e..48e9c2d 100644
--- a/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/util/JavaScalaConversionUtil.scala
+++ b/flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/util/JavaScalaConversionUtil.scala
@@ -64,4 +64,8 @@ object JavaScalaConversionUtil {
   def toJava[T](seq: Seq[T]): JList[T] = {
     seq.asJava
   }
+
+  def toScala[T](list: JList[T]): Seq[T] = {
+    list.asScala
+  }
 }
diff --git a/flink-table/flink-table-planner-blink/src/test/resources/digest/testGetDigestWithDynamicFunction.out b/flink-table/flink-table-planner-blink/src/test/resources/digest/testGetDigestWithDynamicFunction.out
index f4ba617..ce5f0cd 100644
--- a/flink-table/flink-table-planner-blink/src/test/resources/digest/testGetDigestWithDynamicFunction.out
+++ b/flink-table/flink-table-planner-blink/src/test/resources/digest/testGetDigestWithDynamicFunction.out
@@ -20,12 +20,12 @@ LogicalIntersect(all=[false],rowType=[RecordType(INTEGER random)])
 LogicalProject(random=[$0],rowType=[RecordType(INTEGER random)])
 LogicalSort(sort0=[$1], dir0=[ASC-nulls-first], fetch=[1],rowType=[RecordType(INTEGER random, DOUBLE EXPR$1)])
 LogicalProject(random=[$1], EXPR$1=[RAND()],rowType=[RecordType(INTEGER random, DOUBLE EXPR$1)])
-LogicalTableScan(table=[[MyTable]],rowType=[RecordType(VARCHAR(2147483647) first, INTEGER id, DOUBLE score, VARCHAR(2147483647) last)])
+LogicalTableScan(table=[[default_catalog, default_database, MyTable]],rowType=[RecordType(VARCHAR(2147483647) first, INTEGER id, DOUBLE score, VARCHAR(2147483647) last)])
 LogicalProject(random=[$0],rowType=[RecordType(INTEGER random)])
 LogicalSort(sort0=[$1], dir0=[ASC-nulls-first], fetch=[1],rowType=[RecordType(INTEGER random, DOUBLE EXPR$1)])
 LogicalProject(random=[$1], EXPR$1=[RAND()],rowType=[RecordType(INTEGER random, DOUBLE EXPR$1)])
-LogicalTableScan(table=[[MyTable]],rowType=[RecordType(VARCHAR(2147483647) first, INTEGER id, DOUBLE score, VARCHAR(2147483647) last)])
+LogicalTableScan(table=[[default_catalog, default_database, MyTable]],rowType=[RecordType(VARCHAR(2147483647) first, INTEGER id, DOUBLE score, VARCHAR(2147483647) last)])
 LogicalProject(random=[$0],rowType=[RecordType(INTEGER random)])
 LogicalSort(sort0=[$1], dir0=[ASC-nulls-first], fetch=[1],rowType=[RecordType(INTEGER random, DOUBLE EXPR$1)])
 LogicalProject(random=[$1], EXPR$1=[RAND()],rowType=[RecordType(INTEGER random, DOUBLE EXPR$1)])
-LogicalTableScan(table=[[MyTable]],rowType=[RecordType(VARCHAR(2147483647) first, INTEGER id, DOUBLE score, VARCHAR(2147483647) last)])
+LogicalTableScan(table=[[default_catalog, default_database, MyTable]],rowType=[RecordType(VARCHAR(2147483647) first, INTEGER id, DOUBLE score, VARCHAR(2147483647) last)])
diff --git a/flink-table/flink-table-planner-blink/src/test/resources/digest/testGetDigestWithDynamicFunctionView.out b/flink-table/flink-table-planner-blink/src/test/resources/digest/testGetDigestWithDynamicFunctionView.out
index 3a70077..52e47ee 100644
--- a/flink-table/flink-table-planner-blink/src/test/resources/digest/testGetDigestWithDynamicFunctionView.out
+++ b/flink-table/flink-table-planner-blink/src/test/resources/digest/testGetDigestWithDynamicFunctionView.out
@@ -21,14 +21,14 @@ LogicalProject(random=[$0],rowType=[RecordType(INTEGER random)])
 LogicalProject(random=[$0],rowType=[RecordType(INTEGER random)])
 LogicalSort(sort0=[$1], dir0=[ASC-nulls-first], fetch=[1],rowType=[RecordType(INTEGER random, DOUBLE EXPR$1)])
 LogicalProject(random=[$1], EXPR$1=[RAND()],rowType=[RecordType(INTEGER random, DOUBLE EXPR$1)])
-LogicalTableScan(table=[[MyTable]],rowType=[RecordType(VARCHAR(2147483647) first, INTEGER id, DOUBLE score, VARCHAR(2147483647) last)])
+LogicalTableScan(table=[[default_catalog, default_database, MyTable]],rowType=[RecordType(VARCHAR(2147483647) first, INTEGER id, DOUBLE score, VARCHAR(2147483647) last)])
 LogicalProject(random=[$0],rowType=[RecordType(INTEGER random)])
 LogicalProject(random=[$0],rowType=[RecordType(INTEGER random)])
 LogicalSort(sort0=[$1], dir0=[ASC-nulls-first], fetch=[1],rowType=[RecordType(INTEGER random, DOUBLE EXPR$1)])
 LogicalProject(random=[$1], EXPR$1=[RAND()],rowType=[RecordType(INTEGER random, DOUBLE EXPR$1)])
-LogicalTableScan(table=[[MyTable]],rowType=[RecordType(VARCHAR(2147483647) first, INTEGER id, DOUBLE score, VARCHAR(2147483647) last)])
+LogicalTableScan(table=[[default_catalog, default_database, MyTable]],rowType=[RecordType(VARCHAR(2147483647) first, INTEGER id, DOUBLE score, VARCHAR(2147483647) last)])
 LogicalProject(random=[$0],rowType=[RecordType(INTEGER random)])
 LogicalProject(random=[$0],rowType=[RecordType(INTEGER random)])
 LogicalSort(sort0=[$1], dir0=[ASC-nulls-first], fetch=[1],rowType=[RecordType(INTEGER random, DOUBLE EXPR$1)])
 LogicalProject(random=[$1], EXPR$1=[RAND()],rowType=[RecordType(INTEGER random, DOUBLE EXPR$1)])
-LogicalTableScan(table=[[MyTable]],rowType=[RecordType(VARCHAR(2147483647) first, INTEGER id, DOUBLE score, VARCHAR(2147483647) last)])
+LogicalTableScan(table=[[default_catalog, default_database, MyTable]],rowType=[RecordType(VARCHAR(2147483647) first, INTEGER id, DOUBLE score, VARCHAR(2147483647) last)])
diff --git a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/api/batch/ExplainTest.xml b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/api/batch/ExplainTest.xml
index 3cd0486..1e5c1a9 100644
--- a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/api/batch/ExplainTest.xml
+++ b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/api/batch/ExplainTest.xml
@@ -22,7 +22,7 @@ limitations under the License.
 LogicalProject(EXPR$0=[$1])
 +- LogicalAggregate(group=[{0}], EXPR$0=[COUNT()])
    +- LogicalProject(a=[$0])
-      +- LogicalTableScan(table=[[MyTable1]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1]])
 
 == Optimized Logical Plan ==
 Calc(select=[EXPR$0])
@@ -30,14 +30,14 @@ Calc(select=[EXPR$0])
    +- Exchange(distribution=[hash[a]])
       +- LocalHashAggregate(groupBy=[a], select=[a, Partial_COUNT(*) AS count1$0])
          +- Calc(select=[a])
-            +- BoundedStreamScan(table=[[MyTable1]], fields=[a, b, c])
+            +- BoundedStreamScan(table=[[default_catalog, default_database, MyTable1]], fields=[a, b, c])
 
 == Physical Execution Plan ==
  : Data Source
 	content : collect elements with CollectionInputFormat
 
 	 : Operator
-		content : SourceConversion(table:Buffer(MyTable1), fields:(a, b, c))
+		content : SourceConversion(table:Buffer(default_catalog, default_database, MyTable1), fields:(a, b, c))
 		ship_strategy : FORWARD
 
 		 : Operator
@@ -65,7 +65,7 @@ Calc(select=[EXPR$0])
 LogicalProject(EXPR$0=[$1])
 +- LogicalAggregate(group=[{0}], EXPR$0=[COUNT()])
    +- LogicalProject(a=[$0])
-      +- LogicalTableScan(table=[[MyTable1]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1]])
 
 == Optimized Logical Plan ==
 Calc(select=[EXPR$0]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
@@ -73,14 +73,14 @@ Calc(select=[EXPR$0]): rowcount = , cumulative cost = {rows, cpu, io, network, m
    +- Exchange(distribution=[hash[a]]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
       +- LocalHashAggregate(groupBy=[a], select=[a, Partial_COUNT(*) AS count1$0]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
          +- Calc(select=[a]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
-            +- BoundedStreamScan(table=[[MyTable1]], fields=[a, b, c]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
+            +- BoundedStreamScan(table=[[default_catalog, default_database, MyTable1]], fields=[a, b, c]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
 
 == Physical Execution Plan ==
  : Data Source
 	content : collect elements with CollectionInputFormat
 
 	 : Operator
-		content : SourceConversion(table:Buffer(MyTable1), fields:(a, b, c))
+		content : SourceConversion(table:Buffer(default_catalog, default_database, MyTable1), fields:(a, b, c))
 		ship_strategy : FORWARD
 
 		 : Operator
@@ -106,17 +106,17 @@ Calc(select=[EXPR$0]): rowcount = , cumulative cost = {rows, cpu, io, network, m
     <Resource name="explain">
       <![CDATA[== Abstract Syntax Tree ==
 LogicalProject(a=[$0], b=[$1], c=[$2])
-+- LogicalTableScan(table=[[MyTable1]])
++- LogicalTableScan(table=[[default_catalog, default_database, MyTable1]])
 
 == Optimized Logical Plan ==
-BoundedStreamScan(table=[[MyTable1]], fields=[a, b, c])
+BoundedStreamScan(table=[[default_catalog, default_database, MyTable1]], fields=[a, b, c])
 
 == Physical Execution Plan ==
  : Data Source
 	content : collect elements with CollectionInputFormat
 
 	 : Operator
-		content : SourceConversion(table:Buffer(MyTable1), fields:(a, b, c))
+		content : SourceConversion(table:Buffer(default_catalog, default_database, MyTable1), fields:(a, b, c))
 		ship_strategy : FORWARD
 
 ]]>
@@ -126,17 +126,17 @@ BoundedStreamScan(table=[[MyTable1]], fields=[a, b, c])
     <Resource name="explain">
       <![CDATA[== Abstract Syntax Tree ==
 LogicalProject(a=[$0], b=[$1], c=[$2])
-+- LogicalTableScan(table=[[MyTable1]])
++- LogicalTableScan(table=[[default_catalog, default_database, MyTable1]])
 
 == Optimized Logical Plan ==
-BoundedStreamScan(table=[[MyTable1]], fields=[a, b, c]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
+BoundedStreamScan(table=[[default_catalog, default_database, MyTable1]], fields=[a, b, c]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
 
 == Physical Execution Plan ==
  : Data Source
 	content : collect elements with CollectionInputFormat
 
 	 : Operator
-		content : SourceConversion(table:Buffer(MyTable1), fields:(a, b, c))
+		content : SourceConversion(table:Buffer(default_catalog, default_database, MyTable1), fields:(a, b, c))
 		ship_strategy : FORWARD
 
 ]]>
@@ -147,18 +147,18 @@ BoundedStreamScan(table=[[MyTable1]], fields=[a, b, c]): rowcount = , cumulative
       <![CDATA[== Abstract Syntax Tree ==
 LogicalProject(a=[$0], b=[$1], c=[$2])
 +- LogicalFilter(condition=[=(MOD($0, 2), 0)])
-   +- LogicalTableScan(table=[[MyTable1]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1]])
 
 == Optimized Logical Plan ==
 Calc(select=[a, b, c], where=[=(MOD(a, 2), 0)])
-+- BoundedStreamScan(table=[[MyTable1]], fields=[a, b, c])
++- BoundedStreamScan(table=[[default_catalog, default_database, MyTable1]], fields=[a, b, c])
 
 == Physical Execution Plan ==
  : Data Source
 	content : collect elements with CollectionInputFormat
 
 	 : Operator
-		content : SourceConversion(table:Buffer(MyTable1), fields:(a, b, c))
+		content : SourceConversion(table:Buffer(default_catalog, default_database, MyTable1), fields:(a, b, c))
 		ship_strategy : FORWARD
 
 		 : Operator
@@ -173,18 +173,18 @@ Calc(select=[a, b, c], where=[=(MOD(a, 2), 0)])
       <![CDATA[== Abstract Syntax Tree ==
 LogicalProject(a=[$0], b=[$1], c=[$2])
 +- LogicalFilter(condition=[=(MOD($0, 2), 0)])
-   +- LogicalTableScan(table=[[MyTable1]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1]])
 
 == Optimized Logical Plan ==
 Calc(select=[a, b, c], where=[=(MOD(a, 2), 0)]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
-+- BoundedStreamScan(table=[[MyTable1]], fields=[a, b, c]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
++- BoundedStreamScan(table=[[default_catalog, default_database, MyTable1]], fields=[a, b, c]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
 
 == Physical Execution Plan ==
  : Data Source
 	content : collect elements with CollectionInputFormat
 
 	 : Operator
-		content : SourceConversion(table:Buffer(MyTable1), fields:(a, b, c))
+		content : SourceConversion(table:Buffer(default_catalog, default_database, MyTable1), fields:(a, b, c))
 		ship_strategy : FORWARD
 
 		 : Operator
@@ -200,16 +200,16 @@ Calc(select=[a, b, c], where=[=(MOD(a, 2), 0)]): rowcount = , cumulative cost =
 LogicalProject(a=[$0], b=[$1], c=[$2], e=[$4], f=[$5])
 +- LogicalFilter(condition=[=($0, $3)])
    +- LogicalJoin(condition=[true], joinType=[inner])
-      :- LogicalTableScan(table=[[MyTable1]])
-      +- LogicalTableScan(table=[[MyTable2]])
+      :- LogicalTableScan(table=[[default_catalog, default_database, MyTable1]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable2]])
 
 == Optimized Logical Plan ==
 Calc(select=[a, b, c, e, f])
 +- SortMergeJoin(joinType=[InnerJoin], where=[=(a, d)], select=[a, b, c, d, e, f])
    :- Exchange(distribution=[hash[a]])
-   :  +- BoundedStreamScan(table=[[MyTable1]], fields=[a, b, c])
+   :  +- BoundedStreamScan(table=[[default_catalog, default_database, MyTable1]], fields=[a, b, c])
    +- Exchange(distribution=[hash[d]])
-      +- BoundedStreamScan(table=[[MyTable2]], fields=[d, e, f])
+      +- BoundedStreamScan(table=[[default_catalog, default_database, MyTable2]], fields=[d, e, f])
 
 == Physical Execution Plan ==
  : Data Source
@@ -219,11 +219,11 @@ Calc(select=[a, b, c, e, f])
 	content : collect elements with CollectionInputFormat
 
 	 : Operator
-		content : SourceConversion(table:Buffer(MyTable1), fields:(a, b, c))
+		content : SourceConversion(table:Buffer(default_catalog, default_database, MyTable1), fields:(a, b, c))
 		ship_strategy : FORWARD
 
 		 : Operator
-			content : SourceConversion(table:Buffer(MyTable2), fields:(d, e, f))
+			content : SourceConversion(table:Buffer(default_catalog, default_database, MyTable2), fields:(d, e, f))
 			ship_strategy : FORWARD
 
 			 : Operator
@@ -243,16 +243,16 @@ Calc(select=[a, b, c, e, f])
 LogicalProject(a=[$0], b=[$1], c=[$2], e=[$4], f=[$5])
 +- LogicalFilter(condition=[=($0, $3)])
    +- LogicalJoin(condition=[true], joinType=[inner])
-      :- LogicalTableScan(table=[[MyTable1]])
-      +- LogicalTableScan(table=[[MyTable2]])
+      :- LogicalTableScan(table=[[default_catalog, default_database, MyTable1]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable2]])
 
 == Optimized Logical Plan ==
 Calc(select=[a, b, c, e, f]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
 +- SortMergeJoin(joinType=[InnerJoin], where=[=(a, d)], select=[a, b, c, d, e, f]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
    :- Exchange(distribution=[hash[a]]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
-   :  +- BoundedStreamScan(table=[[MyTable1]], fields=[a, b, c]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
+   :  +- BoundedStreamScan(table=[[default_catalog, default_database, MyTable1]], fields=[a, b, c]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
    +- Exchange(distribution=[hash[d]]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
-      +- BoundedStreamScan(table=[[MyTable2]], fields=[d, e, f]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
+      +- BoundedStreamScan(table=[[default_catalog, default_database, MyTable2]], fields=[d, e, f]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
 
 == Physical Execution Plan ==
  : Data Source
@@ -262,11 +262,11 @@ Calc(select=[a, b, c, e, f]): rowcount = , cumulative cost = {rows, cpu, io, net
 	content : collect elements with CollectionInputFormat
 
 	 : Operator
-		content : SourceConversion(table:Buffer(MyTable1), fields:(a, b, c))
+		content : SourceConversion(table:Buffer(default_catalog, default_database, MyTable1), fields:(a, b, c))
 		ship_strategy : FORWARD
 
 		 : Operator
-			content : SourceConversion(table:Buffer(MyTable2), fields:(d, e, f))
+			content : SourceConversion(table:Buffer(default_catalog, default_database, MyTable2), fields:(d, e, f))
 			ship_strategy : FORWARD
 
 			 : Operator
@@ -288,21 +288,21 @@ LogicalSink(name=[sink1], fields=[a, cnt])
    +- LogicalFilter(condition=[>($1, 10)])
       +- LogicalAggregate(group=[{0}], cnt=[COUNT()])
          +- LogicalProject(a=[$0])
-            +- LogicalTableScan(table=[[MyTable1]])
+            +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1]])
 
 LogicalSink(name=[sink1], fields=[a, cnt])
 +- LogicalProject(a=[$0], cnt=[$1])
    +- LogicalFilter(condition=[<($1, 10)])
       +- LogicalAggregate(group=[{0}], cnt=[COUNT()])
          +- LogicalProject(a=[$0])
-            +- LogicalTableScan(table=[[MyTable1]])
+            +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1]])
 
 == Optimized Logical Plan ==
 HashAggregate(isMerge=[true], groupBy=[a], select=[a, Final_COUNT(count1$0) AS cnt], reuse_id=[1])
 +- Exchange(distribution=[hash[a]])
    +- LocalHashAggregate(groupBy=[a], select=[a, Partial_COUNT(*) AS count1$0])
       +- Calc(select=[a])
-         +- BoundedStreamScan(table=[[MyTable1]], fields=[a, b, c])
+         +- BoundedStreamScan(table=[[default_catalog, default_database, MyTable1]], fields=[a, b, c])
 
 Sink(name=[sink1], fields=[a, cnt])
 +- Calc(select=[a, cnt], where=[>(cnt, 10)])
@@ -317,7 +317,7 @@ Sink(name=[sink1], fields=[a, cnt])
 	content : collect elements with CollectionInputFormat
 
 	 : Operator
-		content : SourceConversion(table:Buffer(MyTable1), fields:(a, b, c))
+		content : SourceConversion(table:Buffer(default_catalog, default_database, MyTable1), fields:(a, b, c))
 		ship_strategy : FORWARD
 
 		 : Operator
@@ -367,21 +367,21 @@ LogicalSink(name=[sink1], fields=[a, cnt])
    +- LogicalFilter(condition=[>($1, 10)])
       +- LogicalAggregate(group=[{0}], cnt=[COUNT()])
          +- LogicalProject(a=[$0])
-            +- LogicalTableScan(table=[[MyTable1]])
+            +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1]])
 
 LogicalSink(name=[sink1], fields=[a, cnt])
 +- LogicalProject(a=[$0], cnt=[$1])
    +- LogicalFilter(condition=[<($1, 10)])
       +- LogicalAggregate(group=[{0}], cnt=[COUNT()])
          +- LogicalProject(a=[$0])
-            +- LogicalTableScan(table=[[MyTable1]])
+            +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1]])
 
 == Optimized Logical Plan ==
 HashAggregate(isMerge=[true], groupBy=[a], select=[a, Final_COUNT(count1$0) AS cnt], reuse_id=[1]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
 +- Exchange(distribution=[hash[a]]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
    +- LocalHashAggregate(groupBy=[a], select=[a, Partial_COUNT(*) AS count1$0]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
       +- Calc(select=[a]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
-         +- BoundedStreamScan(table=[[MyTable1]], fields=[a, b, c]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
+         +- BoundedStreamScan(table=[[default_catalog, default_database, MyTable1]], fields=[a, b, c]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
 
 Sink(name=[sink1], fields=[a, cnt]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
 +- Calc(select=[a, cnt], where=[>(cnt, 10)]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
@@ -396,7 +396,7 @@ Sink(name=[sink1], fields=[a, cnt]): rowcount = , cumulative cost = {rows, cpu,
 	content : collect elements with CollectionInputFormat
 
 	 : Operator
-		content : SourceConversion(table:Buffer(MyTable1), fields:(a, b, c))
+		content : SourceConversion(table:Buffer(default_catalog, default_database, MyTable1), fields:(a, b, c))
 		ship_strategy : FORWARD
 
 		 : Operator
@@ -444,19 +444,19 @@ Sink(name=[sink1], fields=[a, cnt]): rowcount = , cumulative cost = {rows, cpu,
 LogicalSink(fields=[a, b, c])
 +- LogicalProject(a=[$0], b=[$1], c=[$2])
    +- LogicalFilter(condition=[>($0, 10)])
-      +- LogicalTableScan(table=[[MyTable1]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1]])
 
 == Optimized Logical Plan ==
 Sink(fields=[a, b, c])
 +- Calc(select=[a, b, c], where=[>(a, 10)])
-   +- BoundedStreamScan(table=[[MyTable1]], fields=[a, b, c])
+   +- BoundedStreamScan(table=[[default_catalog, default_database, MyTable1]], fields=[a, b, c])
 
 == Physical Execution Plan ==
  : Data Source
 	content : collect elements with CollectionInputFormat
 
 	 : Operator
-		content : SourceConversion(table:Buffer(MyTable1), fields:(a, b, c))
+		content : SourceConversion(table:Buffer(default_catalog, default_database, MyTable1), fields:(a, b, c))
 		ship_strategy : FORWARD
 
 		 : Operator
@@ -480,19 +480,19 @@ Sink(fields=[a, b, c])
 LogicalSink(fields=[a, b, c])
 +- LogicalProject(a=[$0], b=[$1], c=[$2])
    +- LogicalFilter(condition=[>($0, 10)])
-      +- LogicalTableScan(table=[[MyTable1]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1]])
 
 == Optimized Logical Plan ==
 Sink(fields=[a, b, c]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
 +- Calc(select=[a, b, c], where=[>(a, 10)]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
-   +- BoundedStreamScan(table=[[MyTable1]], fields=[a, b, c]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
+   +- BoundedStreamScan(table=[[default_catalog, default_database, MyTable1]], fields=[a, b, c]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
 
 == Physical Execution Plan ==
  : Data Source
 	content : collect elements with CollectionInputFormat
 
 	 : Operator
-		content : SourceConversion(table:Buffer(MyTable1), fields:(a, b, c))
+		content : SourceConversion(table:Buffer(default_catalog, default_database, MyTable1), fields:(a, b, c))
 		ship_strategy : FORWARD
 
 		 : Operator
@@ -515,20 +515,20 @@ Sink(fields=[a, b, c]): rowcount = , cumulative cost = {rows, cpu, io, network,
       <![CDATA[== Abstract Syntax Tree ==
 LogicalSort(sort0=[$0], dir0=[ASC-nulls-first], fetch=[5])
 +- LogicalProject(a=[$0], b=[$1], c=[$2])
-   +- LogicalTableScan(table=[[MyTable1]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1]])
 
 == Optimized Logical Plan ==
 SortLimit(orderBy=[a ASC], offset=[0], fetch=[5], global=[true])
 +- Exchange(distribution=[single])
    +- SortLimit(orderBy=[a ASC], offset=[0], fetch=[5], global=[false])
-      +- BoundedStreamScan(table=[[MyTable1]], fields=[a, b, c])
+      +- BoundedStreamScan(table=[[default_catalog, default_database, MyTable1]], fields=[a, b, c])
 
 == Physical Execution Plan ==
  : Data Source
 	content : collect elements with CollectionInputFormat
 
 	 : Operator
-		content : SourceConversion(table:Buffer(MyTable1), fields:(a, b, c))
+		content : SourceConversion(table:Buffer(default_catalog, default_database, MyTable1), fields:(a, b, c))
 		ship_strategy : FORWARD
 
 		 : Operator
@@ -547,20 +547,20 @@ SortLimit(orderBy=[a ASC], offset=[0], fetch=[5], global=[true])
       <![CDATA[== Abstract Syntax Tree ==
 LogicalSort(sort0=[$0], dir0=[ASC-nulls-first], fetch=[5])
 +- LogicalProject(a=[$0], b=[$1], c=[$2])
-   +- LogicalTableScan(table=[[MyTable1]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1]])
 
 == Optimized Logical Plan ==
 SortLimit(orderBy=[a ASC], offset=[0], fetch=[5], global=[true]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
 +- Exchange(distribution=[single]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
    +- SortLimit(orderBy=[a ASC], offset=[0], fetch=[5], global=[false]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
-      +- BoundedStreamScan(table=[[MyTable1]], fields=[a, b, c]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
+      +- BoundedStreamScan(table=[[default_catalog, default_database, MyTable1]], fields=[a, b, c]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
 
 == Physical Execution Plan ==
  : Data Source
 	content : collect elements with CollectionInputFormat
 
 	 : Operator
-		content : SourceConversion(table:Buffer(MyTable1), fields:(a, b, c))
+		content : SourceConversion(table:Buffer(default_catalog, default_database, MyTable1), fields:(a, b, c))
 		ship_strategy : FORWARD
 
 		 : Operator
@@ -578,10 +578,10 @@ SortLimit(orderBy=[a ASC], offset=[0], fetch=[5], global=[true]): rowcount = , c
     <Resource name="explain">
       <![CDATA[== Abstract Syntax Tree ==
 LogicalProject(a=[$0], b=[$1], c=[$2])
-+- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
++- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 
 == Optimized Logical Plan ==
-TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 
 == Physical Execution Plan ==
  : Data Source
@@ -594,10 +594,10 @@ TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a
     <Resource name="explain">
       <![CDATA[== Abstract Syntax Tree ==
 LogicalProject(a=[$0], b=[$1], c=[$2])
-+- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
++- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 
 == Optimized Logical Plan ==
-TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
+TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
 
 == Physical Execution Plan ==
  : Data Source
@@ -611,14 +611,14 @@ TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a
       <![CDATA[== Abstract Syntax Tree ==
 LogicalUnion(all=[true])
 :- LogicalProject(a=[$0], b=[$1], c=[$2])
-:  +- LogicalTableScan(table=[[MyTable1]])
+:  +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1]])
 +- LogicalProject(d=[$0], e=[$1], f=[$2])
-   +- LogicalTableScan(table=[[MyTable2]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable2]])
 
 == Optimized Logical Plan ==
 Union(all=[true], union=[a, b, c]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
-:- BoundedStreamScan(table=[[MyTable1]], fields=[a, b, c]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
-+- BoundedStreamScan(table=[[MyTable2]], fields=[d, e, f]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
+:- BoundedStreamScan(table=[[default_catalog, default_database, MyTable1]], fields=[a, b, c]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
++- BoundedStreamScan(table=[[default_catalog, default_database, MyTable2]], fields=[d, e, f]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
 
 == Physical Execution Plan ==
  : Data Source
@@ -628,11 +628,11 @@ Union(all=[true], union=[a, b, c]): rowcount = , cumulative cost = {rows, cpu, i
 	content : collect elements with CollectionInputFormat
 
 	 : Operator
-		content : SourceConversion(table:Buffer(MyTable1), fields:(a, b, c))
+		content : SourceConversion(table:Buffer(default_catalog, default_database, MyTable1), fields:(a, b, c))
 		ship_strategy : FORWARD
 
 		 : Operator
-			content : SourceConversion(table:Buffer(MyTable2), fields:(d, e, f))
+			content : SourceConversion(table:Buffer(default_catalog, default_database, MyTable2), fields:(d, e, f))
 			ship_strategy : FORWARD
 
 ]]>
@@ -643,14 +643,14 @@ Union(all=[true], union=[a, b, c]): rowcount = , cumulative cost = {rows, cpu, i
       <![CDATA[== Abstract Syntax Tree ==
 LogicalUnion(all=[true])
 :- LogicalProject(a=[$0], b=[$1], c=[$2])
-:  +- LogicalTableScan(table=[[MyTable1]])
+:  +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1]])
 +- LogicalProject(d=[$0], e=[$1], f=[$2])
-   +- LogicalTableScan(table=[[MyTable2]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable2]])
 
 == Optimized Logical Plan ==
 Union(all=[true], union=[a, b, c])
-:- BoundedStreamScan(table=[[MyTable1]], fields=[a, b, c])
-+- BoundedStreamScan(table=[[MyTable2]], fields=[d, e, f])
+:- BoundedStreamScan(table=[[default_catalog, default_database, MyTable1]], fields=[a, b, c])
++- BoundedStreamScan(table=[[default_catalog, default_database, MyTable2]], fields=[d, e, f])
 
 == Physical Execution Plan ==
  : Data Source
@@ -660,11 +660,11 @@ Union(all=[true], union=[a, b, c])
 	content : collect elements with CollectionInputFormat
 
 	 : Operator
-		content : SourceConversion(table:Buffer(MyTable1), fields:(a, b, c))
+		content : SourceConversion(table:Buffer(default_catalog, default_database, MyTable1), fields:(a, b, c))
 		ship_strategy : FORWARD
 
 		 : Operator
-			content : SourceConversion(table:Buffer(MyTable2), fields:(d, e, f))
+			content : SourceConversion(table:Buffer(default_catalog, default_database, MyTable2), fields:(d, e, f))
 			ship_strategy : FORWARD
 
 ]]>
diff --git a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/api/batch/TableStatsTest.xml b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/api/batch/TableStatsTest.xml
index 2026490..1a43a52 100644
--- a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/api/batch/TableStatsTest.xml
+++ b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/api/batch/TableStatsTest.xml
@@ -27,17 +27,18 @@ SELECT * FROM x, y WHERE a = d AND c LIKE 'He%'
 LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5])
 +- LogicalFilter(condition=[AND(=($0, $3), LIKE($2, _UTF-16LE'He%'))])
    +- LogicalJoin(condition=[true], joinType=[inner])
-      :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
-      +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+      :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
-HashJoin(joinType=[InnerJoin], where=[=(a, d)], select=[a, b, c, d, e, f], isBroadcast=[true], build=[right])
-:- Calc(select=[a, b, c], where=[LIKE(c, _UTF-16LE'He%')])
-:  +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
-+- Exchange(distribution=[broadcast])
-   +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+HashJoin(joinType=[InnerJoin], where=[=(a, d)], select=[a, b, c, d, e, f], build=[left])
+:- Exchange(distribution=[hash[a]])
+:  +- Calc(select=[a, b, c], where=[LIKE(c, _UTF-16LE'He%')])
+:     +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
++- Exchange(distribution=[hash[d]])
+   +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 ]]>
     </Resource>
   </TestCase>
@@ -52,17 +53,18 @@ SELECT * FROM x, y WHERE a = d AND c LIKE 'He%'
 LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5])
 +- LogicalFilter(condition=[AND(=($0, $3), LIKE($2, _UTF-16LE'He%'))])
    +- LogicalJoin(condition=[true], joinType=[inner])
-      :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
-      +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+      :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
-HashJoin(joinType=[InnerJoin], where=[=(a, d)], select=[a, b, c, d, e, f], isBroadcast=[true], build=[left])
-:- Exchange(distribution=[broadcast])
+HashJoin(joinType=[InnerJoin], where=[=(a, d)], select=[a, b, c, d, e, f], build=[left])
+:- Exchange(distribution=[hash[a]])
 :  +- Calc(select=[a, b, c], where=[LIKE(c, _UTF-16LE'He%')])
-:     +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
-+- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+:     +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
++- Exchange(distribution=[hash[d]])
+   +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 ]]>
     </Resource>
   </TestCase>
diff --git a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/api/stream/ExplainTest.xml b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/api/stream/ExplainTest.xml
index b2a9e99..5398418 100644
--- a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/api/stream/ExplainTest.xml
+++ b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/api/stream/ExplainTest.xml
@@ -20,17 +20,17 @@ limitations under the License.
     <Resource name="explain">
       <![CDATA[== Abstract Syntax Tree ==
 LogicalProject(a=[$0], b=[$1], c=[$2])
-+- LogicalTableScan(table=[[MyTable1]])
++- LogicalTableScan(table=[[default_catalog, default_database, MyTable1]])
 
 == Optimized Logical Plan ==
-DataStreamScan(table=[[MyTable1]], fields=[a, b, c])
+DataStreamScan(table=[[default_catalog, default_database, MyTable1]], fields=[a, b, c])
 
 == Physical Execution Plan ==
  : Data Source
 	content : collect elements with CollectionInputFormat
 
 	 : Operator
-		content : SourceConversion(table:Buffer(MyTable1), fields:(a, b, c))
+		content : SourceConversion(table:Buffer(default_catalog, default_database, MyTable1), fields:(a, b, c))
 		ship_strategy : FORWARD
 
 ]]>
@@ -42,21 +42,21 @@ DataStreamScan(table=[[MyTable1]], fields=[a, b, c])
 LogicalProject(EXPR$0=[$1])
 +- LogicalAggregate(group=[{0}], EXPR$0=[COUNT()])
    +- LogicalProject(a=[$0])
-      +- LogicalTableScan(table=[[MyTable1]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1]])
 
 == Optimized Logical Plan ==
 Calc(select=[EXPR$0], updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
 +- GroupAggregate(groupBy=[a], select=[a, COUNT(*) AS EXPR$0], updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
    +- Exchange(distribution=[hash[a]], updateAsRetraction=[true], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
       +- Calc(select=[a], updateAsRetraction=[true], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
-         +- DataStreamScan(table=[[MyTable1]], fields=[a, b, c], updateAsRetraction=[true], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
+         +- DataStreamScan(table=[[default_catalog, default_database, MyTable1]], fields=[a, b, c], updateAsRetraction=[true], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
 
 == Physical Execution Plan ==
  : Data Source
 	content : collect elements with CollectionInputFormat
 
 	 : Operator
-		content : SourceConversion(table:Buffer(MyTable1), fields:(a, b, c))
+		content : SourceConversion(table:Buffer(default_catalog, default_database, MyTable1), fields:(a, b, c))
 		ship_strategy : FORWARD
 
 		 : Operator
@@ -78,17 +78,17 @@ Calc(select=[EXPR$0], updateAsRetraction=[false], accMode=[Acc]): rowcount = , c
     <Resource name="explain">
       <![CDATA[== Abstract Syntax Tree ==
 LogicalProject(a=[$0], b=[$1], c=[$2])
-+- LogicalTableScan(table=[[MyTable1]])
++- LogicalTableScan(table=[[default_catalog, default_database, MyTable1]])
 
 == Optimized Logical Plan ==
-DataStreamScan(table=[[MyTable1]], fields=[a, b, c], updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
+DataStreamScan(table=[[default_catalog, default_database, MyTable1]], fields=[a, b, c], updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
 
 == Physical Execution Plan ==
  : Data Source
 	content : collect elements with CollectionInputFormat
 
 	 : Operator
-		content : SourceConversion(table:Buffer(MyTable1), fields:(a, b, c))
+		content : SourceConversion(table:Buffer(default_catalog, default_database, MyTable1), fields:(a, b, c))
 		ship_strategy : FORWARD
 
 ]]>
@@ -98,10 +98,10 @@ DataStreamScan(table=[[MyTable1]], fields=[a, b, c], updateAsRetraction=[false],
     <Resource name="explain">
       <![CDATA[== Abstract Syntax Tree ==
 LogicalProject(a=[$0], b=[$1], c=[$2])
-+- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
++- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 
 == Optimized Logical Plan ==
-TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 
 == Physical Execution Plan ==
  : Data Source
@@ -114,10 +114,10 @@ TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a
     <Resource name="explain">
       <![CDATA[== Abstract Syntax Tree ==
 LogicalProject(a=[$0], b=[$1], c=[$2])
-+- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
++- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 
 == Optimized Logical Plan ==
-TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c], updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
+TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c], updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
 
 == Physical Execution Plan ==
  : Data Source
@@ -132,21 +132,21 @@ TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a
 LogicalProject(EXPR$0=[$1])
 +- LogicalAggregate(group=[{0}], EXPR$0=[COUNT()])
    +- LogicalProject(a=[$0])
-      +- LogicalTableScan(table=[[MyTable1]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1]])
 
 == Optimized Logical Plan ==
 Calc(select=[EXPR$0])
 +- GroupAggregate(groupBy=[a], select=[a, COUNT(*) AS EXPR$0])
    +- Exchange(distribution=[hash[a]])
       +- Calc(select=[a])
-         +- DataStreamScan(table=[[MyTable1]], fields=[a, b, c])
+         +- DataStreamScan(table=[[default_catalog, default_database, MyTable1]], fields=[a, b, c])
 
 == Physical Execution Plan ==
  : Data Source
 	content : collect elements with CollectionInputFormat
 
 	 : Operator
-		content : SourceConversion(table:Buffer(MyTable1), fields:(a, b, c))
+		content : SourceConversion(table:Buffer(default_catalog, default_database, MyTable1), fields:(a, b, c))
 		ship_strategy : FORWARD
 
 		 : Operator
@@ -169,18 +169,18 @@ Calc(select=[EXPR$0])
       <![CDATA[== Abstract Syntax Tree ==
 LogicalProject(a=[$0], b=[$1], c=[$2])
 +- LogicalFilter(condition=[=(MOD($0, 2), 0)])
-   +- LogicalTableScan(table=[[MyTable1]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1]])
 
 == Optimized Logical Plan ==
 Calc(select=[a, b, c], where=[=(MOD(a, 2), 0)])
-+- DataStreamScan(table=[[MyTable1]], fields=[a, b, c])
++- DataStreamScan(table=[[default_catalog, default_database, MyTable1]], fields=[a, b, c])
 
 == Physical Execution Plan ==
  : Data Source
 	content : collect elements with CollectionInputFormat
 
 	 : Operator
-		content : SourceConversion(table:Buffer(MyTable1), fields:(a, b, c))
+		content : SourceConversion(table:Buffer(default_catalog, default_database, MyTable1), fields:(a, b, c))
 		ship_strategy : FORWARD
 
 		 : Operator
@@ -195,18 +195,18 @@ Calc(select=[a, b, c], where=[=(MOD(a, 2), 0)])
       <![CDATA[== Abstract Syntax Tree ==
 LogicalProject(a=[$0], b=[$1], c=[$2])
 +- LogicalFilter(condition=[=(MOD($0, 2), 0)])
-   +- LogicalTableScan(table=[[MyTable1]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1]])
 
 == Optimized Logical Plan ==
 Calc(select=[a, b, c], where=[=(MOD(a, 2), 0)], updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
-+- DataStreamScan(table=[[MyTable1]], fields=[a, b, c], updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
++- DataStreamScan(table=[[default_catalog, default_database, MyTable1]], fields=[a, b, c], updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
 
 == Physical Execution Plan ==
  : Data Source
 	content : collect elements with CollectionInputFormat
 
 	 : Operator
-		content : SourceConversion(table:Buffer(MyTable1), fields:(a, b, c))
+		content : SourceConversion(table:Buffer(default_catalog, default_database, MyTable1), fields:(a, b, c))
 		ship_strategy : FORWARD
 
 		 : Operator
@@ -222,16 +222,16 @@ Calc(select=[a, b, c], where=[=(MOD(a, 2), 0)], updateAsRetraction=[false], accM
 LogicalProject(a=[$0], b=[$1], c=[$2], e=[$4], f=[$5])
 +- LogicalFilter(condition=[=($0, $3)])
    +- LogicalJoin(condition=[true], joinType=[inner])
-      :- LogicalTableScan(table=[[MyTable1]])
-      +- LogicalTableScan(table=[[MyTable2]])
+      :- LogicalTableScan(table=[[default_catalog, default_database, MyTable1]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable2]])
 
 == Optimized Logical Plan ==
 Calc(select=[a, b, c, e, f])
 +- Join(joinType=[InnerJoin], where=[=(a, d)], select=[a, b, c, d, e, f], leftInputSpec=[NoUniqueKey], rightInputSpec=[NoUniqueKey])
    :- Exchange(distribution=[hash[a]])
-   :  +- DataStreamScan(table=[[MyTable1]], fields=[a, b, c])
+   :  +- DataStreamScan(table=[[default_catalog, default_database, MyTable1]], fields=[a, b, c])
    +- Exchange(distribution=[hash[d]])
-      +- DataStreamScan(table=[[MyTable2]], fields=[d, e, f])
+      +- DataStreamScan(table=[[default_catalog, default_database, MyTable2]], fields=[d, e, f])
 
 == Physical Execution Plan ==
  : Data Source
@@ -241,11 +241,11 @@ Calc(select=[a, b, c, e, f])
 	content : collect elements with CollectionInputFormat
 
 	 : Operator
-		content : SourceConversion(table:Buffer(MyTable1), fields:(a, b, c))
+		content : SourceConversion(table:Buffer(default_catalog, default_database, MyTable1), fields:(a, b, c))
 		ship_strategy : FORWARD
 
 		 : Operator
-			content : SourceConversion(table:Buffer(MyTable2), fields:(d, e, f))
+			content : SourceConversion(table:Buffer(default_catalog, default_database, MyTable2), fields:(d, e, f))
 			ship_strategy : FORWARD
 
 			 : Operator
@@ -264,14 +264,14 @@ Calc(select=[a, b, c, e, f])
       <![CDATA[== Abstract Syntax Tree ==
 LogicalUnion(all=[true])
 :- LogicalProject(a=[$0], b=[$1], c=[$2])
-:  +- LogicalTableScan(table=[[MyTable1]])
+:  +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1]])
 +- LogicalProject(d=[$0], e=[$1], f=[$2])
-   +- LogicalTableScan(table=[[MyTable2]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable2]])
 
 == Optimized Logical Plan ==
 Union(all=[true], union=[a, b, c], updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
-:- DataStreamScan(table=[[MyTable1]], fields=[a, b, c], updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
-+- DataStreamScan(table=[[MyTable2]], fields=[d, e, f], updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
+:- DataStreamScan(table=[[default_catalog, default_database, MyTable1]], fields=[a, b, c], updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
++- DataStreamScan(table=[[default_catalog, default_database, MyTable2]], fields=[d, e, f], updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
 
 == Physical Execution Plan ==
  : Data Source
@@ -281,11 +281,11 @@ Union(all=[true], union=[a, b, c], updateAsRetraction=[false], accMode=[Acc]): r
 	content : collect elements with CollectionInputFormat
 
 	 : Operator
-		content : SourceConversion(table:Buffer(MyTable1), fields:(a, b, c))
+		content : SourceConversion(table:Buffer(default_catalog, default_database, MyTable1), fields:(a, b, c))
 		ship_strategy : FORWARD
 
 		 : Operator
-			content : SourceConversion(table:Buffer(MyTable2), fields:(d, e, f))
+			content : SourceConversion(table:Buffer(default_catalog, default_database, MyTable2), fields:(d, e, f))
 			ship_strategy : FORWARD
 
 ]]>
@@ -297,16 +297,16 @@ Union(all=[true], union=[a, b, c], updateAsRetraction=[false], accMode=[Acc]): r
 LogicalProject(a=[$0], b=[$1], c=[$2], e=[$4], f=[$5])
 +- LogicalFilter(condition=[=($0, $3)])
    +- LogicalJoin(condition=[true], joinType=[inner])
-      :- LogicalTableScan(table=[[MyTable1]])
-      +- LogicalTableScan(table=[[MyTable2]])
+      :- LogicalTableScan(table=[[default_catalog, default_database, MyTable1]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable2]])
 
 == Optimized Logical Plan ==
 Calc(select=[a, b, c, e, f], updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
 +- Join(joinType=[InnerJoin], where=[=(a, d)], select=[a, b, c, d, e, f], leftInputSpec=[NoUniqueKey], rightInputSpec=[NoUniqueKey], updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
    :- Exchange(distribution=[hash[a]], updateAsRetraction=[true], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
-   :  +- DataStreamScan(table=[[MyTable1]], fields=[a, b, c], updateAsRetraction=[true], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
+   :  +- DataStreamScan(table=[[default_catalog, default_database, MyTable1]], fields=[a, b, c], updateAsRetraction=[true], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
    +- Exchange(distribution=[hash[d]], updateAsRetraction=[true], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
-      +- DataStreamScan(table=[[MyTable2]], fields=[d, e, f], updateAsRetraction=[true], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
+      +- DataStreamScan(table=[[default_catalog, default_database, MyTable2]], fields=[d, e, f], updateAsRetraction=[true], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
 
 == Physical Execution Plan ==
  : Data Source
@@ -316,11 +316,11 @@ Calc(select=[a, b, c, e, f], updateAsRetraction=[false], accMode=[Acc]): rowcoun
 	content : collect elements with CollectionInputFormat
 
 	 : Operator
-		content : SourceConversion(table:Buffer(MyTable1), fields:(a, b, c))
+		content : SourceConversion(table:Buffer(default_catalog, default_database, MyTable1), fields:(a, b, c))
 		ship_strategy : FORWARD
 
 		 : Operator
-			content : SourceConversion(table:Buffer(MyTable2), fields:(d, e, f))
+			content : SourceConversion(table:Buffer(default_catalog, default_database, MyTable2), fields:(d, e, f))
 			ship_strategy : FORWARD
 
 			 : Operator
@@ -342,20 +342,20 @@ LogicalSink(name=[sink1], fields=[a, cnt])
    +- LogicalFilter(condition=[>($1, 10)])
       +- LogicalAggregate(group=[{0}], cnt=[COUNT()])
          +- LogicalProject(a=[$0])
-            +- LogicalTableScan(table=[[MyTable1]])
+            +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1]])
 
 LogicalSink(name=[sink1], fields=[a, cnt])
 +- LogicalProject(a=[$0], cnt=[$1])
    +- LogicalFilter(condition=[<($1, 10)])
       +- LogicalAggregate(group=[{0}], cnt=[COUNT()])
          +- LogicalProject(a=[$0])
-            +- LogicalTableScan(table=[[MyTable1]])
+            +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1]])
 
 == Optimized Logical Plan ==
 GroupAggregate(groupBy=[a], select=[a, COUNT(*) AS cnt], reuse_id=[1])
 +- Exchange(distribution=[hash[a]])
    +- Calc(select=[a])
-      +- DataStreamScan(table=[[MyTable1]], fields=[a, b, c])
+      +- DataStreamScan(table=[[default_catalog, default_database, MyTable1]], fields=[a, b, c])
 
 Sink(name=[sink1], fields=[a, cnt])
 +- Calc(select=[a, cnt], where=[>(cnt, 10)])
@@ -370,7 +370,7 @@ Sink(name=[sink1], fields=[a, cnt])
 	content : collect elements with CollectionInputFormat
 
 	 : Operator
-		content : SourceConversion(table:Buffer(MyTable1), fields:(a, b, c))
+		content : SourceConversion(table:Buffer(default_catalog, default_database, MyTable1), fields:(a, b, c))
 		ship_strategy : FORWARD
 
 		 : Operator
@@ -424,20 +424,20 @@ LogicalSink(name=[sink1], fields=[a, cnt])
    +- LogicalFilter(condition=[>($1, 10)])
       +- LogicalAggregate(group=[{0}], cnt=[COUNT()])
          +- LogicalProject(a=[$0])
-            +- LogicalTableScan(table=[[MyTable1]])
+            +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1]])
 
 LogicalSink(name=[sink1], fields=[a, cnt])
 +- LogicalProject(a=[$0], cnt=[$1])
    +- LogicalFilter(condition=[<($1, 10)])
       +- LogicalAggregate(group=[{0}], cnt=[COUNT()])
          +- LogicalProject(a=[$0])
-            +- LogicalTableScan(table=[[MyTable1]])
+            +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1]])
 
 == Optimized Logical Plan ==
 GroupAggregate(groupBy=[a], select=[a, COUNT(*) AS cnt], updateAsRetraction=[false], accMode=[Acc], reuse_id=[1]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
 +- Exchange(distribution=[hash[a]], updateAsRetraction=[true], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
    +- Calc(select=[a], updateAsRetraction=[true], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
-      +- DataStreamScan(table=[[MyTable1]], fields=[a, b, c], updateAsRetraction=[true], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
+      +- DataStreamScan(table=[[default_catalog, default_database, MyTable1]], fields=[a, b, c], updateAsRetraction=[true], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
 
 Sink(name=[sink1], fields=[a, cnt], updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
 +- Calc(select=[a, cnt], where=[>(cnt, 10)], updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
@@ -452,7 +452,7 @@ Sink(name=[sink1], fields=[a, cnt], updateAsRetraction=[false], accMode=[Acc]):
 	content : collect elements with CollectionInputFormat
 
 	 : Operator
-		content : SourceConversion(table:Buffer(MyTable1), fields:(a, b, c))
+		content : SourceConversion(table:Buffer(default_catalog, default_database, MyTable1), fields:(a, b, c))
 		ship_strategy : FORWARD
 
 		 : Operator
@@ -504,19 +504,19 @@ Sink(name=[sink1], fields=[a, cnt], updateAsRetraction=[false], accMode=[Acc]):
 LogicalSink(fields=[a, b, c])
 +- LogicalProject(a=[$0], b=[$1], c=[$2])
    +- LogicalFilter(condition=[>($0, 10)])
-      +- LogicalTableScan(table=[[MyTable1]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1]])
 
 == Optimized Logical Plan ==
 Sink(fields=[a, b, c])
 +- Calc(select=[a, b, c], where=[>(a, 10)])
-   +- DataStreamScan(table=[[MyTable1]], fields=[a, b, c])
+   +- DataStreamScan(table=[[default_catalog, default_database, MyTable1]], fields=[a, b, c])
 
 == Physical Execution Plan ==
  : Data Source
 	content : collect elements with CollectionInputFormat
 
 	 : Operator
-		content : SourceConversion(table:Buffer(MyTable1), fields:(a, b, c))
+		content : SourceConversion(table:Buffer(default_catalog, default_database, MyTable1), fields:(a, b, c))
 		ship_strategy : FORWARD
 
 		 : Operator
@@ -539,19 +539,19 @@ Sink(fields=[a, b, c])
       <![CDATA[== Abstract Syntax Tree ==
 LogicalSort(sort0=[$0], dir0=[ASC-nulls-first], fetch=[5])
 +- LogicalProject(a=[$0], b=[$1], c=[$2])
-   +- LogicalTableScan(table=[[MyTable1]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1]])
 
 == Optimized Logical Plan ==
 SortLimit(orderBy=[a ASC], offset=[0], fetch=[5])
 +- Exchange(distribution=[single])
-   +- DataStreamScan(table=[[MyTable1]], fields=[a, b, c])
+   +- DataStreamScan(table=[[default_catalog, default_database, MyTable1]], fields=[a, b, c])
 
 == Physical Execution Plan ==
  : Data Source
 	content : collect elements with CollectionInputFormat
 
 	 : Operator
-		content : SourceConversion(table:Buffer(MyTable1), fields:(a, b, c))
+		content : SourceConversion(table:Buffer(default_catalog, default_database, MyTable1), fields:(a, b, c))
 		ship_strategy : FORWARD
 
 		 : Operator
@@ -566,19 +566,19 @@ SortLimit(orderBy=[a ASC], offset=[0], fetch=[5])
       <![CDATA[== Abstract Syntax Tree ==
 LogicalSort(sort0=[$0], dir0=[ASC-nulls-first], fetch=[5])
 +- LogicalProject(a=[$0], b=[$1], c=[$2])
-   +- LogicalTableScan(table=[[MyTable1]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1]])
 
 == Optimized Logical Plan ==
 SortLimit(orderBy=[a ASC], offset=[0], fetch=[5], updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
 +- Exchange(distribution=[single], updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
-   +- DataStreamScan(table=[[MyTable1]], fields=[a, b, c], updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
+   +- DataStreamScan(table=[[default_catalog, default_database, MyTable1]], fields=[a, b, c], updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
 
 == Physical Execution Plan ==
  : Data Source
 	content : collect elements with CollectionInputFormat
 
 	 : Operator
-		content : SourceConversion(table:Buffer(MyTable1), fields:(a, b, c))
+		content : SourceConversion(table:Buffer(default_catalog, default_database, MyTable1), fields:(a, b, c))
 		ship_strategy : FORWARD
 
 		 : Operator
@@ -594,19 +594,19 @@ SortLimit(orderBy=[a ASC], offset=[0], fetch=[5], updateAsRetraction=[false], ac
 LogicalSink(fields=[a, b, c])
 +- LogicalProject(a=[$0], b=[$1], c=[$2])
    +- LogicalFilter(condition=[>($0, 10)])
-      +- LogicalTableScan(table=[[MyTable1]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1]])
 
 == Optimized Logical Plan ==
 Sink(fields=[a, b, c], updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
 +- Calc(select=[a, b, c], where=[>(a, 10)], updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
-   +- DataStreamScan(table=[[MyTable1]], fields=[a, b, c], updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
+   +- DataStreamScan(table=[[default_catalog, default_database, MyTable1]], fields=[a, b, c], updateAsRetraction=[false], accMode=[Acc]): rowcount = , cumulative cost = {rows, cpu, io, network, memory}
 
 == Physical Execution Plan ==
  : Data Source
 	content : collect elements with CollectionInputFormat
 
 	 : Operator
-		content : SourceConversion(table:Buffer(MyTable1), fields:(a, b, c))
+		content : SourceConversion(table:Buffer(default_catalog, default_database, MyTable1), fields:(a, b, c))
 		ship_strategy : FORWARD
 
 		 : Operator
@@ -629,14 +629,14 @@ Sink(fields=[a, b, c], updateAsRetraction=[false], accMode=[Acc]): rowcount = ,
       <![CDATA[== Abstract Syntax Tree ==
 LogicalUnion(all=[true])
 :- LogicalProject(a=[$0], b=[$1], c=[$2])
-:  +- LogicalTableScan(table=[[MyTable1]])
+:  +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1]])
 +- LogicalProject(d=[$0], e=[$1], f=[$2])
-   +- LogicalTableScan(table=[[MyTable2]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable2]])
 
 == Optimized Logical Plan ==
 Union(all=[true], union=[a, b, c])
-:- DataStreamScan(table=[[MyTable1]], fields=[a, b, c])
-+- DataStreamScan(table=[[MyTable2]], fields=[d, e, f])
+:- DataStreamScan(table=[[default_catalog, default_database, MyTable1]], fields=[a, b, c])
++- DataStreamScan(table=[[default_catalog, default_database, MyTable2]], fields=[d, e, f])
 
 == Physical Execution Plan ==
  : Data Source
@@ -646,11 +646,11 @@ Union(all=[true], union=[a, b, c])
 	content : collect elements with CollectionInputFormat
 
 	 : Operator
-		content : SourceConversion(table:Buffer(MyTable1), fields:(a, b, c))
+		content : SourceConversion(table:Buffer(default_catalog, default_database, MyTable1), fields:(a, b, c))
 		ship_strategy : FORWARD
 
 		 : Operator
-			content : SourceConversion(table:Buffer(MyTable2), fields:(d, e, f))
+			content : SourceConversion(table:Buffer(default_catalog, default_database, MyTable2), fields:(d, e, f))
 			ship_strategy : FORWARD
 
 ]]>
diff --git a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/catalog/PathResolutionTest.xml b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/catalog/PathResolutionTest.xml
new file mode 100644
index 0000000..4de35be
--- /dev/null
+++ b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/catalog/PathResolutionTest.xml
@@ -0,0 +1,195 @@
+<?xml version="1.0" ?>
+<!--
+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.
+-->
+<Root>
+  <TestCase name="testStreamSqlPathResolution[0: simpleInDefaultPath=[sqlPath: tab1, tableApiPath: [tab1], expectedPath: [builtin, default, tab1]]]">
+    <Resource name="sql">
+      <![CDATA[SELECT * FROM tab1]]>
+    </Resource>
+    <Resource name="planBefore">
+      <![CDATA[
+LogicalProject
++- LogicalTableScan(table=[[builtin, default, tab1, source: [()]]])
+]]>
+    </Resource>
+    <Resource name="planAfter">
+      <![CDATA[
+TableSourceScan(table=[[builtin, default, tab1, source: [()]]], fields=[])
+]]>
+    </Resource>
+  </TestCase>
+  <TestCase name="testStreamSqlPathResolution[10: spaceInNames=[sqlPath: `default db`.`tab 1`, tableApiPath: [default db, tab 1], expectedPath: [builtin, default db, tab 1]]]">
+    <Resource name="sql">
+      <![CDATA[SELECT * FROM `default db`.`tab 1`]]>
+    </Resource>
+    <Resource name="planBefore">
+      <![CDATA[
+LogicalProject
++- LogicalTableScan(table=[[builtin, default db, tab 1, source: [()]]])
+]]>
+    </Resource>
+    <Resource name="planAfter">
+      <![CDATA[
+TableSourceScan(table=[[builtin, default db, tab 1, source: [()]]], fields=[])
+]]>
+    </Resource>
+  </TestCase>
+  <TestCase name="testStreamSqlPathResolution[1: simpleInChangedDefaultCatalog=[defaultCatalog: cat1, sqlPath: tab1, tableApiPath: [tab1], expectedPath: [cat1, db1, tab1]]]">
+    <Resource name="sql">
+      <![CDATA[SELECT * FROM tab1]]>
+    </Resource>
+    <Resource name="planBefore">
+      <![CDATA[
+LogicalProject
++- LogicalTableScan(table=[[cat1, db1, tab1, source: [()]]])
+]]>
+    </Resource>
+    <Resource name="planAfter">
+      <![CDATA[
+TableSourceScan(table=[[cat1, db1, tab1, source: [()]]], fields=[])
+]]>
+    </Resource>
+  </TestCase>
+  <TestCase name="testStreamSqlPathResolution[2: simpleInChangedDefaultPath=[defaultCatalog: cat1, defaultDatabase: db2, sqlPath: tab1, tableApiPath: [tab1], expectedPath: [cat1, db2, tab1]]]">
+    <Resource name="sql">
+      <![CDATA[SELECT * FROM tab1]]>
+    </Resource>
+    <Resource name="planBefore">
+      <![CDATA[
+LogicalProject
++- LogicalTableScan(table=[[cat1, db2, tab1, source: [()]]])
+]]>
+    </Resource>
+    <Resource name="planAfter">
+      <![CDATA[
+TableSourceScan(table=[[cat1, db2, tab1, source: [()]]], fields=[])
+]]>
+    </Resource>
+  </TestCase>
+  <TestCase name="testStreamSqlPathResolution[3: qualifiedWithDatabase=[defaultCatalog: builtin, defaultDatabase: default, sqlPath: db1.tab1, tableApiPath: [db1, tab1], expectedPath: [builtin, db1, tab1]]]">
+    <Resource name="sql">
+      <![CDATA[SELECT * FROM db1.tab1]]>
+    </Resource>
+    <Resource name="planBefore">
+      <![CDATA[
+LogicalProject
++- LogicalTableScan(table=[[builtin, db1, tab1, source: [()]]])
+]]>
+    </Resource>
+    <Resource name="planAfter">
+      <![CDATA[
+TableSourceScan(table=[[builtin, db1, tab1, source: [()]]], fields=[])
+]]>
+    </Resource>
+  </TestCase>
+  <TestCase name="testStreamSqlPathResolution[4: fullyQualifiedName=[defaultCatalog: builtin, defaultDatabase: default, sqlPath: cat1.db1.tab1, tableApiPath: [cat1, db1, tab1], expectedPath: [cat1, db1, tab1]]]">
+    <Resource name="sql">
+      <![CDATA[SELECT * FROM cat1.db1.tab1]]>
+    </Resource>
+    <Resource name="planBefore">
+      <![CDATA[
+LogicalProject
++- LogicalTableScan(table=[[cat1, db1, tab1, source: [()]]])
+]]>
+    </Resource>
+    <Resource name="planAfter">
+      <![CDATA[
+TableSourceScan(table=[[cat1, db1, tab1, source: [()]]], fields=[])
+]]>
+    </Resource>
+  </TestCase>
+  <TestCase name="testStreamSqlPathResolution[5: externalCatalogTopLevelTable=[sqlPath: extCat1.tab1, tableApiPath: [extCat1, tab1], expectedPath: [extCat1, tab1]]]">
+    <Resource name="sql">
+      <![CDATA[SELECT * FROM extCat1.tab1]]>
+    </Resource>
+    <Resource name="planBefore">
+      <![CDATA[
+LogicalProject
++- LogicalTableScan(table=[[extCat1, tab1, source: [()]]])
+]]>
+    </Resource>
+    <Resource name="planAfter">
+      <![CDATA[
+TableSourceScan(table=[[extCat1, tab1, source: [()]]], fields=[])
+]]>
+    </Resource>
+  </TestCase>
+  <TestCase name="testStreamSqlPathResolution[6: externalCatalogMultiLevelNesting=[sqlPath: extCat1.extCat2.extCat3.tab1, tableApiPath: [extCat1, extCat2, extCat3, tab1], expectedPath: [extCat1, extCat2, extCat3, tab1]]]">
+    <Resource name="sql">
+      <![CDATA[SELECT * FROM extCat1.extCat2.extCat3.tab1]]>
+    </Resource>
+    <Resource name="planBefore">
+      <![CDATA[
+LogicalProject
++- LogicalTableScan(table=[[extCat1, extCat2, extCat3, tab1, source: [()]]])
+]]>
+    </Resource>
+    <Resource name="planAfter">
+      <![CDATA[
+TableSourceScan(table=[[extCat1, extCat2, extCat3, tab1, source: [()]]], fields=[])
+]]>
+    </Resource>
+  </TestCase>
+  <TestCase name="testStreamSqlPathResolution[7: dotInUnqualifiedTableName=[sqlPath: `tab.1`, tableApiPath: [tab.1], expectedPath: [builtin, default, tab.1]]]">
+    <Resource name="sql">
+      <![CDATA[SELECT * FROM `tab.1`]]>
+    </Resource>
+    <Resource name="planBefore">
+      <![CDATA[
+LogicalProject
++- LogicalTableScan(table=[[builtin, default, tab.1, source: [()]]])
+]]>
+    </Resource>
+    <Resource name="planAfter">
+      <![CDATA[
+TableSourceScan(table=[[builtin, default, tab.1, source: [()]]], fields=[])
+]]>
+    </Resource>
+  </TestCase>
+  <TestCase name="testStreamSqlPathResolution[8: dotInDatabaseName=[sqlPath: `default.db`.tab1, tableApiPath: [default.db, tab1], expectedPath: [builtin, default.db, tab1]]]">
+    <Resource name="sql">
+      <![CDATA[SELECT * FROM `default.db`.tab1]]>
+    </Resource>
+    <Resource name="planBefore">
+      <![CDATA[
+LogicalProject
++- LogicalTableScan(table=[[builtin, default.db, tab1, source: [()]]])
+]]>
+    </Resource>
+    <Resource name="planAfter">
+      <![CDATA[
+TableSourceScan(table=[[builtin, default.db, tab1, source: [()]]], fields=[])
+]]>
+    </Resource>
+  </TestCase>
+  <TestCase name="testStreamSqlPathResolution[9: dotInDefaultDatabaseName=[defaultCatalog: builtin, defaultDatabase: default.db, sqlPath: tab1, tableApiPath: [tab1], expectedPath: [builtin, default.db, tab1]]]">
+    <Resource name="sql">
+      <![CDATA[SELECT * FROM tab1]]>
+    </Resource>
+    <Resource name="planBefore">
+      <![CDATA[
+LogicalProject
++- LogicalTableScan(table=[[builtin, default.db, tab1, source: [()]]])
+]]>
+    </Resource>
+    <Resource name="planAfter">
+      <![CDATA[
+TableSourceScan(table=[[builtin, default.db, tab1, source: [()]]], fields=[])
+]]>
+    </Resource>
+  </TestCase>
+</Root>
diff --git a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/CalcTest.xml b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/CalcTest.xml
index 2f435de..dd55968 100644
--- a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/CalcTest.xml
+++ b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/CalcTest.xml
@@ -23,13 +23,13 @@ limitations under the License.
     <Resource name="planBefore">
       <![CDATA[
 LogicalProject(EXPR$0=[ARRAY(_UTF-16LE'Hi', _UTF-16LE'Hello', $2)])
-+- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
++- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
 Calc(select=[ARRAY(_UTF-16LE'Hi', _UTF-16LE'Hello', c) AS EXPR$0])
-+- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
++- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -41,13 +41,13 @@ Calc(select=[ARRAY(_UTF-16LE'Hi', _UTF-16LE'Hello', c) AS EXPR$0])
       <![CDATA[
 LogicalProject(a=[$0], b=[$1], c=[$2])
 +- LogicalFilter(condition=[AND(<($0, 10), >($1, 20))])
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
 Calc(select=[a, b, c], where=[AND(<(a, 10), >(b, 20))])
-+- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
++- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -59,13 +59,13 @@ Calc(select=[a, b, c], where=[AND(<(a, 10), >(b, 20))])
       <![CDATA[
 LogicalProject(a=[$0], b=[$1], c=[$2])
 +- LogicalFilter(condition=[OR(<($0, 10), >($0, 20))])
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
 Calc(select=[a, b, c], where=[OR(<(a, 10), >(a, 20))])
-+- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
++- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -80,13 +80,13 @@ WHERE b = DATE '1984-07-12' AND c = TIME '14:34:24' AND d = TIMESTAMP '1984-07-1
       <![CDATA[
 LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3])
 +- LogicalFilter(condition=[AND(=($1, 1984-07-12), =($2, 14:34:24), =($3, 1984-07-12 14:34:24))])
-   +- LogicalTableScan(table=[[MyTable3, source: [TestTableSource(a, b, c, d)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable3, source: [TestTableSource(a, b, c, d)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
 Calc(select=[a, CAST(1984-07-12) AS b, CAST(14:34:24) AS c, CAST(1984-07-12 14:34:24:TIMESTAMP(3)) AS d], where=[AND(=(b, 1984-07-12), =(c, 14:34:24), =(d, 1984-07-12 14:34:24:TIMESTAMP(3)))])
-+- TableSourceScan(table=[[MyTable3, source: [TestTableSource(a, b, c, d)]]], fields=[a, b, c, d])
++- TableSourceScan(table=[[default_catalog, default_database, MyTable3, source: [TestTableSource(a, b, c, d)]]], fields=[a, b, c, d])
 ]]>
     </Resource>
   </TestCase>
@@ -98,13 +98,13 @@ Calc(select=[a, CAST(1984-07-12) AS b, CAST(14:34:24) AS c, CAST(1984-07-12 14:3
       <![CDATA[
 LogicalProject(a=[$0], b=[$1], c=[$2])
 +- LogicalFilter(condition=[AND(OR(=($1, 1), =($1, 3), =($1, 4), =($1, 5), =($1, 6)), =($2, _UTF-16LE'xx'))])
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
 Calc(select=[a, b, CAST(_UTF-16LE'xx':VARCHAR(2147483647) CHARACTER SET "UTF-16LE") AS c], where=[AND(IN(b, 1, 3, 4, 5, 6), =(c, _UTF-16LE'xx':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"))])
-+- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
++- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -116,13 +116,13 @@ Calc(select=[a, b, CAST(_UTF-16LE'xx':VARCHAR(2147483647) CHARACTER SET "UTF-16L
       <![CDATA[
 LogicalProject(EXPR$0=[ROW($0, $1, $2)], EXPR$1=[ARRAY(12, $1)], EXPR$2=[MAP($0, $2)])
 +- LogicalFilter(condition=[=(ROW($0, $1, $2), CAST(ROW(_UTF-16LE'foo', 12, 1984-07-12 14:34:24)):RecordType(VARCHAR(2147483647) CHARACTER SET "UTF-16LE" EXPR$0, INTEGER EXPR$1, TIMESTAMP(3) EXPR$2) NOT NULL)])
-   +- LogicalTableScan(table=[[MyTable5, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable5, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
 Calc(select=[ROW(a, b, c) AS EXPR$0, ARRAY(12, b) AS EXPR$1, MAP(a, c) AS EXPR$2], where=[=(ROW(a, b, c), CAST(ROW(_UTF-16LE'foo', 12, 1984-07-12 14:34:24)))])
-+- TableSourceScan(table=[[MyTable5, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
++- TableSourceScan(table=[[default_catalog, default_database, MyTable5, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -136,13 +136,13 @@ LogicalProject(a=[$0], b=[$1], c=[$2])
 +- LogicalFilter(condition=[<($0, 50)])
    +- LogicalProject(a=[$0], b=[$1], c=[$2])
       +- LogicalFilter(condition=[>($1, 0)])
-         +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+         +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
 Calc(select=[a, b, c], where=[AND(>(b, 0), <(a, 50))])
-+- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
++- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -153,13 +153,13 @@ Calc(select=[a, b, c], where=[AND(>(b, 0), <(a, 50))])
     <Resource name="planBefore">
       <![CDATA[
 LogicalProject(_1=[$0._1], _2=[$0._2], c=[$2], _10=[$1._1], _20=[$1._2])
-+- LogicalTableScan(table=[[MyTable2, source: [TestTableSource(a, b, c)]]])
++- LogicalTableScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
 Calc(select=[a._1 AS _1, a._2 AS _2, c, b._1 AS _10, b._2 AS _20])
-+- TableSourceScan(table=[[MyTable2, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
++- TableSourceScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -170,13 +170,13 @@ Calc(select=[a._1 AS _1, a._2 AS _2, c, b._1 AS _10, b._2 AS _20])
     <Resource name="planBefore">
       <![CDATA[
 LogicalProject(c=[$2])
-+- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
++- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
 Calc(select=[c])
-+- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
++- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -187,13 +187,13 @@ Calc(select=[c])
     <Resource name="planBefore">
       <![CDATA[
 LogicalProject(EXPR$0=[MAP($0, $2)])
-+- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
++- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
 Calc(select=[MAP(a, c) AS EXPR$0])
-+- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
++- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -205,13 +205,13 @@ Calc(select=[MAP(a, c) AS EXPR$0])
       <![CDATA[
 LogicalProject(a=[$0], b=[$1], c=[$2])
 +- LogicalFilter(condition=[OR(NOT(OR(=($1, 1), =($1, 3), =($1, 4), =($1, 5), =($1, 6))), =($2, _UTF-16LE'xx'))])
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
 Calc(select=[a, b, c], where=[OR(NOT IN(b, 1, 3, 4, 5, 6), =(c, _UTF-16LE'xx':VARCHAR(2147483647) CHARACTER SET "UTF-16LE"))])
-+- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
++- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -223,13 +223,13 @@ Calc(select=[a, b, c], where=[OR(NOT IN(b, 1, 3, 4, 5, 6), =(c, _UTF-16LE'xx':VA
       <![CDATA[
 LogicalProject(a=[$0], b=[$1], c=[$2])
 +- LogicalFilter(condition=[>($1, 0)])
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
 Calc(select=[a, b, c], where=[>(b, 0)])
-+- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
++- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -240,13 +240,13 @@ Calc(select=[a, b, c], where=[>(b, 0)])
     <Resource name="planBefore">
       <![CDATA[
 LogicalProject(a=[$0], c=[$2])
-+- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
++- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
 Calc(select=[a, c])
-+- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
++- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -257,12 +257,12 @@ Calc(select=[a, c])
     <Resource name="planBefore">
       <![CDATA[
 LogicalProject(a=[$0])
-+- LogicalTableScan(table=[[MyTable4, source: [TestTableSource(a)]]])
++- LogicalTableScan(table=[[default_catalog, default_database, MyTable4, source: [TestTableSource(a)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
-TableSourceScan(table=[[MyTable4, source: [TestTableSource(a)]]], fields=[a])
+TableSourceScan(table=[[default_catalog, default_database, MyTable4, source: [TestTableSource(a)]]], fields=[a])
 ]]>
     </Resource>
   </TestCase>
@@ -273,13 +273,13 @@ TableSourceScan(table=[[MyTable4, source: [TestTableSource(a)]]], fields=[a])
     <Resource name="planBefore">
       <![CDATA[
 LogicalProject(EXPR$0=[MAP($1, 30, 10, $0)])
-+- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
++- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
 Calc(select=[MAP(b, 30, 10, a) AS EXPR$0])
-+- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
++- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -291,13 +291,13 @@ Calc(select=[MAP(b, 30, 10, a) AS EXPR$0])
       <![CDATA[
 LogicalProject(a=[$0], EXPR$1=[+($1, 1)])
 +- LogicalFilter(condition=[>($1, 2)])
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
 Calc(select=[a, +(b, 1) AS EXPR$1], where=[>(b, 2)])
-+- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
++- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -314,13 +314,13 @@ FROM MyTable
     <Resource name="planBefore">
       <![CDATA[
 LogicalProject(a=[$0], b=[$1], c=[$2], EXPR$3=[1984-07-12], EXPR$4=[14:34:24], EXPR$5=[1984-07-12 14:34:24])
-+- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
++- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
 Calc(select=[a, b, c, 1984-07-12 AS EXPR$3, 14:34:24 AS EXPR$4, 1984-07-12 14:34:24 AS EXPR$5])
-+- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
++- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -331,12 +331,12 @@ Calc(select=[a, b, c, 1984-07-12 AS EXPR$3, 14:34:24 AS EXPR$4, 1984-07-12 14:34
     <Resource name="planBefore">
       <![CDATA[
 LogicalProject(1-_./Ü=[$0], b=[$1], c=[$2])
-+- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
++- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
-TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -347,13 +347,13 @@ TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a
     <Resource name="planBefore">
       <![CDATA[
 LogicalProject(EXPR$0=[ROW(1, _UTF-16LE'Hi', $0)])
-+- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
++- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
 Calc(select=[ROW(1, _UTF-16LE'Hi', a) AS EXPR$0])
-+- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
++- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
diff --git a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/DagOptimizationTest.xml b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/DagOptimizationTest.xml
index 75fa01b..60a1aca 100644
--- a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/DagOptimizationTest.xml
+++ b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/DagOptimizationTest.xml
@@ -22,7 +22,7 @@ limitations under the License.
 LogicalSink(fields=[a, b, c])
 +- LogicalProject(a=[$0], b=[$1], c=[$2])
    +- LogicalFilter(condition=[LIKE($2, _UTF-16LE'%hello%')])
-      +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 
 LogicalSink(fields=[b, cnt])
 +- LogicalProject(b=[$0], cnt=[$1])
@@ -33,11 +33,11 @@ LogicalSink(fields=[b, cnt])
                :- LogicalProject(a=[$0], b=[$1], c=[$2])
                :  +- LogicalProject(a=[$0], b=[$1], c=[$2])
                :     +- LogicalFilter(condition=[LIKE($2, _UTF-16LE'%hello%')])
-               :        +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+               :        +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
                +- LogicalProject(a=[$0], b=[$1], c=[$2])
                   +- LogicalProject(a=[$0], b=[$1], c=[$2])
                      +- LogicalFilter(condition=[LIKE($2, _UTF-16LE'%world%')])
-                        +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+                        +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 
 LogicalSink(fields=[b, cnt])
 +- LogicalProject(b=[$0], cnt=[$1])
@@ -48,16 +48,16 @@ LogicalSink(fields=[b, cnt])
                :- LogicalProject(a=[$0], b=[$1], c=[$2])
                :  +- LogicalProject(a=[$0], b=[$1], c=[$2])
                :     +- LogicalFilter(condition=[LIKE($2, _UTF-16LE'%hello%')])
-               :        +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+               :        +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
                +- LogicalProject(a=[$0], b=[$1], c=[$2])
                   +- LogicalProject(a=[$0], b=[$1], c=[$2])
                      +- LogicalFilter(condition=[LIKE($2, _UTF-16LE'%world%')])
-                        +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+                        +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
-TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c], reuse_id=[2])
+TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c], reuse_id=[2])
 
 Calc(select=[a, b, c], where=[LIKE(c, _UTF-16LE'%hello%')], reuse_id=[1])
 +- Reused(reference_id=[2])
@@ -93,7 +93,7 @@ LogicalSink(fields=[total_sum])
       +- LogicalProject(sum_a=[$1], c=[$0])
          +- LogicalAggregate(group=[{0}], sum_a=[SUM($1)])
             +- LogicalProject(c=[$2], a=[$0])
-               +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+               +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 
 LogicalSink(fields=[total_min])
 +- LogicalAggregate(group=[{}], total_min=[MIN($0)])
@@ -101,7 +101,7 @@ LogicalSink(fields=[total_min])
       +- LogicalProject(sum_a=[$1], c=[$0])
          +- LogicalAggregate(group=[{0}], sum_a=[SUM($1)])
             +- LogicalProject(c=[$2], a=[$0])
-               +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+               +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -111,7 +111,7 @@ Calc(select=[sum_a], reuse_id=[1])
    +- Exchange(distribution=[hash[c]])
       +- LocalHashAggregate(groupBy=[c], select=[c, Partial_SUM(a) AS sum$0])
          +- Calc(select=[c, a])
-            +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+            +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 
 Sink(fields=[total_sum])
 +- HashAggregate(isMerge=[true], select=[Final_SUM(sum$0) AS total_sum])
@@ -135,36 +135,36 @@ LogicalSink(fields=[a, b1])
    :- LogicalProject(a1=[$0], b1=[$1])
    :  +- LogicalProject(a1=[$0], b1=[$1])
    :     +- LogicalFilter(condition=[<=($0, 10)])
-   :        +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   :        +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
    +- LogicalProject(a=[$0], b1=[$1])
       +- LogicalProject(a=[$2], b1=[$1])
          +- LogicalFilter(condition=[=($2, $0)])
             +- LogicalJoin(condition=[true], joinType=[inner])
                :- LogicalProject(a1=[$0], b1=[$1])
                :  +- LogicalFilter(condition=[<=($0, 10)])
-               :     +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
-               +- LogicalTableScan(table=[[MyTable2, source: [TestTableSource(a, b, c, d, e)]]])
+               :     +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
+               +- LogicalTableScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, d, e)]]])
 
 LogicalSink(fields=[a, b1])
 +- LogicalUnion(all=[true])
    :- LogicalProject(a1=[$0], b1=[$1])
    :  +- LogicalProject(a1=[$0], b1=[$1])
    :     +- LogicalFilter(condition=[<=($0, 10)])
-   :        +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   :        +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
    +- LogicalProject(a=[$0], b1=[$1])
       +- LogicalProject(a=[$2], b1=[$1])
          +- LogicalFilter(condition=[=($2, $0)])
             +- LogicalJoin(condition=[true], joinType=[inner])
                :- LogicalProject(a1=[$0], b1=[$1])
                :  +- LogicalFilter(condition=[<=($0, 10)])
-               :     +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
-               +- LogicalTableScan(table=[[MyTable2, source: [TestTableSource(a, b, c, d, e)]]])
+               :     +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
+               +- LogicalTableScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, d, e)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
 Calc(select=[a, b], where=[<=(a, 10)], reuse_id=[1])
-+- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
++- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 
 Union(all=[true], union=[a, b], reuse_id=[2])
 :- Reused(reference_id=[1])
@@ -174,7 +174,7 @@ Union(all=[true], union=[a, b], reuse_id=[2])
       :  +- Reused(reference_id=[1])
       +- Exchange(distribution=[hash[a]])
          +- Calc(select=[a])
-            +- TableSourceScan(table=[[MyTable2, source: [TestTableSource(a, b, c, d, e)]]], fields=[a, b, c, d, e])
+            +- TableSourceScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, d, e)]]], fields=[a, b, c, d, e])
 
 Sink(fields=[a, b1])
 +- Reused(reference_id=[2])
@@ -193,29 +193,29 @@ LogicalSink(fields=[a, b1])
       +- LogicalJoin(condition=[true], joinType=[inner])
          :- LogicalProject(a1=[$0], b1=[$1])
          :  +- LogicalFilter(condition=[<=($0, 10)])
-         :     +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
-         +- LogicalTableScan(table=[[MyTable2, source: [TestTableSource(a, b, c, d, e)]]])
+         :     +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
+         +- LogicalTableScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, d, e)]]])
 
 LogicalSink(fields=[a, b1])
 +- LogicalUnion(all=[true])
    :- LogicalProject(a1=[$0], b1=[$1])
    :  +- LogicalProject(a1=[$0], b1=[$1])
    :     +- LogicalFilter(condition=[<=($0, 10)])
-   :        +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   :        +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
    +- LogicalProject(a=[$0], b1=[$1])
       +- LogicalProject(a=[$2], b1=[$1])
          +- LogicalFilter(condition=[=($2, $0)])
             +- LogicalJoin(condition=[true], joinType=[inner])
                :- LogicalProject(a1=[$0], b1=[$1])
                :  +- LogicalFilter(condition=[<=($0, 10)])
-               :     +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
-               +- LogicalTableScan(table=[[MyTable2, source: [TestTableSource(a, b, c, d, e)]]])
+               :     +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
+               +- LogicalTableScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, d, e)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
 Calc(select=[a, b], where=[<=(a, 10)], reuse_id=[1])
-+- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
++- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 
 Calc(select=[a0 AS a, b AS b1], reuse_id=[2])
 +- HashJoin(joinType=[InnerJoin], where=[=(a0, a)], select=[a, b, a0], build=[right])
@@ -223,7 +223,7 @@ Calc(select=[a0 AS a, b AS b1], reuse_id=[2])
    :  +- Reused(reference_id=[1])
    +- Exchange(distribution=[hash[a]])
       +- Calc(select=[a])
-         +- TableSourceScan(table=[[MyTable2, source: [TestTableSource(a, b, c, d, e)]]], fields=[a, b, c, d, e])
+         +- TableSourceScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, d, e)]]], fields=[a, b, c, d, e])
 
 Sink(fields=[a, b1])
 +- Reused(reference_id=[2])
@@ -244,12 +244,12 @@ LogicalSink(fields=[a1, b, c2])
       +- LogicalJoin(condition=[true], joinType=[inner])
          :- LogicalProject(a1=[$0], b=[$1])
          :  +- LogicalFilter(condition=[<=($0, 10)])
-         :     +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+         :     +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
          +- LogicalProject(a2=[$0], c=[$2])
             +- LogicalFilter(condition=[>=($1, 5)])
                +- LogicalProject(a=[$0], b=[$1], c=[$2])
                   +- LogicalFilter(condition=[>=($0, 0)])
-                     +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+                     +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 
 LogicalSink(fields=[a1, b, c1])
 +- LogicalProject(a1=[$2], b=[$3], c1=[$1])
@@ -259,23 +259,23 @@ LogicalSink(fields=[a1, b, c1])
          :  +- LogicalFilter(condition=[<($1, 5)])
          :     +- LogicalProject(a=[$0], b=[$1], c=[$2])
          :        +- LogicalFilter(condition=[>=($0, 0)])
-         :           +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+         :           +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
          +- LogicalProject(a1=[$0], b=[$1], c2=[$3])
             +- LogicalFilter(condition=[=($0, $2)])
                +- LogicalJoin(condition=[true], joinType=[inner])
                   :- LogicalProject(a1=[$0], b=[$1])
                   :  +- LogicalFilter(condition=[<=($0, 10)])
-                  :     +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+                  :     +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
                   +- LogicalProject(a2=[$0], c=[$2])
                      +- LogicalFilter(condition=[>=($1, 5)])
                         +- LogicalProject(a=[$0], b=[$1], c=[$2])
                            +- LogicalFilter(condition=[>=($0, 0)])
-                              +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+                              +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
-TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c], reuse_id=[1])
+TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c], reuse_id=[1])
 
 Calc(select=[a, b, c], where=[>=(a, 0)], reuse_id=[2])
 +- Reused(reference_id=[1])
@@ -311,19 +311,19 @@ LogicalSink(fields=[total_sum])
 +- LogicalAggregate(group=[{}], total_sum=[SUM($0)])
    +- LogicalProject(a=[$0])
       +- LogicalProject(a=[random_udf($0)], c=[$2])
-         +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+         +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 
 LogicalSink(fields=[total_min])
 +- LogicalAggregate(group=[{}], total_min=[MIN($0)])
    +- LogicalProject(a=[$0])
       +- LogicalProject(a=[random_udf($0)], c=[$2])
-         +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+         +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
 Calc(select=[random_udf(a) AS a], reuse_id=[1])
-+- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
++- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 
 Sink(fields=[total_sum])
 +- HashAggregate(isMerge=[true], select=[Final_SUM(sum$0) AS total_sum])
@@ -347,18 +347,18 @@ LogicalSink(fields=[total_sum])
    +- LogicalProject(a=[$0])
       +- LogicalUnion(all=[true])
          :- LogicalProject(a=[$0], c=[$2])
-         :  +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+         :  +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
          +- LogicalProject(d=[$0], f=[$2])
-            +- LogicalTableScan(table=[[MyTable1, source: [TestTableSource(d, e, f)]]])
+            +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(d, e, f)]]])
 
 LogicalSink(fields=[total_min])
 +- LogicalAggregate(group=[{}], total_min=[MIN($0)])
    +- LogicalProject(a=[$0])
       +- LogicalUnion(all=[true])
          :- LogicalProject(a=[$0], c=[$2])
-         :  +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+         :  +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
          +- LogicalProject(d=[$0], f=[$2])
-            +- LogicalTableScan(table=[[MyTable1, source: [TestTableSource(d, e, f)]]])
+            +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(d, e, f)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -366,10 +366,10 @@ LogicalSink(fields=[total_min])
 Union(all=[true], union=[a], reuse_id=[1])
 :- Calc(select=[a])
 :  +- Calc(select=[a, c])
-:     +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+:     +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 +- Calc(select=[d AS a])
    +- Calc(select=[d, f])
-      +- TableSourceScan(table=[[MyTable1, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+      +- TableSourceScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 
 Sink(fields=[total_sum])
 +- HashAggregate(isMerge=[true], select=[Final_SUM(sum$0) AS total_sum])
@@ -394,11 +394,11 @@ LogicalSink(fields=[total_sum])
       +- LogicalUnion(all=[true])
          :- LogicalUnion(all=[true])
          :  :- LogicalProject(a=[$0], c=[$2])
-         :  :  +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+         :  :  +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
          :  +- LogicalProject(d=[$0], f=[$2])
-         :     +- LogicalTableScan(table=[[MyTable1, source: [TestTableSource(d, e, f)]]])
+         :     +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(d, e, f)]]])
          +- LogicalProject(a=[$0], c=[$2])
-            +- LogicalTableScan(table=[[MyTable2, source: [TestTableSource(a, b, c)]]])
+            +- LogicalTableScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c)]]])
 
 LogicalSink(fields=[total_min])
 +- LogicalAggregate(group=[{}], total_min=[MIN($0)])
@@ -406,19 +406,19 @@ LogicalSink(fields=[total_min])
       +- LogicalUnion(all=[true])
          :- LogicalUnion(all=[true])
          :  :- LogicalProject(a=[$0], c=[$2])
-         :  :  +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+         :  :  +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
          :  +- LogicalProject(d=[$0], f=[$2])
-         :     +- LogicalTableScan(table=[[MyTable1, source: [TestTableSource(d, e, f)]]])
+         :     +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(d, e, f)]]])
          +- LogicalProject(a=[$0], c=[$2])
-            +- LogicalTableScan(table=[[MyTable2, source: [TestTableSource(a, b, c)]]])
+            +- LogicalTableScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c)]]])
 
 LogicalSink(fields=[a])
 +- LogicalProject(a=[$0])
    +- LogicalUnion(all=[true])
       :- LogicalProject(a=[$0], c=[$2])
-      :  +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+      :  +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
       +- LogicalProject(d=[$0], f=[$2])
-         +- LogicalTableScan(table=[[MyTable1, source: [TestTableSource(d, e, f)]]])
+         +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(d, e, f)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -426,15 +426,15 @@ LogicalSink(fields=[a])
 Union(all=[true], union=[a], reuse_id=[2])
 :- Calc(select=[a])
 :  +- Calc(select=[a, c])
-:     +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+:     +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 +- Calc(select=[d AS a])
    +- Calc(select=[d, f])
-      +- TableSourceScan(table=[[MyTable1, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+      +- TableSourceScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 
 Union(all=[true], union=[a], reuse_id=[1])
 :- Reused(reference_id=[2])
 +- Calc(select=[a])
-   +- TableSourceScan(table=[[MyTable2, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+   +- TableSourceScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 
 Sink(fields=[total_sum])
 +- HashAggregate(isMerge=[true], select=[Final_SUM(sum$0) AS total_sum])
@@ -459,9 +459,9 @@ Sink(fields=[a])
 LogicalSink(fields=[a])
 +- LogicalUnion(all=[true])
    :- LogicalProject(a=[$0], c=[$2])
-   :  +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   :  +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
    +- LogicalProject(d=[$0], f=[$2])
-      +- LogicalTableScan(table=[[MyTable1, source: [TestTableSource(d, e, f)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(d, e, f)]]])
 
 LogicalSink(fields=[total_sum])
 +- LogicalAggregate(group=[{}], total_sum=[SUM($0)])
@@ -470,11 +470,11 @@ LogicalSink(fields=[total_sum])
          :- LogicalProject(a=[$0], c=[$1])
          :  +- LogicalUnion(all=[true])
          :     :- LogicalProject(a=[$0], c=[$2])
-         :     :  +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+         :     :  +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
          :     +- LogicalProject(d=[$0], f=[$2])
-         :        +- LogicalTableScan(table=[[MyTable1, source: [TestTableSource(d, e, f)]]])
+         :        +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(d, e, f)]]])
          +- LogicalProject(a=[$0], c=[$2])
-            +- LogicalTableScan(table=[[MyTable2, source: [TestTableSource(a, b, c)]]])
+            +- LogicalTableScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c)]]])
 
 LogicalSink(fields=[total_min])
 +- LogicalAggregate(group=[{}], total_min=[MIN($0)])
@@ -483,20 +483,20 @@ LogicalSink(fields=[total_min])
          :- LogicalProject(a=[$0], c=[$1])
          :  +- LogicalUnion(all=[true])
          :     :- LogicalProject(a=[$0], c=[$2])
-         :     :  +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+         :     :  +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
          :     +- LogicalProject(d=[$0], f=[$2])
-         :        +- LogicalTableScan(table=[[MyTable1, source: [TestTableSource(d, e, f)]]])
+         :        +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(d, e, f)]]])
          +- LogicalProject(a=[$0], c=[$2])
-            +- LogicalTableScan(table=[[MyTable2, source: [TestTableSource(a, b, c)]]])
+            +- LogicalTableScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
 Union(all=[true], union=[a, c], reuse_id=[1])
 :- Calc(select=[a, c])
-:  +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+:  +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 +- Calc(select=[d, f])
-   +- TableSourceScan(table=[[MyTable1, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+   +- TableSourceScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 
 Sink(fields=[a])
 +- Reused(reference_id=[1])
@@ -506,7 +506,7 @@ Union(all=[true], union=[a], reuse_id=[2])
 :  +- Reused(reference_id=[1])
 +- Calc(select=[a])
    +- Calc(select=[a, c])
-      +- TableSourceScan(table=[[MyTable2, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+      +- TableSourceScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 
 Sink(fields=[total_sum])
 +- HashAggregate(isMerge=[true], select=[Final_SUM(sum$0) AS total_sum])
@@ -531,11 +531,11 @@ LogicalSink(fields=[total_sum])
       +- LogicalUnion(all=[true])
          :- LogicalUnion(all=[true])
          :  :- LogicalProject(a=[$0], c=[$2])
-         :  :  +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+         :  :  +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
          :  +- LogicalProject(d=[$0], f=[$2])
-         :     +- LogicalTableScan(table=[[MyTable1, source: [TestTableSource(d, e, f)]]])
+         :     +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(d, e, f)]]])
          +- LogicalProject(a=[$0], c=[$2])
-            +- LogicalTableScan(table=[[MyTable2, source: [TestTableSource(a, b, c)]]])
+            +- LogicalTableScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c)]]])
 
 LogicalSink(fields=[total_min])
 +- LogicalAggregate(group=[{}], total_min=[MIN($0)])
@@ -543,11 +543,11 @@ LogicalSink(fields=[total_min])
       +- LogicalUnion(all=[true])
          :- LogicalUnion(all=[true])
          :  :- LogicalProject(a=[$0], c=[$2])
-         :  :  +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+         :  :  +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
          :  +- LogicalProject(d=[$0], f=[$2])
-         :     +- LogicalTableScan(table=[[MyTable1, source: [TestTableSource(d, e, f)]]])
+         :     +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(d, e, f)]]])
          +- LogicalProject(a=[$0], c=[$2])
-            +- LogicalTableScan(table=[[MyTable2, source: [TestTableSource(a, b, c)]]])
+            +- LogicalTableScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -556,13 +556,13 @@ Union(all=[true], union=[a], reuse_id=[1])
 :- Union(all=[true], union=[a])
 :  :- Calc(select=[a])
 :  :  +- Calc(select=[a, c])
-:  :     +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+:  :     +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 :  +- Calc(select=[d AS a])
 :     +- Calc(select=[d, f])
-:        +- TableSourceScan(table=[[MyTable1, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+:        +- TableSourceScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 +- Calc(select=[a])
    +- Calc(select=[a, c])
-      +- TableSourceScan(table=[[MyTable2, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+      +- TableSourceScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 
 Sink(fields=[total_sum])
 +- HashAggregate(isMerge=[true], select=[Final_SUM(sum$0) AS total_sum])
@@ -585,13 +585,13 @@ LogicalSink(fields=[a, sum_c, time, window_start, window_end])
 +- LogicalProject(a=[$1], sum_c=[$2], time=[TUMBLE_END($0)], window_start=[TUMBLE_START($0)], window_end=[TUMBLE_END($0)])
    +- LogicalAggregate(group=[{0, 1}], sum_c=[SUM($2)])
       +- LogicalProject($f0=[TUMBLE($3, 15000:INTERVAL SECOND)], a=[$0], $f2=[CAST($2):DOUBLE])
-         +- LogicalTableScan(table=[[MyTable2, source: [TestTableSource(a, b, c, ts)]]])
+         +- LogicalTableScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, ts)]]])
 
 LogicalSink(fields=[a, sum_c, time])
 +- LogicalProject(a=[$1], sum_c=[$2], time=[TUMBLE_END($0)])
    +- LogicalAggregate(group=[{0, 1}], sum_c=[SUM($2)])
       +- LogicalProject($f0=[TUMBLE($3, 15000:INTERVAL SECOND)], a=[$0], $f2=[CAST($2):DOUBLE])
-         +- LogicalTableScan(table=[[MyTable2, source: [TestTableSource(a, b, c, ts)]]])
+         +- LogicalTableScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, ts)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -600,7 +600,7 @@ HashWindowAggregate(groupBy=[a], window=[TumblingGroupWindow], properties=[w$sta
 +- Exchange(distribution=[hash[a]])
    +- LocalHashWindowAggregate(groupBy=[a], window=[TumblingGroupWindow], properties=[w$start, w$end, w$rowtime], select=[a, Partial_SUM(c) AS sum$0])
       +- Calc(select=[ts, a, CAST(c) AS c])
-         +- TableSourceScan(table=[[MyTable2, source: [TestTableSource(a, b, c, ts)]]], fields=[a, b, c, ts])
+         +- TableSourceScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c, ts)]]], fields=[a, b, c, ts])
 
 Sink(fields=[a, sum_c, time, window_start, window_end])
 +- Calc(select=[a, sum_c, w$end AS time, w$start AS window_start, w$end AS window_end])
@@ -626,12 +626,12 @@ LogicalSink(fields=[a, total_c])
          :           +- LogicalCorrelate(correlation=[$cor0], joinType=[inner], requiredColumns=[{2}])
          :              :- LogicalProject(a=[$0], b=[-($1, MOD($1, 300))], c=[$2])
          :              :  +- LogicalFilter(condition=[>=($1, UNIX_TIMESTAMP(_UTF-16LE'${startTime}'))])
-         :              :     +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+         :              :     +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
          :              +- LogicalTableFunctionScan(invocation=[split($cor0.c)], rowType=[RecordType(VARCHAR(2147483647) f0)], elementType=[class [Ljava.lang.Object;])
          +- LogicalProject(a=[$0], total_c=[0])
             +- LogicalProject(a=[$0], b=[-($1, MOD($1, 300))], c=[$2])
                +- LogicalFilter(condition=[>=($1, UNIX_TIMESTAMP(_UTF-16LE'${startTime}'))])
-                  +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+                  +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 
 LogicalSink(fields=[a, total_c])
 +- LogicalProject(a=[$0], total_c=[$1])
@@ -644,17 +644,17 @@ LogicalSink(fields=[a, total_c])
          :           +- LogicalCorrelate(correlation=[$cor0], joinType=[inner], requiredColumns=[{2}])
          :              :- LogicalProject(a=[$0], b=[-($1, MOD($1, 300))], c=[$2])
          :              :  +- LogicalFilter(condition=[>=($1, UNIX_TIMESTAMP(_UTF-16LE'${startTime}'))])
-         :              :     +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+         :              :     +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
          :              +- LogicalTableFunctionScan(invocation=[split($cor0.c)], rowType=[RecordType(VARCHAR(2147483647) f0)], elementType=[class [Ljava.lang.Object;])
          +- LogicalProject(a=[$0], total_c=[0])
             +- LogicalProject(a=[$0], b=[-($1, MOD($1, 300))], c=[$2])
                +- LogicalFilter(condition=[>=($1, UNIX_TIMESTAMP(_UTF-16LE'${startTime}'))])
-                  +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+                  +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
-TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c], reuse_id=[1])
+TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c], reuse_id=[1])
 
 Calc(select=[a, total_c], reuse_id=[2])
 +- HashAggregate(isMerge=[true], groupBy=[a, b], select=[a, b, Final_COUNT(count$0) AS total_c])
@@ -693,7 +693,7 @@ Sink(fields=[a, total_c])
 LogicalSink(fields=[c, cnt])
 +- LogicalAggregate(group=[{0}], cnt=[COUNT($1)])
    +- LogicalProject(c=[$2], a=[$0])
-      +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -703,7 +703,7 @@ Sink(fields=[c, cnt])
    +- Exchange(distribution=[hash[c]])
       +- LocalHashAggregate(groupBy=[c], select=[c, Partial_COUNT(a) AS count$0])
          +- Calc(select=[c, a])
-            +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+            +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -718,18 +718,18 @@ LogicalSink(fields=[a1, b, c1])
          :  +- LogicalFilter(condition=[<($1, 5)])
          :     +- LogicalProject(a=[$0], b=[$1], c=[$2])
          :        +- LogicalFilter(condition=[>=($0, 0)])
-         :           +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+         :           +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
          +- LogicalProject(a1=[$0], b=[$1], c2=[$3])
             +- LogicalFilter(condition=[=($0, $2)])
                +- LogicalJoin(condition=[true], joinType=[inner])
                   :- LogicalProject(a1=[$0], b=[$1])
                   :  +- LogicalFilter(condition=[<=($0, 10)])
-                  :     +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+                  :     +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
                   +- LogicalProject(a2=[$0], c=[$2])
                      +- LogicalFilter(condition=[>=($1, 5)])
                         +- LogicalProject(a=[$0], b=[$1], c=[$2])
                            +- LogicalFilter(condition=[>=($0, 0)])
-                              +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+                              +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -739,7 +739,7 @@ Sink(fields=[a1, b, c1])
    +- HashJoin(joinType=[InnerJoin], where=[=(a1, a3)], select=[a3, c1, a1, b], build=[right])
       :- Exchange(distribution=[hash[a3]], exchange_mode=[BATCH])
       :  +- Calc(select=[a AS a3, c AS c1], where=[AND(>=(a, 0), <(b, 5))])
-      :     +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c], reuse_id=[1])
+      :     +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c], reuse_id=[1])
       +- Calc(select=[a AS a1, b])
          +- HashJoin(joinType=[InnerJoin], where=[=(a, a2)], select=[a, b, a2], build=[right])
             :- Exchange(distribution=[hash[a]], exchange_mode=[BATCH])
@@ -759,15 +759,15 @@ LogicalSink(fields=[a1, b1])
    :- LogicalProject(a1=[$0], b1=[$1])
    :  +- LogicalProject(a1=[$0], b1=[$1])
    :     +- LogicalFilter(condition=[<=($0, 10)])
-   :        +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   :        +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
    +- LogicalProject(a=[$0], b1=[$1])
       +- LogicalProject(a=[$2], b1=[$1])
          +- LogicalFilter(condition=[=($2, $0)])
             +- LogicalJoin(condition=[true], joinType=[inner])
                :- LogicalProject(a1=[$0], b1=[$1])
                :  +- LogicalFilter(condition=[<=($0, 10)])
-               :     +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
-               +- LogicalTableScan(table=[[MyTable2]])
+               :     +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
+               +- LogicalTableScan(table=[[default_catalog, default_database, MyTable2]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -775,14 +775,14 @@ LogicalSink(fields=[a1, b1])
 Sink(fields=[a1, b1])
 +- Union(all=[true], union=[a, b])
    :- Calc(select=[a, b], where=[<=(a, 10)], reuse_id=[1])
-   :  +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+   :  +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
    +- Calc(select=[a0 AS a, b AS b1])
       +- HashJoin(joinType=[InnerJoin], where=[=(a0, a)], select=[a, b, a0], build=[left])
          :- Exchange(distribution=[hash[a]])
          :  +- Reused(reference_id=[1])
          +- Exchange(distribution=[hash[a]])
             +- Calc(select=[a])
-               +- BoundedStreamScan(table=[[MyTable2]], fields=[a, b, c, d, e])
+               +- BoundedStreamScan(table=[[default_catalog, default_database, MyTable2]], fields=[a, b, c, d, e])
 ]]>
     </Resource>
   </TestCase>
@@ -795,7 +795,7 @@ LogicalSink(fields=[a, b, c])
       +- LogicalJoin(condition=[true], joinType=[inner])
          :- LogicalProject(a1=[$0], b=[$1])
          :  +- LogicalFilter(condition=[<=($0, 10)])
-         :     +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+         :     +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
          +- LogicalProject(a3=[$0], b1=[$3], c1=[$1])
             +- LogicalFilter(condition=[=($2, $0)])
                +- LogicalJoin(condition=[true], joinType=[inner])
@@ -803,18 +803,18 @@ LogicalSink(fields=[a, b, c])
                   :  +- LogicalFilter(condition=[<($1, 5)])
                   :     +- LogicalProject(a=[$0], b=[$1], c=[$2])
                   :        +- LogicalFilter(condition=[>=($0, 0)])
-                  :           +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+                  :           +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
                   +- LogicalProject(a1=[$0], b=[$1], c2=[$3])
                      +- LogicalFilter(condition=[=($0, $2)])
                         +- LogicalJoin(condition=[true], joinType=[inner])
                            :- LogicalProject(a1=[$0], b=[$1])
                            :  +- LogicalFilter(condition=[<=($0, 10)])
-                           :     +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+                           :     +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
                            +- LogicalProject(a2=[$0], c=[$2])
                               +- LogicalFilter(condition=[>=($1, 5)])
                                  +- LogicalProject(a=[$0], b=[$1], c=[$2])
                                     +- LogicalFilter(condition=[>=($0, 0)])
-                                       +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+                                       +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -824,7 +824,7 @@ Sink(fields=[a, b, c])
    +- HashJoin(joinType=[InnerJoin], where=[=(a, a3)], select=[a, a3, b1, c1], build=[right])
       :- Exchange(distribution=[hash[a]], exchange_mode=[BATCH])
       :  +- Calc(select=[a], where=[<=(a, 10)])
-      :     +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c], reuse_id=[1])
+      :     +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c], reuse_id=[1])
       +- Calc(select=[a3, b AS b1, c1])
          +- HashJoin(joinType=[InnerJoin], where=[=(a1, a3)], select=[a3, c1, a1, b], build=[right])
             :- Exchange(distribution=[hash[a3]], exchange_mode=[BATCH])
@@ -851,9 +851,9 @@ LogicalSink(fields=[a, b, c, d, e, f, i, j, k, l, m, s])
       :  +- LogicalFilter(condition=[AND(=($1, $4), =($0, $6))])
       :     +- LogicalJoin(condition=[true], joinType=[inner])
       :        :- LogicalJoin(condition=[true], joinType=[inner])
-      :        :  :- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
-      :        :  +- LogicalTableScan(table=[[MyTable1, source: [TestTableSource(d, e, f)]]])
-      :        +- LogicalTableScan(table=[[MyTable2, source: [TestTableSource(i, j, k, l, m)]]])
+      :        :  :- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
+      :        :  +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(d, e, f)]]])
+      :        +- LogicalTableScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(i, j, k, l, m)]]])
       +- LogicalTableFunctionScan(invocation=[split($cor0.c)], rowType=[RecordType(VARCHAR(2147483647) f0)], elementType=[class [Ljava.lang.Object;])
 ]]>
     </Resource>
@@ -865,11 +865,11 @@ Sink(fields=[a, b, c, d, e, f, i, j, k, l, m, s])
       :- Exchange(distribution=[hash[a]])
       :  +- HashJoin(joinType=[InnerJoin], where=[=(b, e)], select=[a, b, c, d, e, f], build=[right])
       :     :- Exchange(distribution=[hash[b]])
-      :     :  +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+      :     :  +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
       :     +- Exchange(distribution=[hash[e]])
-      :        +- TableSourceScan(table=[[MyTable1, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+      :        +- TableSourceScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
       +- Exchange(distribution=[hash[i]])
-         +- TableSourceScan(table=[[MyTable2, source: [TestTableSource(i, j, k, l, m)]]], fields=[i, j, k, l, m])
+         +- TableSourceScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(i, j, k, l, m)]]], fields=[i, j, k, l, m])
 ]]>
     </Resource>
   </TestCase>
@@ -881,9 +881,9 @@ LogicalSink(fields=[total_sum])
    +- LogicalProject(a=[$0])
       +- LogicalUnion(all=[true])
          :- LogicalProject(a=[$0], c=[$2])
-         :  +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+         :  +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
          +- LogicalProject(d=[$0], f=[$2])
-            +- LogicalTableScan(table=[[MyTable1, source: [TestTableSource(d, e, f)]]])
+            +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(d, e, f)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -894,9 +894,9 @@ Sink(fields=[total_sum])
       +- LocalHashAggregate(select=[Partial_SUM(a) AS sum$0])
          +- Union(all=[true], union=[a])
             :- Calc(select=[a])
-            :  +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+            :  +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
             +- Calc(select=[d AS a])
-               +- TableSourceScan(table=[[MyTable1, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+               +- TableSourceScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 ]]>
     </Resource>
   </TestCase>
diff --git a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/DeadlockBreakupTest.xml b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/DeadlockBreakupTest.xml
index 69ec9d6..c960305 100644
--- a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/DeadlockBreakupTest.xml
+++ b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/DeadlockBreakupTest.xml
@@ -30,10 +30,10 @@ LogicalProject(c=[$0], a=[$1], b=[$2], c0=[$3], a0=[$4], b0=[$5])
    +- LogicalJoin(condition=[true], joinType=[inner])
       :- LogicalAggregate(group=[{0}], a=[SUM($1)], b=[SUM($2)])
       :  +- LogicalProject(c=[$2], a=[$0], b=[$1])
-      :     +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+      :     +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
       +- LogicalAggregate(group=[{0}], a=[SUM($1)], b=[SUM($2)])
          +- LogicalProject(c=[$2], a=[$0], b=[$1])
-            +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+            +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -45,7 +45,7 @@ Calc(select=[c, a, b, c0, a1, b0])
    :     +- HashAggregate(isMerge=[true], groupBy=[c], select=[c, Final_SUM(sum$0) AS a, Final_SUM(sum$1) AS b], reuse_id=[1])
    :        +- Exchange(distribution=[hash[c]])
    :           +- LocalHashAggregate(groupBy=[c], select=[c, Partial_SUM(a) AS sum$0, Partial_SUM(b) AS sum$1])
-   :              +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+   :              +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
    +- Exchange(distribution=[broadcast])
       +- Calc(select=[c, a, b], where=[>(a, 1)])
          +- Reused(reference_id=[1])
@@ -72,16 +72,16 @@ LogicalProject(a=[$0], b=[$1], c=[$2], a0=[$3], b0=[$4], c0=[$5], a1=[$6], b1=[$
       :  +- LogicalFilter(condition=[AND(=($0, $3), >($1, 10))])
       :     +- LogicalJoin(condition=[true], joinType=[inner])
       :        :- LogicalAggregate(group=[{0}], b=[SUM($1)], c=[MAX($2)])
-      :        :  +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+      :        :  +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
       :        +- LogicalAggregate(group=[{0}], b=[SUM($1)], c=[MAX($2)])
-      :           +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+      :           +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
       +- LogicalProject(a=[$0], b=[$1], c=[$2], a0=[$3], b0=[$4], c0=[$5])
          +- LogicalFilter(condition=[AND(=($0, $3), <($1, 5))])
             +- LogicalJoin(condition=[true], joinType=[inner])
                :- LogicalAggregate(group=[{0}], b=[SUM($1)], c=[MAX($2)])
-               :  +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+               :  +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
                +- LogicalAggregate(group=[{0}], b=[SUM($1)], c=[MAX($2)])
-                  +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+                  +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -95,7 +95,7 @@ HashJoin(joinType=[InnerJoin], where=[=(c, c1)], select=[a, b, c, a0, b0, c0, a1
 :     :        +- Exchange(distribution=[hash[a]])
 :     :           +- LocalSortAggregate(groupBy=[a], select=[a, Partial_SUM(b) AS sum$0, Partial_MAX(c) AS max$1])
 :     :              +- Sort(orderBy=[a ASC])
-:     :                 +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+:     :                 +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 :     +- Exchange(distribution=[hash[a]], exchange_mode=[BATCH])
 :        +- Reused(reference_id=[1])
 +- Exchange(distribution=[hash[c]])
@@ -121,16 +121,16 @@ WHERE r1.a = r2.a and r1.b = 5
 LogicalProject(a=[$0], b=[$4])
 +- LogicalFilter(condition=[AND(=($0, $3), =($1, 5))])
    +- LogicalJoin(condition=[true], joinType=[inner])
-      :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+      :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
       +- LogicalProject(a=[$0], b=[$1])
          +- LogicalFilter(condition=[IN($0, {
 LogicalProject(a=[$0])
   LogicalFilter(condition=[>($1, 5)])
-    LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+    LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
 })])
             +- LogicalSort(fetch=[10])
                +- LogicalProject(a=[$0], b=[$1])
-                  +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+                  +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -139,7 +139,7 @@ Calc(select=[a, b])
 +- HashJoin(joinType=[InnerJoin], where=[=(a, a0)], select=[a, a0, b], build=[right])
    :- Exchange(distribution=[hash[a]], exchange_mode=[BATCH])
    :  +- Calc(select=[a], where=[=(b, 5:BIGINT)])
-   :     +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c], reuse_id=[1])
+   :     +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c], reuse_id=[1])
    +- HashJoin(joinType=[LeftSemiJoin], where=[=(a, a0)], select=[a, b], build=[left])
       :- Exchange(distribution=[hash[a]])
       :  +- Calc(select=[a, b])
@@ -167,10 +167,10 @@ LogicalProject(a=[$0])
    +- LogicalJoin(condition=[true], joinType=[inner])
       :- LogicalSort(fetch=[10])
       :  +- LogicalProject(a=[$0])
-      :     +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+      :     +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
       +- LogicalSort(fetch=[10])
          +- LogicalProject(a=[$0])
-            +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+            +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -182,7 +182,7 @@ Calc(select=[a])
    :     +- Limit(offset=[0], fetch=[10], global=[true])
    :        +- Exchange(distribution=[single])
    :           +- Limit(offset=[0], fetch=[10], global=[false])
-   :              +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+   :              +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
    +- Exchange(distribution=[broadcast])
       +- Reused(reference_id=[1])
 ]]>
@@ -202,10 +202,10 @@ LogicalProject(a=[$0])
    +- LogicalJoin(condition=[true], joinType=[inner])
       :- LogicalSort(fetch=[10])
       :  +- LogicalProject(a=[$0])
-      :     +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+      :     +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
       +- LogicalSort(fetch=[10])
          +- LogicalProject(a=[$0])
-            +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+            +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -217,7 +217,7 @@ Calc(select=[a])
    :     +- Limit(offset=[0], fetch=[10], global=[true])
    :        +- Exchange(distribution=[single])
    :           +- Limit(offset=[0], fetch=[10], global=[false])
-   :              +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+   :              +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
    +- Exchange(distribution=[any], exchange_mode=[BATCH])
       +- Reused(reference_id=[1])
 ]]>
@@ -238,13 +238,13 @@ LogicalProject(a=[$0], b=[$1], d=[$2], e=[$3], a0=[$4], b0=[$5], d0=[$6], e0=[$7
       :- LogicalProject(a=[$0], b=[$1], d=[$3], e=[$4])
       :  +- LogicalFilter(condition=[=($0, $3)])
       :     +- LogicalJoin(condition=[true], joinType=[inner])
-      :        :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
-      :        +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+      :        :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
+      :        +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
       +- LogicalProject(a=[$0], b=[$1], d=[$3], e=[$4])
          +- LogicalFilter(condition=[=($0, $3)])
             +- LogicalJoin(condition=[true], joinType=[inner])
-               :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
-               +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+               :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
+               +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -254,10 +254,10 @@ HashJoin(joinType=[InnerJoin], where=[=(b, e0)], select=[a, b, d, e, a0, b0, d0,
 :  +- HashJoin(joinType=[InnerJoin], where=[=(a, d)], select=[a, b, d, e], build=[left])
 :     :- Exchange(distribution=[hash[a]])
 :     :  +- Calc(select=[a, b], where=[<(a, 10)])
-:     :     +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c], reuse_id=[1])
+:     :     +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c], reuse_id=[1])
 :     +- Exchange(distribution=[hash[d]], reuse_id=[2])
 :        +- Calc(select=[d, e])
-:           +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+:           +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 +- Exchange(distribution=[hash[e]])
    +- HashJoin(joinType=[InnerJoin], where=[=(a, d)], select=[a, b, d, e], build=[left])
       :- Exchange(distribution=[hash[a]])
@@ -285,9 +285,9 @@ LogicalProject(a=[$0], b=[$1], c=[$2], a0=[$3], b0=[$4], c0=[$5])
 +- LogicalFilter(condition=[=($2, $5)])
    +- LogicalJoin(condition=[true], joinType=[inner])
       :- LogicalProject(a=[MAX(CASE(>(COUNT($0) OVER (PARTITION BY $1 ORDER BY $1 NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW), 0), $SUM0($0) OVER (PARTITION BY $1 ORDER BY $1 NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW), null:INTEGER)) OVER (PARTITION BY $1 ORDER BY $1 NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)], b=[$1], c=[$2])
-      :  +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+      :  +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
       +- LogicalProject(a=[MIN(CASE(>(COUNT($0) OVER (PARTITION BY $1 ORDER BY $1 NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW), 0), $SUM0($0) OVER (PARTITION BY $1 ORDER BY $1 NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW), null:INTEGER)) OVER (PARTITION BY $1 ORDER BY $1 NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)], b=[$1], c=[$2])
-         +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+         +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -300,7 +300,7 @@ HashJoin(joinType=[InnerJoin], where=[=(c, c0)], select=[a, b, c, a0, b0, c0], b
 :           +- OverAggregate(partitionBy=[b], orderBy=[b ASC], window#0=[COUNT(a) AS w0$o0, $SUM0(a) AS w0$o1 RANG BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW], select=[a, b, c, w0$o0, w0$o1])
 :              +- Sort(orderBy=[b ASC])
 :                 +- Exchange(distribution=[hash[b]])
-:                    +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+:                    +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 +- Exchange(distribution=[hash[c]])
    +- Calc(select=[w0$o0 AS a, b, c])
       +- OverAggregate(partitionBy=[b], orderBy=[b ASC], window#0=[MIN($2) AS w0$o0 RANG BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING], select=[b, c, $2, w0$o0])
diff --git a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/LimitTest.xml b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/LimitTest.xml
index 54f0292..217eb87 100644
--- a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/LimitTest.xml
+++ b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/LimitTest.xml
@@ -24,7 +24,7 @@ limitations under the License.
       <![CDATA[
 LogicalSort(fetch=[0])
 +- LogicalProject(a=[$0], c=[$2])
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -41,7 +41,7 @@ Values(tuples=[[]], values=[a, c])
       <![CDATA[
 LogicalSort(offset=[10], fetch=[10])
 +- LogicalProject(a=[$0], c=[$2])
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -50,7 +50,7 @@ Calc(select=[a, c])
 +- Limit(offset=[10], fetch=[10], global=[true])
    +- Exchange(distribution=[single])
       +- Limit(offset=[0], fetch=[20], global=[false])
-         +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+         +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -62,7 +62,7 @@ Calc(select=[a, c])
       <![CDATA[
 LogicalSort(fetch=[10])
 +- LogicalProject(a=[$0], c=[$2])
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -71,7 +71,7 @@ Calc(select=[a, c])
 +- Limit(offset=[0], fetch=[10], global=[true])
    +- Exchange(distribution=[single])
       +- Limit(offset=[0], fetch=[10], global=[false])
-         +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+         +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -83,7 +83,7 @@ Calc(select=[a, c])
       <![CDATA[
 LogicalSort(offset=[10], fetch=[0])
 +- LogicalProject(a=[$0], c=[$2])
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -100,7 +100,7 @@ Values(tuples=[[]], values=[a, c])
       <![CDATA[
 LogicalSort(offset=[1], fetch=[10])
 +- LogicalProject(a=[$0], c=[$2])
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -109,7 +109,7 @@ Calc(select=[a, c])
 +- Limit(offset=[1], fetch=[10], global=[true])
    +- Exchange(distribution=[single])
       +- Limit(offset=[0], fetch=[11], global=[false])
-         +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+         +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -121,7 +121,7 @@ Calc(select=[a, c])
       <![CDATA[
 LogicalSort(offset=[0], fetch=[0])
 +- LogicalProject(a=[$0], c=[$2])
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -138,7 +138,7 @@ Values(tuples=[[]], values=[a, c])
       <![CDATA[
 LogicalSort(fetch=[0])
 +- LogicalProject(a=[$0], b=[$1], c=[$2])
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -155,7 +155,7 @@ Values(tuples=[[]], values=[a, b, c])
       <![CDATA[
 LogicalSort(offset=[0], fetch=[10])
 +- LogicalProject(a=[$0], c=[$2])
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -164,7 +164,7 @@ Calc(select=[a, c])
 +- Limit(offset=[0], fetch=[10], global=[true])
    +- Exchange(distribution=[single])
       +- Limit(offset=[0], fetch=[10], global=[false])
-         +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+         +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -176,7 +176,7 @@ Calc(select=[a, c])
       <![CDATA[
 LogicalSort(offset=[10])
 +- LogicalProject(a=[$0], c=[$2])
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -184,7 +184,7 @@ LogicalSort(offset=[10])
 Calc(select=[a, c])
 +- Limit(offset=[10], fetch=[unlimited], global=[true])
    +- Exchange(distribution=[single])
-      +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+      +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -196,7 +196,7 @@ Calc(select=[a, c])
       <![CDATA[
 LogicalSort(fetch=[5])
 +- LogicalProject(a=[$0], b=[$1], c=[$2])
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -204,7 +204,7 @@ LogicalSort(fetch=[5])
 Limit(offset=[0], fetch=[5], global=[true])
 +- Exchange(distribution=[single])
    +- Limit(offset=[0], fetch=[5], global=[false])
-      +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+      +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
diff --git a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/RankTest.xml b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/RankTest.xml
index 26a6b3f..1d41877 100644
--- a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/RankTest.xml
+++ b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/RankTest.xml
@@ -29,7 +29,7 @@ WHERE rk < 10
 LogicalProject(a=[$0], b=[$1], rk=[$2])
 +- LogicalFilter(condition=[<($2, 10)])
    +- LogicalProject(a=[$0], b=[$1], rk=[RANK() OVER (PARTITION BY $1 ORDER BY $0 NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)])
-      +- LogicalTableScan(table=[[MyTable2, source: [TestTableSource(a, b, rk)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, rk)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -40,7 +40,7 @@ Calc(select=[a, b, w0$o0])
       +- Exchange(distribution=[hash[b]])
          +- Rank(rankType=[RANK], rankRange=[rankStart=1, rankEnd=9], partitionBy=[b], orderBy=[a ASC], global=[false], select=[a, b, rk])
             +- Sort(orderBy=[b ASC, a ASC])
-               +- TableSourceScan(table=[[MyTable2, source: [TestTableSource(a, b, rk)]]], fields=[a, b, rk])
+               +- TableSourceScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, rk)]]], fields=[a, b, rk])
 ]]>
     </Resource>
   </TestCase>
@@ -59,7 +59,7 @@ WHERE rk1 < 10
 LogicalProject(a=[$0], b=[$1], rk1=[$2], rk2=[$3])
 +- LogicalFilter(condition=[<($2, 10)])
    +- LogicalProject(a=[$0], b=[$1], rk1=[RANK() OVER (PARTITION BY $1 ORDER BY $0 NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)], rk2=[RANK() OVER (PARTITION BY $1 ORDER BY $0 NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)])
-      +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -70,7 +70,7 @@ Calc(select=[a, b, rk2 AS rk1, rk2])
       +- Exchange(distribution=[hash[b]])
          +- Rank(rankType=[RANK], rankRange=[rankStart=1, rankEnd=9], partitionBy=[b], orderBy=[a ASC], global=[false], select=[a, b, c])
             +- Sort(orderBy=[b ASC, a ASC])
-               +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+               +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -87,7 +87,7 @@ WHERE rk < 10
 LogicalProject(a=[$0], rk=[$1], b=[$2], c=[$3])
 +- LogicalFilter(condition=[<($1, 10)])
    +- LogicalProject(a=[$0], rk=[RANK() OVER (PARTITION BY $0 ORDER BY $0 NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)], b=[$1], c=[$2])
-      +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -98,7 +98,7 @@ Calc(select=[a, rk, b, c])
       +- Exchange(distribution=[hash[a]])
          +- Rank(rankType=[RANK], rankRange=[rankStart=1, rankEnd=9], partitionBy=[a], orderBy=[a ASC], global=[false], select=[a, b, c])
             +- Sort(orderBy=[a ASC])
-               +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+               +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -115,7 +115,7 @@ WHERE rk = 2
 LogicalProject(a=[$0], b=[$1], rk=[$2])
 +- LogicalFilter(condition=[=($2, 2)])
    +- LogicalProject(a=[$0], b=[$1], rk=[RANK() OVER (PARTITION BY $1 ORDER BY $0 NULLS FIRST, $2 NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)])
-      +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -126,7 +126,7 @@ Calc(select=[a, b, 2:BIGINT AS rk])
       +- Exchange(distribution=[hash[b]])
          +- Rank(rankType=[RANK], rankRange=[rankStart=1, rankEnd=2], partitionBy=[b], orderBy=[a ASC, c ASC], global=[false], select=[a, b, c])
             +- Sort(orderBy=[b ASC, a ASC, c ASC])
-               +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+               +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -143,7 +143,7 @@ WHERE rk <= 2 AND rk > -2
 LogicalProject(a=[$0], b=[$1], rk=[$2])
 +- LogicalFilter(condition=[AND(<=($2, 2), >($2, -2))])
    +- LogicalProject(a=[$0], b=[$1], rk=[RANK() OVER (PARTITION BY $1, $2 ORDER BY $0 NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)])
-      +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -154,7 +154,7 @@ Calc(select=[a, b, w0$o0])
       +- Exchange(distribution=[hash[b, c]])
          +- Rank(rankType=[RANK], rankRange=[rankStart=1, rankEnd=2], partitionBy=[b, c], orderBy=[a ASC], global=[false], select=[a, b, c])
             +- Sort(orderBy=[b ASC, c ASC, a ASC])
-               +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+               +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -171,7 +171,7 @@ WHERE rk <= 2 AND a > 10
 LogicalProject(a=[$0], b=[$1], rk=[$2])
 +- LogicalFilter(condition=[AND(<=($2, 2), >($0, 10))])
    +- LogicalProject(a=[$0], b=[$1], rk=[RANK() OVER (PARTITION BY $1 ORDER BY $0 NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)])
-      +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -182,7 +182,7 @@ Calc(select=[a, b, w0$o0], where=[>(a, 10)])
       +- Exchange(distribution=[hash[b]])
          +- Rank(rankType=[RANK], rankRange=[rankStart=1, rankEnd=2], partitionBy=[b], orderBy=[a ASC], global=[false], select=[a, b, c])
             +- Sort(orderBy=[b ASC, a ASC])
-               +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+               +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -199,7 +199,7 @@ WHERE rk < 10
 LogicalProject(a=[$0], b=[$1], rk=[$2])
 +- LogicalFilter(condition=[<($2, 10)])
    +- LogicalProject(a=[$0], b=[$1], rk=[RANK() OVER (ORDER BY $0 NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)])
-      +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -210,7 +210,7 @@ Calc(select=[a, b, w0$o0])
       +- Exchange(distribution=[single])
          +- Rank(rankType=[RANK], rankRange=[rankStart=1, rankEnd=9], partitionBy=[], orderBy=[a ASC], global=[false], select=[a, b, c])
             +- Sort(orderBy=[a ASC])
-               +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+               +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
diff --git a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/RemoveCollationTest.xml b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/RemoveCollationTest.xml
index 250af25..fd8003b 100644
--- a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/RemoveCollationTest.xml
+++ b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/RemoveCollationTest.xml
@@ -30,8 +30,8 @@ LogicalProject(EXPR$0=[$1])
    +- LogicalProject(a=[$0], b=[$1])
       +- LogicalFilter(condition=[AND(=($0, $3), LIKE($2, _UTF-16LE'He%'))])
          +- LogicalJoin(condition=[true], joinType=[inner])
-            :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
-            +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+            :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
+            +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -42,10 +42,10 @@ Calc(select=[EXPR$0])
       +- SortMergeJoin(joinType=[InnerJoin], where=[=(a, d)], select=[a, b, d])
          :- Exchange(distribution=[hash[a]])
          :  +- Calc(select=[a, b], where=[LIKE(c, _UTF-16LE'He%')])
-         :     +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+         :     +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
          +- Exchange(distribution=[hash[d]])
             +- Calc(select=[d])
-               +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+               +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 ]]>
     </Resource>
   </TestCase>
@@ -63,8 +63,8 @@ LogicalProject(EXPR$0=[$1])
    +- LogicalProject(d=[$3], b=[$1])
       +- LogicalFilter(condition=[AND(=($0, $3), LIKE($2, _UTF-16LE'He%'))])
          +- LogicalJoin(condition=[true], joinType=[inner])
-            :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
-            +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+            :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
+            +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -75,10 +75,10 @@ Calc(select=[EXPR$0])
       +- SortMergeJoin(joinType=[InnerJoin], where=[=(a, d)], select=[a, b, d])
          :- Exchange(distribution=[hash[a]])
          :  +- Calc(select=[a, b], where=[LIKE(c, _UTF-16LE'He%')])
-         :     +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+         :     +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
          +- Exchange(distribution=[hash[d]])
             +- Calc(select=[d])
-               +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+               +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 ]]>
     </Resource>
   </TestCase>
@@ -93,7 +93,7 @@ SELECT a, b, COUNT(c) AS cnt FROM r GROUP BY a, b
       <![CDATA[
 LogicalAggregate(group=[{0, 1}], cnt=[COUNT($2)])
 +- LogicalProject(a=[$0], b=[$1], c=[$2])
-   +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -103,7 +103,7 @@ SortAggregate(isMerge=[true], groupBy=[a, b], select=[a, b, Final_COUNT(count$0)
    +- Exchange(distribution=[hash[a, b]])
       +- LocalSortAggregate(groupBy=[a, b], select=[a, b, Partial_COUNT(c) AS count$0])
          +- Sort(orderBy=[a ASC, b ASC])
-            +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+            +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -120,12 +120,12 @@ SELECT * FROM x, v WHERE c = f
 LogicalProject(a=[$0], b=[$1], c=[$2], f1=[$3], f=[$4], cnt=[$5])
 +- LogicalFilter(condition=[=($2, $4)])
    +- LogicalJoin(condition=[true], joinType=[inner])
-      :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+      :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
       +- LogicalProject(f1=[$2], f=[$0], cnt=[$1])
          +- LogicalCorrelate(correlation=[$cor0], joinType=[inner], requiredColumns=[{0}])
             :- LogicalAggregate(group=[{0}], cnt=[COUNT($0)])
             :  +- LogicalProject(f=[$2])
-            :     +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+            :     +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
             +- LogicalTableFunctionScan(invocation=[split($cor0.f)], rowType=[RecordType(VARCHAR(2147483647) f0)], elementType=[class [Ljava.lang.Object;])
 ]]>
     </Resource>
@@ -133,7 +133,7 @@ LogicalProject(a=[$0], b=[$1], c=[$2], f1=[$3], f=[$4], cnt=[$5])
       <![CDATA[
 SortMergeJoin(joinType=[InnerJoin], where=[=(c, f)], select=[a, b, c, f1, f, cnt], rightSorted=[true])
 :- Exchange(distribution=[hash[c]])
-:  +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+:  +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 +- Calc(select=[f0 AS f1, f, cnt])
    +- Correlate(invocation=[split($cor0.f)], correlate=[table(split($cor0.f))], select=[f,cnt,f0], rowType=[RecordType(VARCHAR(2147483647) f, BIGINT cnt, VARCHAR(2147483647) f0)], joinType=[INNER])
       +- SortAggregate(isMerge=[true], groupBy=[f], select=[f, Final_COUNT(count$0) AS cnt])
@@ -142,7 +142,7 @@ SortMergeJoin(joinType=[InnerJoin], where=[=(c, f)], select=[a, b, c, f1, f, cnt
                +- LocalSortAggregate(groupBy=[f], select=[f, Partial_COUNT(f) AS count$0])
                   +- Sort(orderBy=[f ASC])
                      +- Calc(select=[f])
-                        +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+                        +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 ]]>
     </Resource>
   </TestCase>
@@ -159,12 +159,12 @@ SELECT * FROM x, v WHERE c = f AND f LIKE '%llo%'
 LogicalProject(a=[$0], b=[$1], c=[$2], f=[$3], f1=[$4])
 +- LogicalFilter(condition=[AND(=($2, $3), LIKE($3, _UTF-16LE'%llo%'))])
    +- LogicalJoin(condition=[true], joinType=[inner])
-      :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+      :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
       +- LogicalProject(f=[$0], f1=[$2])
          +- LogicalCorrelate(correlation=[$cor0], joinType=[inner], requiredColumns=[{0}])
             :- LogicalAggregate(group=[{0}], cnt=[COUNT($0)])
             :  +- LogicalProject(f=[$2])
-            :     +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+            :     +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
             +- LogicalTableFunctionScan(invocation=[split($cor0.f)], rowType=[RecordType(VARCHAR(2147483647) f0)], elementType=[class [Ljava.lang.Object;])
 ]]>
     </Resource>
@@ -172,7 +172,7 @@ LogicalProject(a=[$0], b=[$1], c=[$2], f=[$3], f1=[$4])
       <![CDATA[
 SortMergeJoin(joinType=[InnerJoin], where=[=(c, f)], select=[a, b, c, f, f1], rightSorted=[true])
 :- Exchange(distribution=[hash[c]])
-:  +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+:  +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 +- Calc(select=[f, f0 AS f1])
    +- Correlate(invocation=[split($cor0.f)], correlate=[table(split($cor0.f))], select=[f,cnt,f0], rowType=[RecordType(VARCHAR(2147483647) f, BIGINT cnt, VARCHAR(2147483647) f0)], joinType=[INNER])
       +- SortAggregate(isMerge=[true], groupBy=[f], select=[f, Final_COUNT(count$0) AS cnt])
@@ -181,7 +181,7 @@ SortMergeJoin(joinType=[InnerJoin], where=[=(c, f)], select=[a, b, c, f, f1], ri
                +- LocalSortAggregate(groupBy=[f], select=[f, Partial_COUNT(f) AS count$0])
                   +- Sort(orderBy=[f ASC])
                      +- Calc(select=[f], where=[LIKE(f, _UTF-16LE'%llo%')])
-                        +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+                        +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 ]]>
     </Resource>
   </TestCase>
@@ -198,12 +198,12 @@ SELECT * FROM x, v WHERE c = f1
 LogicalProject(a=[$0], b=[$1], c=[$2], f1=[$3])
 +- LogicalFilter(condition=[=($2, $3)])
    +- LogicalJoin(condition=[true], joinType=[inner])
-      :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+      :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
       +- LogicalProject(f1=[$2])
          +- LogicalCorrelate(correlation=[$cor0], joinType=[inner], requiredColumns=[{0}])
             :- LogicalAggregate(group=[{0}], cnt=[COUNT($0)])
             :  +- LogicalProject(f=[$2])
-            :     +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+            :     +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
             +- LogicalTableFunctionScan(invocation=[split($cor0.f)], rowType=[RecordType(VARCHAR(2147483647) f0)], elementType=[class [Ljava.lang.Object;])
 ]]>
     </Resource>
@@ -211,7 +211,7 @@ LogicalProject(a=[$0], b=[$1], c=[$2], f1=[$3])
       <![CDATA[
 SortMergeJoin(joinType=[InnerJoin], where=[=(c, f1)], select=[a, b, c, f1])
 :- Exchange(distribution=[hash[c]])
-:  +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+:  +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 +- Exchange(distribution=[hash[f1]])
    +- Calc(select=[f0 AS f1])
       +- Correlate(invocation=[split($cor0.f)], correlate=[table(split($cor0.f))], select=[f,cnt,f0], rowType=[RecordType(VARCHAR(2147483647) f, BIGINT cnt, VARCHAR(2147483647) f0)], joinType=[INNER])
@@ -221,7 +221,7 @@ SortMergeJoin(joinType=[InnerJoin], where=[=(c, f1)], select=[a, b, c, f1])
                   +- LocalSortAggregate(groupBy=[f], select=[f, Partial_COUNT(f) AS count$0])
                      +- Sort(orderBy=[f ASC])
                         +- Calc(select=[f])
-                           +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+                           +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 ]]>
     </Resource>
   </TestCase>
@@ -240,10 +240,10 @@ LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5], a1=[$6], b1=[$7],
 +- LogicalJoin(condition=[=($0, $9)], joinType=[left])
    :- LogicalJoin(condition=[=($0, $6)], joinType=[inner])
    :  :- LogicalJoin(condition=[=($0, $3)], joinType=[inner])
-   :  :  :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
-   :  :  +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
-   :  +- LogicalTableScan(table=[[t1, source: [TestTableSource(a1, b1, c1)]]])
-   +- LogicalTableScan(table=[[t2, source: [TestTableSource(d1, e1, f1)]]])
+   :  :  :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
+   :  :  +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
+   :  +- LogicalTableScan(table=[[default_catalog, default_database, t1, source: [TestTableSource(a1, b1, c1)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, t2, source: [TestTableSource(d1, e1, f1)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -252,13 +252,13 @@ SortMergeJoin(joinType=[LeftOuterJoin], where=[=(a, d1)], select=[a, b, c, d, e,
 :- SortMergeJoin(joinType=[InnerJoin], where=[=(a, a1)], select=[a, b, c, d, e, f, a1, b1, c1], leftSorted=[true])
 :  :- SortMergeJoin(joinType=[InnerJoin], where=[=(a, d)], select=[a, b, c, d, e, f])
 :  :  :- Exchange(distribution=[hash[a]])
-:  :  :  +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+:  :  :  +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 :  :  +- Exchange(distribution=[hash[d]])
-:  :     +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+:  :     +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 :  +- Exchange(distribution=[hash[a1]])
-:     +- TableSourceScan(table=[[t1, source: [TestTableSource(a1, b1, c1)]]], fields=[a1, b1, c1])
+:     +- TableSourceScan(table=[[default_catalog, default_database, t1, source: [TestTableSource(a1, b1, c1)]]], fields=[a1, b1, c1])
 +- Exchange(distribution=[hash[d1]])
-   +- TableSourceScan(table=[[t2, source: [TestTableSource(d1, e1, f1)]]], fields=[d1, e1, f1])
+   +- TableSourceScan(table=[[default_catalog, default_database, t2, source: [TestTableSource(d1, e1, f1)]]], fields=[d1, e1, f1])
 ]]>
     </Resource>
   </TestCase>
@@ -277,10 +277,10 @@ LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5], a1=[$6], b1=[$7],
 +- LogicalJoin(condition=[=($6, $9)], joinType=[left])
    :- LogicalJoin(condition=[=($3, $6)], joinType=[inner])
    :  :- LogicalJoin(condition=[=($0, $3)], joinType=[inner])
-   :  :  :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
-   :  :  +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
-   :  +- LogicalTableScan(table=[[t1, source: [TestTableSource(a1, b1, c1)]]])
-   +- LogicalTableScan(table=[[t2, source: [TestTableSource(d1, e1, f1)]]])
+   :  :  :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
+   :  :  +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
+   :  +- LogicalTableScan(table=[[default_catalog, default_database, t1, source: [TestTableSource(a1, b1, c1)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, t2, source: [TestTableSource(d1, e1, f1)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -289,13 +289,13 @@ SortMergeJoin(joinType=[LeftOuterJoin], where=[=(a1, d1)], select=[a, b, c, d, e
 :- SortMergeJoin(joinType=[InnerJoin], where=[=(d, a1)], select=[a, b, c, d, e, f, a1, b1, c1], leftSorted=[true])
 :  :- SortMergeJoin(joinType=[InnerJoin], where=[=(a, d)], select=[a, b, c, d, e, f])
 :  :  :- Exchange(distribution=[hash[a]])
-:  :  :  +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+:  :  :  +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 :  :  +- Exchange(distribution=[hash[d]])
-:  :     +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+:  :     +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 :  +- Exchange(distribution=[hash[a1]])
-:     +- TableSourceScan(table=[[t1, source: [TestTableSource(a1, b1, c1)]]], fields=[a1, b1, c1])
+:     +- TableSourceScan(table=[[default_catalog, default_database, t1, source: [TestTableSource(a1, b1, c1)]]], fields=[a1, b1, c1])
 +- Exchange(distribution=[hash[d1]])
-   +- TableSourceScan(table=[[t2, source: [TestTableSource(d1, e1, f1)]]], fields=[d1, e1, f1])
+   +- TableSourceScan(table=[[default_catalog, default_database, t2, source: [TestTableSource(d1, e1, f1)]]], fields=[d1, e1, f1])
 ]]>
     </Resource>
   </TestCase>
@@ -348,25 +348,25 @@ LogicalProject(id=[$0], tb2_ids=[$2], tb3_ids=[$3], name=[$4], tb2_names=[$6], t
    :- LogicalJoin(condition=[=($1, $9)], joinType=[left])
    :  :- LogicalJoin(condition=[=($0, $7)], joinType=[left])
    :  :  :- LogicalJoin(condition=[=($0, $5)], joinType=[left])
-   :  :  :  :- LogicalTableScan(table=[[tb1, source: [TestTableSource(id, key, tb2_ids, tb3_ids, name)]]])
+   :  :  :  :- LogicalTableScan(table=[[default_catalog, default_database, tb1, source: [TestTableSource(id, key, tb2_ids, tb3_ids, name)]]])
    :  :  :  +- LogicalAggregate(group=[{0}], tb2_names=[CONCAT_AGG($1, $2)])
    :  :  :     +- LogicalProject(tb1_id=[$0], tb2_name=[$3], $f2=[_UTF-16LE','])
    :  :  :        +- LogicalJoin(condition=[=($1, $2)], joinType=[left])
    :  :  :           :- LogicalProject(id=[$0], tb2_id=[$5])
    :  :  :           :  +- LogicalCorrelate(correlation=[$cor0], joinType=[inner], requiredColumns=[{2}])
-   :  :  :           :     :- LogicalTableScan(table=[[tb1, source: [TestTableSource(id, key, tb2_ids, tb3_ids, name)]]])
+   :  :  :           :     :- LogicalTableScan(table=[[default_catalog, default_database, tb1, source: [TestTableSource(id, key, tb2_ids, tb3_ids, name)]]])
    :  :  :           :     +- LogicalTableFunctionScan(invocation=[split($cor0.tb2_ids)], rowType=[RecordType(VARCHAR(2147483647) f0)], elementType=[class [Ljava.lang.Object;])
-   :  :  :           +- LogicalTableScan(table=[[tb2, source: [TestTableSource(id, name)]]])
+   :  :  :           +- LogicalTableScan(table=[[default_catalog, default_database, tb2, source: [TestTableSource(id, name)]]])
    :  :  +- LogicalAggregate(group=[{0}], tb3_names=[CONCAT_AGG($1, $2)])
    :  :     +- LogicalProject(tb1_id=[$0], tb3_name=[$3], $f2=[_UTF-16LE','])
    :  :        +- LogicalJoin(condition=[=($1, $2)], joinType=[left])
    :  :           :- LogicalProject(id=[$0], tb3_id=[$5])
    :  :           :  +- LogicalCorrelate(correlation=[$cor1], joinType=[inner], requiredColumns=[{3}])
-   :  :           :     :- LogicalTableScan(table=[[tb1, source: [TestTableSource(id, key, tb2_ids, tb3_ids, name)]]])
+   :  :           :     :- LogicalTableScan(table=[[default_catalog, default_database, tb1, source: [TestTableSource(id, key, tb2_ids, tb3_ids, name)]]])
    :  :           :     +- LogicalTableFunctionScan(invocation=[split($cor1.tb3_ids)], rowType=[RecordType(VARCHAR(2147483647) f0)], elementType=[class [Ljava.lang.Object;])
-   :  :           +- LogicalTableScan(table=[[tb3, source: [TestTableSource(id, name)]]])
-   :  +- LogicalTableScan(table=[[tb4, source: [TestTableSource(id, name)]]])
-   +- LogicalTableScan(table=[[tb5, source: [TestTableSource(id, name)]]])
+   :  :           +- LogicalTableScan(table=[[default_catalog, default_database, tb3, source: [TestTableSource(id, name)]]])
+   :  +- LogicalTableScan(table=[[default_catalog, default_database, tb4, source: [TestTableSource(id, name)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, tb5, source: [TestTableSource(id, name)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -381,7 +381,7 @@ Calc(select=[id, tb2_ids, tb3_ids, name, tb2_names, tb3_names, name0, name1])
    :     :        :- Calc(select=[id, key, tb2_ids, tb3_ids, name, tb2_names])
    :     :        :  +- SortMergeJoin(joinType=[LeftOuterJoin], where=[=(id, tb1_id)], select=[id, key, tb2_ids, tb3_ids, name, tb1_id, tb2_names], rightSorted=[true])
    :     :        :     :- Exchange(distribution=[hash[id]])
-   :     :        :     :  +- TableSourceScan(table=[[tb1, source: [TestTableSource(id, key, tb2_ids, tb3_ids, name)]]], fields=[id, key, tb2_ids, tb3_ids, name], reuse_id=[1])
+   :     :        :     :  +- TableSourceScan(table=[[default_catalog, default_database, tb1, source: [TestTableSource(id, key, tb2_ids, tb3_ids, name)]]], fields=[id, key, tb2_ids, tb3_ids, name], reuse_id=[1])
    :     :        :     +- SortAggregate(isMerge=[true], groupBy=[tb1_id], select=[tb1_id, Final_CONCAT_AGG(accDelimiter$0, concatAcc$1) AS tb2_names])
    :     :        :        +- Sort(orderBy=[tb1_id ASC])
    :     :        :           +- Exchange(distribution=[hash[tb1_id]])
@@ -394,7 +394,7 @@ Calc(select=[id, tb2_ids, tb3_ids, name, tb2_names, tb3_names, name0, name1])
    :     :        :                          :     +- Correlate(invocation=[split($cor0.tb2_ids)], correlate=[table(split($cor0.tb2_ids))], select=[id,key,tb2_ids,tb3_ids,name,f0], rowType=[RecordType(VARCHAR(2147483647) id, VARCHAR(2147483647) key, VARCHAR(2147483647) tb2_ids, VARCHAR(2147483647) tb3_ids, VARCHAR(2147483647) name, VARCHAR(2147483647) f0)], joinType=[INNER])
    :     :        :                          :        +- Reused(reference_id=[1])
    :     :        :                          +- Exchange(distribution=[hash[id]])
-   :     :        :                             +- TableSourceScan(table=[[tb2, source: [TestTableSource(id, name)]]], fields=[id, name])
+   :     :        :                             +- TableSourceScan(table=[[default_catalog, default_database, tb2, source: [TestTableSource(id, name)]]], fields=[id, name])
    :     :        +- SortAggregate(isMerge=[true], groupBy=[tb1_id], select=[tb1_id, Final_CONCAT_AGG(accDelimiter$0, concatAcc$1) AS tb3_names])
    :     :           +- Sort(orderBy=[tb1_id ASC])
    :     :              +- Exchange(distribution=[hash[tb1_id]])
@@ -407,11 +407,11 @@ Calc(select=[id, tb2_ids, tb3_ids, name, tb2_names, tb3_names, name0, name1])
    :     :                             :     +- Correlate(invocation=[split($cor1.tb3_ids)], correlate=[table(split($cor1.tb3_ids))], select=[id,key,tb2_ids,tb3_ids,name,f0], rowType=[RecordType(VARCHAR(2147483647) id, VARCHAR(2147483647) key, VARCHAR(2147483647) tb2_ids, VARCHAR(2147483647) tb3_ids, VARCHAR(2147483647) name, VARCHAR(2147483647) f0)], joinType=[INNER])
    :     :                             :        +- Reused(reference_id=[1])
    :     :                             +- Exchange(distribution=[hash[id]])
-   :     :                                +- TableSourceScan(table=[[tb3, source: [TestTableSource(id, name)]]], fields=[id, name])
+   :     :                                +- TableSourceScan(table=[[default_catalog, default_database, tb3, source: [TestTableSource(id, name)]]], fields=[id, name])
    :     +- Exchange(distribution=[hash[id]])
-   :        +- TableSourceScan(table=[[tb4, source: [TestTableSource(id, name)]]], fields=[id, name])
+   :        +- TableSourceScan(table=[[default_catalog, default_database, tb4, source: [TestTableSource(id, name)]]], fields=[id, name])
    +- Exchange(distribution=[hash[id]])
-      +- TableSourceScan(table=[[tb5, source: [TestTableSource(id, name)]]], fields=[id, name])
+      +- TableSourceScan(table=[[default_catalog, default_database, tb5, source: [TestTableSource(id, name)]]], fields=[id, name])
 ]]>
     </Resource>
   </TestCase>
@@ -430,10 +430,10 @@ LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5], a1=[$6], b1=[$7],
 +- LogicalJoin(condition=[AND(=($0, $9), =($1, $10))], joinType=[left])
    :- LogicalJoin(condition=[AND(=($0, $6), =($1, $7))], joinType=[inner])
    :  :- LogicalJoin(condition=[AND(=($0, $3), =($1, $4))], joinType=[inner])
-   :  :  :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
-   :  :  +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
-   :  +- LogicalTableScan(table=[[t1, source: [TestTableSource(a1, b1, c1)]]])
-   +- LogicalTableScan(table=[[t2, source: [TestTableSource(d1, e1, f1)]]])
+   :  :  :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
+   :  :  +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
+   :  +- LogicalTableScan(table=[[default_catalog, default_database, t1, source: [TestTableSource(a1, b1, c1)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, t2, source: [TestTableSource(d1, e1, f1)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -442,13 +442,13 @@ SortMergeJoin(joinType=[LeftOuterJoin], where=[AND(=(a, d1), =(b, e1))], select=
 :- SortMergeJoin(joinType=[InnerJoin], where=[AND(=(a, a1), =(b, b1))], select=[a, b, c, d, e, f, a1, b1, c1], leftSorted=[true])
 :  :- SortMergeJoin(joinType=[InnerJoin], where=[AND(=(a, d), =(b, e))], select=[a, b, c, d, e, f])
 :  :  :- Exchange(distribution=[hash[a, b]])
-:  :  :  +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+:  :  :  +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 :  :  +- Exchange(distribution=[hash[d, e]])
-:  :     +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+:  :     +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 :  +- Exchange(distribution=[hash[a1, b1]])
-:     +- TableSourceScan(table=[[t1, source: [TestTableSource(a1, b1, c1)]]], fields=[a1, b1, c1])
+:     +- TableSourceScan(table=[[default_catalog, default_database, t1, source: [TestTableSource(a1, b1, c1)]]], fields=[a1, b1, c1])
 +- Exchange(distribution=[hash[d1, e1]])
-   +- TableSourceScan(table=[[t2, source: [TestTableSource(d1, e1, f1)]]], fields=[d1, e1, f1])
+   +- TableSourceScan(table=[[default_catalog, default_database, t2, source: [TestTableSource(d1, e1, f1)]]], fields=[d1, e1, f1])
 ]]>
     </Resource>
   </TestCase>
@@ -467,10 +467,10 @@ LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5], a1=[$6], b1=[$7],
 +- LogicalJoin(condition=[AND(=($6, $9), =($7, $10))], joinType=[left])
    :- LogicalJoin(condition=[AND(=($3, $6), =($4, $7))], joinType=[inner])
    :  :- LogicalJoin(condition=[AND(=($0, $3), =($1, $4))], joinType=[inner])
-   :  :  :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
-   :  :  +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
-   :  +- LogicalTableScan(table=[[t1, source: [TestTableSource(a1, b1, c1)]]])
-   +- LogicalTableScan(table=[[t2, source: [TestTableSource(d1, e1, f1)]]])
+   :  :  :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
+   :  :  +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
+   :  +- LogicalTableScan(table=[[default_catalog, default_database, t1, source: [TestTableSource(a1, b1, c1)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, t2, source: [TestTableSource(d1, e1, f1)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -479,13 +479,13 @@ SortMergeJoin(joinType=[LeftOuterJoin], where=[AND(=(a1, d1), =(b1, e1))], selec
 :- SortMergeJoin(joinType=[InnerJoin], where=[AND(=(d, a1), =(e, b1))], select=[a, b, c, d, e, f, a1, b1, c1], leftSorted=[true])
 :  :- SortMergeJoin(joinType=[InnerJoin], where=[AND(=(a, d), =(b, e))], select=[a, b, c, d, e, f])
 :  :  :- Exchange(distribution=[hash[a, b]])
-:  :  :  +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+:  :  :  +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 :  :  +- Exchange(distribution=[hash[d, e]])
-:  :     +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+:  :     +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 :  +- Exchange(distribution=[hash[a1, b1]])
-:     +- TableSourceScan(table=[[t1, source: [TestTableSource(a1, b1, c1)]]], fields=[a1, b1, c1])
+:     +- TableSourceScan(table=[[default_catalog, default_database, t1, source: [TestTableSource(a1, b1, c1)]]], fields=[a1, b1, c1])
 +- Exchange(distribution=[hash[d1, e1]])
-   +- TableSourceScan(table=[[t2, source: [TestTableSource(d1, e1, f1)]]], fields=[d1, e1, f1])
+   +- TableSourceScan(table=[[default_catalog, default_database, t2, source: [TestTableSource(d1, e1, f1)]]], fields=[d1, e1, f1])
 ]]>
     </Resource>
   </TestCase>
@@ -505,7 +505,7 @@ SortMergeJoin(joinType=[LeftOuterJoin], where=[AND(=(a1, d1), =(b1, e1))], selec
 LogicalProject(sum_b=[$1], avg_b=[/(CAST(CASE(>(COUNT($1) OVER (PARTITION BY $0 ORDER BY $0 NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW), 0), $SUM0($1) OVER (PARTITION BY $0 ORDER BY $0 NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW), null:BIGINT)):DOUBLE, COUNT($1) OVER (PARTITION BY $0 ORDER BY $0 NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW))], rn=[RANK() OVER (PARTITION BY $0 ORDER BY $0 NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING A [...]
 +- LogicalAggregate(group=[{0}], sum_b=[SUM($1)])
    +- LogicalProject(a=[$0], b=[$1])
-      +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -518,7 +518,7 @@ Calc(select=[sum_b, /(CAST(CASE(>(w0$o0, 0:BIGINT), w0$o1, null:BIGINT)), w0$o0)
             +- LocalSortAggregate(groupBy=[a], select=[a, Partial_SUM(b) AS sum$0])
                +- Sort(orderBy=[a ASC])
                   +- Calc(select=[a, b])
-                     +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+                     +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -534,7 +534,7 @@ SELECT * FROM r ORDER BY a
 LogicalSort(sort0=[$0], dir0=[ASC-nulls-first])
 +- LogicalProject(a=[$0], b=[$1], cnt=[$2])
    +- LogicalAggregate(group=[{0, 1}], cnt=[COUNT($2)])
-      +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -544,7 +544,7 @@ Sort(orderBy=[a ASC])
    +- HashAggregate(isMerge=[true], groupBy=[a, b], select=[a, b, Final_COUNT(count$0) AS cnt])
       +- Exchange(distribution=[hash[a, b]])
          +- LocalHashAggregate(groupBy=[a, b], select=[a, b, Partial_COUNT(c) AS count$0])
-            +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+            +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -564,7 +564,7 @@ LogicalAggregate(group=[{0}], EXPR$1=[SUM($1)])
 +- LogicalProject(a=[$0], b=[$1])
    +- LogicalFilter(condition=[<=($2, 10)])
       +- LogicalProject(a=[$0], b=[$1], rk=[RANK() OVER (PARTITION BY $0 ORDER BY $1 NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)])
-         +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+         +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -576,7 +576,7 @@ SortAggregate(isMerge=[false], groupBy=[a], select=[a, SUM(b) AS EXPR$1])
          +- Exchange(distribution=[hash[a]])
             +- Rank(rankType=[RANK], rankRange=[rankStart=1, rankEnd=10], partitionBy=[a], orderBy=[b ASC], global=[false], select=[a, b, c])
                +- Sort(orderBy=[a ASC, b ASC])
-                  +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+                  +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -596,7 +596,7 @@ LogicalAggregate(group=[{0, 1}], EXPR$2=[MAX($2)])
 +- LogicalProject(a=[$0], b=[$1], c=[$2])
    +- LogicalFilter(condition=[<=($3, 10)])
       +- LogicalProject(a=[$0], b=[$1], c=[$2], rk=[RANK() OVER (PARTITION BY $0 ORDER BY $1 NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)])
-         +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+         +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -607,7 +607,7 @@ SortAggregate(isMerge=[false], groupBy=[a, b], select=[a, b, MAX(c) AS EXPR$2])
       +- Exchange(distribution=[hash[a]])
          +- Rank(rankType=[RANK], rankRange=[rankStart=1, rankEnd=10], partitionBy=[a], orderBy=[b ASC], global=[false], select=[a, b, c])
             +- Sort(orderBy=[a ASC, b ASC])
-               +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+               +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -626,7 +626,7 @@ SELECT * FROM (
 LogicalProject(a=[$0], b=[$1], c=[$2], rk=[$3])
 +- LogicalFilter(condition=[<=($3, 10)])
    +- LogicalProject(a=[$0], b=[$1], c=[$2], rk=[RANK() OVER (PARTITION BY $0 ORDER BY $1 NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)])
-      +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -636,7 +636,7 @@ Rank(rankType=[RANK], rankRange=[rankStart=1, rankEnd=10], partitionBy=[a], orde
    +- Exchange(distribution=[hash[a]])
       +- Rank(rankType=[RANK], rankRange=[rankStart=1, rankEnd=10], partitionBy=[a], orderBy=[b ASC], global=[false], select=[a, b, c])
          +- Sort(orderBy=[a ASC, b ASC])
-            +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+            +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -657,7 +657,7 @@ LogicalProject(a=[$0], c=[$1], rk=[$2])
    +- LogicalProject(a=[$0], c=[$1], rk=[RANK() OVER (PARTITION BY $0 ORDER BY $0 NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)])
       +- LogicalAggregate(group=[{0}], c=[COUNT($1)])
          +- LogicalProject(a=[$0], c=[$2])
-            +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+            +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -669,7 +669,7 @@ Rank(rankType=[RANK], rankRange=[rankStart=1, rankEnd=10], partitionBy=[a], orde
          +- LocalSortAggregate(groupBy=[a], select=[a, Partial_COUNT(c) AS count$0])
             +- Sort(orderBy=[a ASC])
                +- Calc(select=[a, c])
-                  +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+                  +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -689,7 +689,7 @@ LogicalAggregate(group=[{}], EXPR$0=[COUNT($0)], EXPR$1=[SUM($1)])
 +- LogicalProject(a=[$0], b=[$1])
    +- LogicalFilter(condition=[<=($2, 10)])
       +- LogicalProject(a=[$0], b=[$1], rk=[RANK() OVER (ORDER BY $1 NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)])
-         +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+         +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -701,7 +701,7 @@ SortAggregate(isMerge=[false], select=[COUNT(a) AS EXPR$0, SUM(b) AS EXPR$1])
          +- Exchange(distribution=[single])
             +- Rank(rankType=[RANK], rankRange=[rankStart=1, rankEnd=10], partitionBy=[], orderBy=[b ASC], global=[false], select=[a, b, c])
                +- Sort(orderBy=[b ASC])
-                  +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+                  +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
diff --git a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/RemoveShuffleTest.xml b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/RemoveShuffleTest.xml
index 3107794..60ca0ec 100644
--- a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/RemoveShuffleTest.xml
+++ b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/RemoveShuffleTest.xml
@@ -30,7 +30,7 @@ LogicalProject(EXPR$0=[$1])
    +- LogicalProject(c=[$1], cnt=[$2])
       +- LogicalAggregate(group=[{0, 1}], cnt=[COUNT($2)])
          +- LogicalProject(a=[$0], c=[$2], b=[$1])
-            +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+            +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -41,7 +41,7 @@ Calc(select=[EXPR$0])
       +- HashAggregate(isMerge=[true], groupBy=[a, c], select=[a, c, Final_COUNT(count$0) AS cnt])
          +- Exchange(distribution=[hash[c]])
             +- LocalHashAggregate(groupBy=[a, c], select=[a, c, Partial_COUNT(b) AS count$0])
-               +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+               +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -60,13 +60,13 @@ LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5], a0=[$6], b0=[$7],
       :- LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5])
       :  +- LogicalFilter(condition=[AND(=($0, $3), LIKE($2, _UTF-16LE'He%'))])
       :     +- LogicalJoin(condition=[true], joinType=[inner])
-      :        :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
-      :        +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+      :        :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
+      :        +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
       +- LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5])
          +- LogicalFilter(condition=[AND(=($0, $3), LIKE($2, _UTF-16LE'He%'))])
             +- LogicalJoin(condition=[true], joinType=[inner])
-               :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
-               +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+               :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
+               +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -75,14 +75,14 @@ HashJoin(joinType=[InnerJoin], where=[=(a, d0)], select=[a, b, c, d, e, f, a0, b
 :- HashJoin(joinType=[InnerJoin], where=[=(a, d)], select=[a, b, c, d, e, f], isBroadcast=[true], build=[left])
 :  :- Exchange(distribution=[broadcast])
 :  :  +- Calc(select=[a, b, c], where=[LIKE(c, _UTF-16LE'He%')])
-:  :     +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
-:  +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+:  :     +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+:  +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 +- Exchange(distribution=[broadcast])
    +- HashJoin(joinType=[InnerJoin], where=[=(a, d)], select=[a, b, c, d, e, f], isBroadcast=[true], build=[left])
       :- Exchange(distribution=[broadcast])
       :  +- Calc(select=[a, b, c], where=[LIKE(c, _UTF-16LE'He%')])
-      :     +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
-      +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+      :     +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+      +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 ]]>
     </Resource>
   </TestCase>
@@ -99,12 +99,12 @@ SELECT * FROM x, v WHERE c = f
 LogicalProject(a=[$0], b=[$1], c=[$2], f1=[$3], f=[$4], cnt=[$5])
 +- LogicalFilter(condition=[=($2, $4)])
    +- LogicalJoin(condition=[true], joinType=[inner])
-      :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+      :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
       +- LogicalProject(f1=[$2], f=[$0], cnt=[$1])
          +- LogicalCorrelate(correlation=[$cor0], joinType=[inner], requiredColumns=[{0}])
             :- LogicalAggregate(group=[{0}], cnt=[COUNT($0)])
             :  +- LogicalProject(f=[$2])
-            :     +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+            :     +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
             +- LogicalTableFunctionScan(invocation=[split($cor0.f)], rowType=[RecordType(VARCHAR(2147483647) f0)], elementType=[class [Ljava.lang.Object;])
 ]]>
     </Resource>
@@ -112,14 +112,14 @@ LogicalProject(a=[$0], b=[$1], c=[$2], f1=[$3], f=[$4], cnt=[$5])
       <![CDATA[
 HashJoin(joinType=[InnerJoin], where=[=(c, f)], select=[a, b, c, f1, f, cnt], build=[right])
 :- Exchange(distribution=[hash[c]])
-:  +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+:  +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 +- Calc(select=[f0 AS f1, f, cnt])
    +- Correlate(invocation=[split($cor0.f)], correlate=[table(split($cor0.f))], select=[f,cnt,f0], rowType=[RecordType(VARCHAR(2147483647) f, BIGINT cnt, VARCHAR(2147483647) f0)], joinType=[INNER])
       +- HashAggregate(isMerge=[true], groupBy=[f], select=[f, Final_COUNT(count$0) AS cnt])
          +- Exchange(distribution=[hash[f]])
             +- LocalHashAggregate(groupBy=[f], select=[f, Partial_COUNT(f) AS count$0])
                +- Calc(select=[f])
-                  +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+                  +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 ]]>
     </Resource>
   </TestCase>
@@ -136,12 +136,12 @@ SELECT * FROM x, v WHERE c = f AND f LIKE '%llo%'
 LogicalProject(a=[$0], b=[$1], c=[$2], f=[$3], f1=[$4])
 +- LogicalFilter(condition=[AND(=($2, $3), LIKE($3, _UTF-16LE'%llo%'))])
    +- LogicalJoin(condition=[true], joinType=[inner])
-      :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+      :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
       +- LogicalProject(f=[$0], f1=[$2])
          +- LogicalCorrelate(correlation=[$cor0], joinType=[inner], requiredColumns=[{0}])
             :- LogicalAggregate(group=[{0}], cnt=[COUNT($0)])
             :  +- LogicalProject(f=[$2])
-            :     +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+            :     +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
             +- LogicalTableFunctionScan(invocation=[split($cor0.f)], rowType=[RecordType(VARCHAR(2147483647) f0)], elementType=[class [Ljava.lang.Object;])
 ]]>
     </Resource>
@@ -149,14 +149,14 @@ LogicalProject(a=[$0], b=[$1], c=[$2], f=[$3], f1=[$4])
       <![CDATA[
 HashJoin(joinType=[InnerJoin], where=[=(c, f)], select=[a, b, c, f, f1], build=[right])
 :- Exchange(distribution=[hash[c]])
-:  +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+:  +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 +- Calc(select=[f, f0 AS f1])
    +- Correlate(invocation=[split($cor0.f)], correlate=[table(split($cor0.f))], select=[f,cnt,f0], rowType=[RecordType(VARCHAR(2147483647) f, BIGINT cnt, VARCHAR(2147483647) f0)], joinType=[INNER])
       +- HashAggregate(isMerge=[true], groupBy=[f], select=[f, Final_COUNT(count$0) AS cnt])
          +- Exchange(distribution=[hash[f]])
             +- LocalHashAggregate(groupBy=[f], select=[f, Partial_COUNT(f) AS count$0])
                +- Calc(select=[f], where=[LIKE(f, _UTF-16LE'%llo%')])
-                  +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+                  +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 ]]>
     </Resource>
   </TestCase>
@@ -173,12 +173,12 @@ SELECT * FROM x, v WHERE c = f1
 LogicalProject(a=[$0], b=[$1], c=[$2], f1=[$3])
 +- LogicalFilter(condition=[=($2, $3)])
    +- LogicalJoin(condition=[true], joinType=[inner])
-      :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+      :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
       +- LogicalProject(f1=[$2])
          +- LogicalCorrelate(correlation=[$cor0], joinType=[inner], requiredColumns=[{0}])
             :- LogicalAggregate(group=[{0}], cnt=[COUNT($0)])
             :  +- LogicalProject(f=[$2])
-            :     +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+            :     +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
             +- LogicalTableFunctionScan(invocation=[split($cor0.f)], rowType=[RecordType(VARCHAR(2147483647) f0)], elementType=[class [Ljava.lang.Object;])
 ]]>
     </Resource>
@@ -186,7 +186,7 @@ LogicalProject(a=[$0], b=[$1], c=[$2], f1=[$3])
       <![CDATA[
 HashJoin(joinType=[InnerJoin], where=[=(c, f1)], select=[a, b, c, f1], build=[right])
 :- Exchange(distribution=[hash[c]])
-:  +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+:  +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 +- Exchange(distribution=[hash[f1]])
    +- Calc(select=[f0 AS f1])
       +- Correlate(invocation=[split($cor0.f)], correlate=[table(split($cor0.f))], select=[f,cnt,f0], rowType=[RecordType(VARCHAR(2147483647) f, BIGINT cnt, VARCHAR(2147483647) f0)], joinType=[INNER])
@@ -194,7 +194,7 @@ HashJoin(joinType=[InnerJoin], where=[=(c, f1)], select=[a, b, c, f1], build=[ri
             +- Exchange(distribution=[hash[f]])
                +- LocalHashAggregate(groupBy=[f], select=[f, Partial_COUNT(f) AS count$0])
                   +- Calc(select=[f])
-                     +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+                     +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 ]]>
     </Resource>
   </TestCase>
@@ -212,8 +212,8 @@ LogicalProject(EXPR$0=[$1])
    +- LogicalProject(a=[$0], b=[$1])
       +- LogicalFilter(condition=[AND(=($0, $3), LIKE($2, _UTF-16LE'He%'))])
          +- LogicalJoin(condition=[true], joinType=[inner])
-            :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
-            +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+            :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
+            +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -224,10 +224,10 @@ Calc(select=[EXPR$0])
       +- HashJoin(joinType=[InnerJoin], where=[=(a, d)], select=[a, b, d], build=[left])
          :- Exchange(distribution=[hash[a]])
          :  +- Calc(select=[a, b], where=[LIKE(c, _UTF-16LE'He%')])
-         :     +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+         :     +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
          +- Exchange(distribution=[hash[d]])
             +- Calc(select=[d])
-               +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+               +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 ]]>
     </Resource>
   </TestCase>
@@ -245,8 +245,8 @@ LogicalProject(EXPR$0=[$2])
    +- LogicalProject(a=[$0], d=[$3], b=[$1])
       +- LogicalFilter(condition=[AND(=($0, $3), LIKE($2, _UTF-16LE'He%'))])
          +- LogicalJoin(condition=[true], joinType=[inner])
-            :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
-            +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+            :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
+            +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -256,10 +256,10 @@ Calc(select=[EXPR$0])
    +- HashJoin(joinType=[InnerJoin], where=[=(a, d)], select=[a, b, d], build=[left])
       :- Exchange(distribution=[hash[a]])
       :  +- Calc(select=[a, b], where=[LIKE(c, _UTF-16LE'He%')])
-      :     +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+      :     +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
       +- Exchange(distribution=[hash[d]])
          +- Calc(select=[d])
-            +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+            +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 ]]>
     </Resource>
   </TestCase>
@@ -277,8 +277,8 @@ LogicalProject(EXPR$0=[$1])
    +- LogicalProject(d=[$3], b=[$1])
       +- LogicalFilter(condition=[AND(=($0, $3), LIKE($2, _UTF-16LE'He%'))])
          +- LogicalJoin(condition=[true], joinType=[inner])
-            :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
-            +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+            :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
+            +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -289,10 +289,10 @@ Calc(select=[EXPR$0])
       +- HashJoin(joinType=[InnerJoin], where=[=(a, d)], select=[a, b, d], build=[left])
          :- Exchange(distribution=[hash[a]])
          :  +- Calc(select=[a, b], where=[LIKE(c, _UTF-16LE'He%')])
-         :     +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+         :     +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
          +- Exchange(distribution=[hash[d]])
             +- Calc(select=[d])
-               +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+               +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 ]]>
     </Resource>
   </TestCase>
@@ -311,13 +311,13 @@ LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5], a0=[$6], b0=[$7],
       :- LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5])
       :  +- LogicalFilter(condition=[AND(=($0, $3), LIKE($2, _UTF-16LE'He%'))])
       :     +- LogicalJoin(condition=[true], joinType=[inner])
-      :        :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
-      :        +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+      :        :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
+      :        +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
       +- LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5])
          +- LogicalFilter(condition=[AND(=($0, $3), LIKE($2, _UTF-16LE'He%'))])
             +- LogicalJoin(condition=[true], joinType=[inner])
-               :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
-               +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+               :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
+               +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -326,15 +326,15 @@ HashJoin(joinType=[InnerJoin], where=[=(a, d0)], select=[a, b, c, d, e, f, a0, b
 :- HashJoin(joinType=[InnerJoin], where=[=(a, d)], select=[a, b, c, d, e, f], build=[left])
 :  :- Exchange(distribution=[hash[a]])
 :  :  +- Calc(select=[a, b, c], where=[LIKE(c, _UTF-16LE'He%')])
-:  :     +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+:  :     +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 :  +- Exchange(distribution=[hash[d]])
-:     +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+:     +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 +- HashJoin(joinType=[InnerJoin], where=[=(a, d)], select=[a, b, c, d, e, f], build=[left])
    :- Exchange(distribution=[hash[a]])
    :  +- Calc(select=[a, b, c], where=[LIKE(c, _UTF-16LE'He%')])
-   :     +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+   :     +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
    +- Exchange(distribution=[hash[d]])
-      +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+      +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 ]]>
     </Resource>
   </TestCase>
@@ -353,10 +353,10 @@ LogicalProject(a=[$0], c=[$1], EXPR$2=[$2], a0=[$3], c0=[$4], EXPR$20=[$5])
    +- LogicalJoin(condition=[true], joinType=[inner])
       :- LogicalAggregate(group=[{0, 1}], EXPR$2=[SUM($2)])
       :  +- LogicalProject(a=[$0], c=[$2], b=[$1])
-      :     +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+      :     +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
       +- LogicalAggregate(group=[{0, 1}], EXPR$2=[SUM($2)])
          +- LogicalProject(a=[$0], c=[$2], b=[$1])
-            +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+            +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -365,11 +365,11 @@ HashJoin(joinType=[InnerJoin], where=[AND(=(a, a0), =(c, c0))], select=[a, c, EX
 :- HashAggregate(isMerge=[true], groupBy=[a, c], select=[a, c, Final_SUM(sum$0) AS EXPR$2])
 :  +- Exchange(distribution=[hash[a, c]])
 :     +- LocalHashAggregate(groupBy=[a, c], select=[a, c, Partial_SUM(b) AS sum$0])
-:        +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+:        +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 +- HashAggregate(isMerge=[true], groupBy=[a, c], select=[a, c, Final_SUM(sum$0) AS EXPR$2])
    +- Exchange(distribution=[hash[a, c]])
       +- LocalHashAggregate(groupBy=[a, c], select=[a, c, Partial_SUM(b) AS sum$0])
-         +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+         +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -387,16 +387,16 @@ LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5], a0=[$6], b0=[$7],
    +- LogicalJoin(condition=[true], joinType=[inner])
       :- LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5])
       :  +- LogicalJoin(condition=[=($0, $3)], joinType=[full])
-      :     :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+      :     :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
       :     +- LogicalProject(d=[$0], e=[$1], f=[$2])
       :        +- LogicalFilter(condition=[=($1, 2)])
-      :           +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+      :           +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
       +- LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5])
          +- LogicalJoin(condition=[=($0, $3)], joinType=[full])
-            :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+            :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
             +- LogicalProject(d=[$0], e=[$1], f=[$2])
                +- LogicalFilter(condition=[=($1, 2)])
-                  +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+                  +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -405,17 +405,17 @@ HashJoin(joinType=[InnerJoin], where=[=(a, d0)], select=[a, b, c, d, e, f, a0, b
 :- Exchange(distribution=[hash[a]])
 :  +- HashJoin(joinType=[FullOuterJoin], where=[=(a, d)], select=[a, b, c, d, e, f], build=[right])
 :     :- Exchange(distribution=[hash[a]])
-:     :  +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+:     :  +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 :     +- Exchange(distribution=[hash[d]])
 :        +- Calc(select=[d, CAST(2:BIGINT) AS e, f], where=[=(e, 2:BIGINT)])
-:           +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+:           +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 +- Exchange(distribution=[hash[d]])
    +- HashJoin(joinType=[FullOuterJoin], where=[=(a, d)], select=[a, b, c, d, e, f], build=[right])
       :- Exchange(distribution=[hash[a]])
-      :  +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+      :  +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
       +- Exchange(distribution=[hash[d]])
          +- Calc(select=[d, CAST(2:BIGINT) AS e, f], where=[=(e, 2:BIGINT)])
-            +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+            +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 ]]>
     </Resource>
   </TestCase>
@@ -433,16 +433,16 @@ LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5], a0=[$6], b0=[$7],
    +- LogicalJoin(condition=[true], joinType=[inner])
       :- LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5])
       :  +- LogicalJoin(condition=[=($0, $3)], joinType=[left])
-      :     :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+      :     :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
       :     +- LogicalProject(d=[$0], e=[$1], f=[$2])
       :        +- LogicalFilter(condition=[=($1, 2)])
-      :           +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+      :           +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
       +- LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5])
          +- LogicalJoin(condition=[=($0, $3)], joinType=[left])
-            :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+            :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
             +- LogicalProject(d=[$0], e=[$1], f=[$2])
                +- LogicalFilter(condition=[=($1, 2)])
-                  +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+                  +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -450,17 +450,17 @@ LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5], a0=[$6], b0=[$7],
 HashJoin(joinType=[InnerJoin], where=[=(a, d0)], select=[a, b, c, d, e, f, a0, b0, c0, d0, e0, f0], build=[right])
 :- HashJoin(joinType=[LeftOuterJoin], where=[=(a, d)], select=[a, b, c, d, e, f], build=[right])
 :  :- Exchange(distribution=[hash[a]])
-:  :  +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+:  :  +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 :  +- Exchange(distribution=[hash[d]])
 :     +- Calc(select=[d, CAST(2:BIGINT) AS e, f], where=[=(e, 2:BIGINT)])
-:        +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+:        +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 +- Exchange(distribution=[hash[d]])
    +- HashJoin(joinType=[LeftOuterJoin], where=[=(a, d)], select=[a, b, c, d, e, f], build=[right])
       :- Exchange(distribution=[hash[a]])
-      :  +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+      :  +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
       +- Exchange(distribution=[hash[d]])
          +- Calc(select=[d, CAST(2:BIGINT) AS e, f], where=[=(e, 2:BIGINT)])
-            +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+            +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 ]]>
     </Resource>
   </TestCase>
@@ -478,16 +478,16 @@ LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5], a0=[$6], b0=[$7],
    +- LogicalJoin(condition=[true], joinType=[inner])
       :- LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5])
       :  +- LogicalJoin(condition=[=($0, $3)], joinType=[right])
-      :     :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+      :     :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
       :     +- LogicalProject(d=[$0], e=[$1], f=[$2])
       :        +- LogicalFilter(condition=[=($1, 2)])
-      :           +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+      :           +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
       +- LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5])
          +- LogicalJoin(condition=[=($0, $3)], joinType=[right])
-            :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+            :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
             +- LogicalProject(d=[$0], e=[$1], f=[$2])
                +- LogicalFilter(condition=[=($1, 2)])
-                  +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+                  +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -496,16 +496,16 @@ HashJoin(joinType=[InnerJoin], where=[=(a, d0)], select=[a, b, c, d, e, f, a0, b
 :- Exchange(distribution=[hash[a]])
 :  +- HashJoin(joinType=[RightOuterJoin], where=[=(a, d)], select=[a, b, c, d, e, f], build=[right])
 :     :- Exchange(distribution=[hash[a]])
-:     :  +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+:     :  +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 :     +- Exchange(distribution=[hash[d]])
 :        +- Calc(select=[d, CAST(2:BIGINT) AS e, f], where=[=(e, 2:BIGINT)])
-:           +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+:           +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 +- HashJoin(joinType=[RightOuterJoin], where=[=(a, d)], select=[a, b, c, d, e, f], build=[right])
    :- Exchange(distribution=[hash[a]])
-   :  +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+   :  +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
    +- Exchange(distribution=[hash[d]])
       +- Calc(select=[d, CAST(2:BIGINT) AS e, f], where=[=(e, 2:BIGINT)])
-         +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+         +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 ]]>
     </Resource>
   </TestCase>
@@ -521,22 +521,22 @@ SELECT * FROM x, r WHERE x.a = r.d AND x.b = r.cnt
 LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], cnt=[$4])
 +- LogicalFilter(condition=[AND(=($0, $3), =($1, $4))])
    +- LogicalJoin(condition=[true], joinType=[inner])
-      :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+      :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
       +- LogicalAggregate(group=[{0}], cnt=[COUNT($1)])
          +- LogicalProject(d=[$0], f=[$2])
-            +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+            +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
 HashJoin(joinType=[InnerJoin], where=[AND(=(a, d), =(b, cnt))], select=[a, b, c, d, cnt], build=[right])
 :- Exchange(distribution=[hash[a]])
-:  +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+:  +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 +- HashAggregate(isMerge=[true], groupBy=[d], select=[d, Final_COUNT(count$0) AS cnt])
    +- Exchange(distribution=[hash[d]])
       +- LocalHashAggregate(groupBy=[d], select=[d, Partial_COUNT(f) AS count$0])
          +- Calc(select=[d, f])
-            +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+            +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 ]]>
     </Resource>
   </TestCase>
@@ -557,7 +557,7 @@ HashJoin(joinType=[InnerJoin], where=[AND(=(a, d), =(b, cnt))], select=[a, b, c,
 LogicalProject(sum_b=[$2], avg_b=[/(CAST(CASE(>(COUNT($2) OVER (PARTITION BY $0, $1 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING), 0), $SUM0($2) OVER (PARTITION BY $0, $1 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING), null:BIGINT)):DOUBLE, COUNT($2) OVER (PARTITION BY $0, $1 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING))], rn=[RANK() OVER (PARTITION BY $1 ORDER BY $0 NULLS FIRST, $1 NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)], c=[$1])
 +- LogicalAggregate(group=[{0, 1}], sum_b=[SUM($2)])
    +- LogicalProject(a=[$0], c=[$2], b=[$1])
-      +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -571,7 +571,7 @@ Calc(select=[sum_b, /(CAST(CASE(>(w0$o0, 0:BIGINT), w0$o1, null:BIGINT)), w0$o0)
                +- HashAggregate(isMerge=[true], groupBy=[a, c], select=[a, c, Final_SUM(sum$0) AS sum_b])
                   +- Exchange(distribution=[hash[a, c]])
                      +- LocalHashAggregate(groupBy=[a, c], select=[a, c, Partial_SUM(b) AS sum$0])
-                        +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+                        +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -590,13 +590,13 @@ LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5], a0=[$6], b0=[$7],
       :- LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5])
       :  +- LogicalFilter(condition=[AND(=($0, $3), LIKE($2, _UTF-16LE'He%'))])
       :     +- LogicalJoin(condition=[true], joinType=[inner])
-      :        :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
-      :        +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+      :        :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
+      :        +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
       +- LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5])
          +- LogicalFilter(condition=[AND(=($0, $3), LIKE($2, _UTF-16LE'He%'))])
             +- LogicalJoin(condition=[true], joinType=[inner])
-               :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
-               +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+               :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
+               +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -606,13 +606,13 @@ NestedLoopJoin(joinType=[InnerJoin], where=[=(a, d0)], select=[a, b, c, d, e, f,
 :  +- NestedLoopJoin(joinType=[InnerJoin], where=[=(a, d)], select=[a, b, c, d, e, f], build=[left])
 :     :- Exchange(distribution=[broadcast])
 :     :  +- Calc(select=[a, b, c], where=[LIKE(c, _UTF-16LE'He%')])
-:     :     +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
-:     +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+:     :     +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+:     +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 +- NestedLoopJoin(joinType=[InnerJoin], where=[=(a, d)], select=[a, b, c, d, e, f], build=[left])
    :- Exchange(distribution=[broadcast])
    :  +- Calc(select=[a, b, c], where=[LIKE(c, _UTF-16LE'He%')])
-   :     +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
-   +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+   :     +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+   +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 ]]>
     </Resource>
   </TestCase>
@@ -633,7 +633,7 @@ NestedLoopJoin(joinType=[InnerJoin], where=[=(a, d0)], select=[a, b, c, d, e, f,
 LogicalProject(sum_b=[$1], avg_b=[/(CAST(CASE(>(COUNT($1) OVER (PARTITION BY $0 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING), 0), $SUM0($1) OVER (PARTITION BY $0 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING), null:BIGINT)):DOUBLE, COUNT($1) OVER (PARTITION BY $0 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING))], rn=[RANK() OVER (PARTITION BY $0 ORDER BY $0 NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)], c=[$0])
 +- LogicalAggregate(group=[{0}], sum_b=[SUM($1)])
    +- LogicalProject(c=[$2], b=[$1])
-      +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -645,7 +645,7 @@ Calc(select=[sum_b, /(CAST(CASE(>(w0$o0, 0:BIGINT), w0$o1, null:BIGINT)), w0$o0)
          +- Exchange(distribution=[hash[c]])
             +- LocalHashAggregate(groupBy=[c], select=[c, Partial_SUM(b) AS sum$0])
                +- Calc(select=[c, b])
-                  +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+                  +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -666,7 +666,7 @@ Calc(select=[sum_b, /(CAST(CASE(>(w0$o0, 0:BIGINT), w0$o1, null:BIGINT)), w0$o0)
 LogicalProject(sum_b=[$2], avg_b=[/(CAST(CASE(>(COUNT($2) OVER (PARTITION BY $1 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING), 0), $SUM0($2) OVER (PARTITION BY $1 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING), null:BIGINT)):DOUBLE, COUNT($2) OVER (PARTITION BY $1 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING))], rn=[RANK() OVER (PARTITION BY $1 ORDER BY $1 NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)], c=[$1])
 +- LogicalAggregate(group=[{0, 1}], sum_b=[SUM($2)])
    +- LogicalProject(a=[$0], c=[$2], b=[$1])
-      +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -678,7 +678,7 @@ Calc(select=[sum_b, /(CAST(CASE(>(w0$o0, 0:BIGINT), w0$o1, null:BIGINT)), w0$o0)
          +- HashAggregate(isMerge=[true], groupBy=[a, c], select=[a, c, Final_SUM(sum$0) AS sum_b])
             +- Exchange(distribution=[hash[c]])
                +- LocalHashAggregate(groupBy=[a, c], select=[a, c, Partial_SUM(b) AS sum$0])
-                  +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+                  +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -699,7 +699,7 @@ LogicalProject(a=[$0], b=[$1], rk=[$2])
    +- LogicalProject(a=[$0], b=[$1], rk=[RANK() OVER (PARTITION BY $0 ORDER BY $1 NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)])
       +- LogicalAggregate(group=[{0}], b=[SUM($1)])
          +- LogicalProject(a=[$0], b=[$1])
-            +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+            +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -710,7 +710,7 @@ Rank(rankType=[RANK], rankRange=[rankStart=1, rankEnd=10], partitionBy=[a], orde
       +- Exchange(distribution=[hash[a]])
          +- LocalHashAggregate(groupBy=[a], select=[a, Partial_SUM(b) AS sum$0])
             +- Calc(select=[a, b])
-               +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+               +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -730,7 +730,7 @@ LogicalAggregate(group=[{0}], EXPR$1=[SUM($1)])
 +- LogicalProject(a=[$0], b=[$1])
    +- LogicalFilter(condition=[<=($3, 10)])
       +- LogicalProject(a=[$0], b=[$1], c=[$2], rk=[RANK() OVER (PARTITION BY $0, $2 ORDER BY $1 NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)])
-         +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+         +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -742,7 +742,7 @@ HashAggregate(isMerge=[false], groupBy=[a], select=[a, SUM(b) AS EXPR$1])
          +- Exchange(distribution=[hash[a]])
             +- Rank(rankType=[RANK], rankRange=[rankStart=1, rankEnd=10], partitionBy=[a, c], orderBy=[b ASC], global=[false], select=[a, b, c])
                +- Sort(orderBy=[a ASC, c ASC, b ASC])
-                  +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+                  +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -762,7 +762,7 @@ LogicalProject(a=[$0], b=[$1], c=[$2], rk=[$3])
 +- LogicalFilter(condition=[<=($3, 10)])
    +- LogicalProject(a=[$0], b=[$1], c=[$2], rk=[RANK() OVER (PARTITION BY $0, $2 ORDER BY $1 NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)])
       +- LogicalAggregate(group=[{0}], b=[SUM($1)], c=[COUNT($2)])
-         +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+         +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -772,7 +772,7 @@ Rank(rankType=[RANK], rankRange=[rankStart=1, rankEnd=10], partitionBy=[a, c], o
    +- HashAggregate(isMerge=[true], groupBy=[a], select=[a, Final_SUM(sum$0) AS b, Final_COUNT(count$1) AS c])
       +- Exchange(distribution=[hash[a]])
          +- LocalHashAggregate(groupBy=[a], select=[a, Partial_SUM(b) AS sum$0, Partial_COUNT(c) AS count$1])
-            +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+            +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -792,7 +792,7 @@ LogicalProject(a=[$0], b=[$1], c=[$2], rk=[$3])
 +- LogicalFilter(condition=[<=($3, 10)])
    +- LogicalProject(a=[$0], b=[$1], c=[$2], rk=[RANK() OVER (PARTITION BY $0, $2 ORDER BY $1 NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)])
       +- LogicalAggregate(group=[{0}], b=[SUM($1)], c=[COUNT($2)])
-         +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+         +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -802,7 +802,7 @@ Rank(rankType=[RANK], rankRange=[rankStart=1, rankEnd=10], partitionBy=[a, c], o
    +- HashAggregate(isMerge=[true], groupBy=[a], select=[a, Final_SUM(sum$0) AS b, Final_COUNT(count$1) AS c])
       +- Exchange(distribution=[hash[a]])
          +- LocalHashAggregate(groupBy=[a], select=[a, Partial_SUM(b) AS sum$0, Partial_COUNT(c) AS count$1])
-            +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+            +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -823,7 +823,7 @@ LogicalProject(a=[$0], b=[$1], rk=[$2])
    +- LogicalProject(a=[$0], b=[$1], rk=[RANK() OVER (ORDER BY $1 NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)])
       +- LogicalAggregate(group=[{}], a=[COUNT($0)], b=[SUM($1)])
          +- LogicalProject(a=[$0], b=[$1])
-            +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+            +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -834,7 +834,7 @@ Rank(rankType=[RANK], rankRange=[rankStart=1, rankEnd=10], partitionBy=[], order
       +- Exchange(distribution=[single])
          +- LocalHashAggregate(select=[Partial_COUNT(a) AS count$0, Partial_SUM(b) AS sum$1])
             +- Calc(select=[a, b])
-               +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+               +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -855,7 +855,7 @@ LogicalProject(a=[$0], b=[$1], rk=[$2])
    +- LogicalProject(a=[$0], b=[$1], rk=[RANK() OVER (PARTITION BY $0 ORDER BY $1 NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)])
       +- LogicalAggregate(group=[{}], a=[COUNT($0)], b=[SUM($1)])
          +- LogicalProject(a=[$0], b=[$1])
-            +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+            +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -866,7 +866,7 @@ Rank(rankType=[RANK], rankRange=[rankStart=1, rankEnd=10], partitionBy=[a], orde
       +- Exchange(distribution=[hash])
          +- LocalHashAggregate(select=[Partial_COUNT(a) AS count$0, Partial_SUM(b) AS sum$1])
             +- Calc(select=[a, b])
-               +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+               +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -884,8 +884,8 @@ LogicalProject(EXPR$0=[$1])
    +- LogicalProject(a=[$0], b=[$1])
       +- LogicalFilter(condition=[AND(=($0, $3), LIKE($2, _UTF-16LE'He%'))])
          +- LogicalJoin(condition=[true], joinType=[inner])
-            :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
-            +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+            :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
+            +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -897,10 +897,10 @@ Calc(select=[EXPR$0])
          +- HashJoin(joinType=[InnerJoin], where=[=(a, d)], select=[a, b, d], build=[left])
             :- Exchange(distribution=[hash[a]])
             :  +- Calc(select=[a, b], where=[LIKE(c, _UTF-16LE'He%')])
-            :     +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+            :     +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
             +- Exchange(distribution=[hash[d]])
                +- Calc(select=[d])
-                  +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+                  +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 ]]>
     </Resource>
   </TestCase>
@@ -918,8 +918,8 @@ LogicalProject(EXPR$0=[$2])
    +- LogicalProject(a=[$0], d=[$3], b=[$1])
       +- LogicalFilter(condition=[AND(=($0, $3), LIKE($2, _UTF-16LE'He%'))])
          +- LogicalJoin(condition=[true], joinType=[inner])
-            :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
-            +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+            :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
+            +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -930,10 +930,10 @@ Calc(select=[EXPR$0])
       +- HashJoin(joinType=[InnerJoin], where=[=(a, d)], select=[a, b, d], build=[left])
          :- Exchange(distribution=[hash[a]])
          :  +- Calc(select=[a, b], where=[LIKE(c, _UTF-16LE'He%')])
-         :     +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+         :     +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
          +- Exchange(distribution=[hash[d]])
             +- Calc(select=[d])
-               +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+               +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 ]]>
     </Resource>
   </TestCase>
@@ -951,8 +951,8 @@ LogicalProject(EXPR$0=[$1])
    +- LogicalProject(d=[$3], b=[$1])
       +- LogicalFilter(condition=[AND(=($0, $3), LIKE($2, _UTF-16LE'He%'))])
          +- LogicalJoin(condition=[true], joinType=[inner])
-            :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
-            +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+            :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
+            +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -964,10 +964,10 @@ Calc(select=[EXPR$0])
          +- HashJoin(joinType=[InnerJoin], where=[=(a, d)], select=[a, b, d], build=[left])
             :- Exchange(distribution=[hash[a]])
             :  +- Calc(select=[a, b], where=[LIKE(c, _UTF-16LE'He%')])
-            :     +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+            :     +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
             +- Exchange(distribution=[hash[d]])
                +- Calc(select=[d])
-                  +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+                  +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 ]]>
     </Resource>
   </TestCase>
@@ -986,13 +986,13 @@ LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5], a0=[$6], b0=[$7],
       :- LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5])
       :  +- LogicalFilter(condition=[AND(=($0, $3), LIKE($2, _UTF-16LE'He%'))])
       :     +- LogicalJoin(condition=[true], joinType=[inner])
-      :        :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
-      :        +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+      :        :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
+      :        +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
       +- LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5])
          +- LogicalFilter(condition=[AND(=($0, $3), LIKE($2, _UTF-16LE'He%'))])
             +- LogicalJoin(condition=[true], joinType=[inner])
-               :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
-               +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+               :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
+               +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -1001,15 +1001,15 @@ SortMergeJoin(joinType=[InnerJoin], where=[=(a, d0)], select=[a, b, c, d, e, f,
 :- SortMergeJoin(joinType=[InnerJoin], where=[=(a, d)], select=[a, b, c, d, e, f])
 :  :- Exchange(distribution=[hash[a]])
 :  :  +- Calc(select=[a, b, c], where=[LIKE(c, _UTF-16LE'He%')])
-:  :     +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+:  :     +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 :  +- Exchange(distribution=[hash[d]])
-:     +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+:     +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 +- SortMergeJoin(joinType=[InnerJoin], where=[=(a, d)], select=[a, b, c, d, e, f])
    :- Exchange(distribution=[hash[a]])
    :  +- Calc(select=[a, b, c], where=[LIKE(c, _UTF-16LE'He%')])
-   :     +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+   :     +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
    +- Exchange(distribution=[hash[d]])
-      +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+      +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 ]]>
     </Resource>
   </TestCase>
@@ -1027,16 +1027,16 @@ LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5], a0=[$6], b0=[$7],
    +- LogicalJoin(condition=[true], joinType=[inner])
       :- LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5])
       :  +- LogicalJoin(condition=[=($0, $3)], joinType=[full])
-      :     :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+      :     :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
       :     +- LogicalProject(d=[$0], e=[$1], f=[$2])
       :        +- LogicalFilter(condition=[=($1, 2)])
-      :           +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+      :           +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
       +- LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5])
          +- LogicalJoin(condition=[=($0, $3)], joinType=[full])
-            :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+            :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
             +- LogicalProject(d=[$0], e=[$1], f=[$2])
                +- LogicalFilter(condition=[=($1, 2)])
-                  +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+                  +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -1045,17 +1045,17 @@ SortMergeJoin(joinType=[InnerJoin], where=[=(a, d0)], select=[a, b, c, d, e, f,
 :- Exchange(distribution=[hash[a]])
 :  +- SortMergeJoin(joinType=[FullOuterJoin], where=[=(a, d)], select=[a, b, c, d, e, f])
 :     :- Exchange(distribution=[hash[a]])
-:     :  +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+:     :  +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 :     +- Exchange(distribution=[hash[d]])
 :        +- Calc(select=[d, CAST(2:BIGINT) AS e, f], where=[=(e, 2:BIGINT)])
-:           +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+:           +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 +- Exchange(distribution=[hash[d]])
    +- SortMergeJoin(joinType=[FullOuterJoin], where=[=(a, d)], select=[a, b, c, d, e, f])
       :- Exchange(distribution=[hash[a]])
-      :  +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+      :  +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
       +- Exchange(distribution=[hash[d]])
          +- Calc(select=[d, CAST(2:BIGINT) AS e, f], where=[=(e, 2:BIGINT)])
-            +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+            +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 ]]>
     </Resource>
   </TestCase>
@@ -1073,16 +1073,16 @@ LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5], a0=[$6], b0=[$7],
    +- LogicalJoin(condition=[true], joinType=[inner])
       :- LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5])
       :  +- LogicalJoin(condition=[=($0, $3)], joinType=[left])
-      :     :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+      :     :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
       :     +- LogicalProject(d=[$0], e=[$1], f=[$2])
       :        +- LogicalFilter(condition=[=($1, 2)])
-      :           +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+      :           +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
       +- LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5])
          +- LogicalJoin(condition=[=($0, $3)], joinType=[left])
-            :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+            :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
             +- LogicalProject(d=[$0], e=[$1], f=[$2])
                +- LogicalFilter(condition=[=($1, 2)])
-                  +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+                  +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -1090,17 +1090,17 @@ LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5], a0=[$6], b0=[$7],
 SortMergeJoin(joinType=[InnerJoin], where=[=(a, d0)], select=[a, b, c, d, e, f, a0, b0, c0, d0, e0, f0], leftSorted=[true])
 :- SortMergeJoin(joinType=[LeftOuterJoin], where=[=(a, d)], select=[a, b, c, d, e, f])
 :  :- Exchange(distribution=[hash[a]])
-:  :  +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+:  :  +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 :  +- Exchange(distribution=[hash[d]])
 :     +- Calc(select=[d, CAST(2:BIGINT) AS e, f], where=[=(e, 2:BIGINT)])
-:        +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+:        +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 +- Exchange(distribution=[hash[d]])
    +- SortMergeJoin(joinType=[LeftOuterJoin], where=[=(a, d)], select=[a, b, c, d, e, f])
       :- Exchange(distribution=[hash[a]])
-      :  +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+      :  +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
       +- Exchange(distribution=[hash[d]])
          +- Calc(select=[d, CAST(2:BIGINT) AS e, f], where=[=(e, 2:BIGINT)])
-            +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+            +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 ]]>
     </Resource>
   </TestCase>
@@ -1118,16 +1118,16 @@ LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5], a0=[$6], b0=[$7],
    +- LogicalJoin(condition=[true], joinType=[inner])
       :- LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5])
       :  +- LogicalJoin(condition=[=($0, $3)], joinType=[right])
-      :     :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+      :     :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
       :     +- LogicalProject(d=[$0], e=[$1], f=[$2])
       :        +- LogicalFilter(condition=[=($1, 2)])
-      :           +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+      :           +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
       +- LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5])
          +- LogicalJoin(condition=[=($0, $3)], joinType=[right])
-            :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+            :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
             +- LogicalProject(d=[$0], e=[$1], f=[$2])
                +- LogicalFilter(condition=[=($1, 2)])
-                  +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+                  +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -1136,16 +1136,16 @@ SortMergeJoin(joinType=[InnerJoin], where=[=(a, d0)], select=[a, b, c, d, e, f,
 :- Exchange(distribution=[hash[a]])
 :  +- SortMergeJoin(joinType=[RightOuterJoin], where=[=(a, d)], select=[a, b, c, d, e, f])
 :     :- Exchange(distribution=[hash[a]])
-:     :  +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+:     :  +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 :     +- Exchange(distribution=[hash[d]])
 :        +- Calc(select=[d, CAST(2:BIGINT) AS e, f], where=[=(e, 2:BIGINT)])
-:           +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+:           +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 +- SortMergeJoin(joinType=[RightOuterJoin], where=[=(a, d)], select=[a, b, c, d, e, f])
    :- Exchange(distribution=[hash[a]])
-   :  +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+   :  +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
    +- Exchange(distribution=[hash[d]])
       +- Calc(select=[d, CAST(2:BIGINT) AS e, f], where=[=(e, 2:BIGINT)])
-         +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+         +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 ]]>
     </Resource>
   </TestCase>
@@ -1160,11 +1160,11 @@ LogicalProject(EXPR$0=[$1])
 LogicalProject(EXPR$0=[*($0, 0.1:DECIMAL(2, 1))])
   LogicalAggregate(group=[{}], agg#0=[SUM($0)])
     LogicalProject(b=[$1])
-      LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+      LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
 }))])
    +- LogicalAggregate(group=[{0}], EXPR$0=[AVG($1)], agg#1=[SUM($1)])
       +- LogicalProject(c=[$2], b=[$1])
-         +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+         +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -1176,7 +1176,7 @@ Calc(select=[EXPR$0])
    :     +- Exchange(distribution=[hash[c]])
    :        +- LocalHashAggregate(groupBy=[c], select=[c, Partial_AVG(b) AS (sum$0, count$1), Partial_SUM(b) AS sum$2])
    :           +- Calc(select=[c, b])
-   :              +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+   :              +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
    +- Exchange(distribution=[broadcast])
       +- SortAggregate(isMerge=[false], select=[SINGLE_VALUE(EXPR$0) AS $f0])
          +- Calc(select=[*($f0, 0.1:DECIMAL(2, 1)) AS EXPR$0])
@@ -1184,7 +1184,7 @@ Calc(select=[EXPR$0])
                +- Exchange(distribution=[single])
                   +- LocalSortAggregate(select=[Partial_SUM(b) AS sum$0])
                      +- Calc(select=[b])
-                        +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+                        +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -1208,23 +1208,23 @@ LogicalProject(c=[$1], cnt=[$0], c0=[$3], cnt0=[$2])
       :  :  +- LogicalAggregate(group=[{0}], cnt=[COUNT($1)])
       :  :     +- LogicalProject(c=[$2], a=[$0])
       :  :        +- LogicalFilter(condition=[>($1, 10)])
-      :  :           +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+      :  :           +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
       :  +- LogicalProject(cnt=[$1], f=[$0])
       :     +- LogicalAggregate(group=[{0}], cnt=[COUNT($1)])
       :        +- LogicalProject(f=[$2], d=[$0])
       :           +- LogicalFilter(condition=[<($1, 100)])
-      :              +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+      :              +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
       +- LogicalUnion(all=[true])
          :- LogicalProject(cnt=[$1], c=[$0])
          :  +- LogicalAggregate(group=[{0}], cnt=[COUNT($1)])
          :     +- LogicalProject(c=[$2], a=[$0])
          :        +- LogicalFilter(condition=[>($1, 10)])
-         :           +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+         :           +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
          +- LogicalProject(cnt=[$1], f=[$0])
             +- LogicalAggregate(group=[{0}], cnt=[COUNT($1)])
                +- LogicalProject(f=[$2], d=[$0])
                   +- LogicalFilter(condition=[<($1, 100)])
-                     +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+                     +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -1238,26 +1238,26 @@ Calc(select=[c, cnt, c0, cnt0])
    :     :     +- Exchange(distribution=[hash[c]])
    :     :        +- LocalHashAggregate(groupBy=[c], select=[c, Partial_COUNT(a) AS count$0])
    :     :           +- Calc(select=[c, a], where=[>(b, 10)])
-   :     :              +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+   :     :              +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
    :     +- Calc(select=[cnt, f], where=[<(cnt, 10)])
    :        +- HashAggregate(isMerge=[true], groupBy=[f], select=[f, Final_COUNT(count$0) AS cnt])
    :           +- Exchange(distribution=[hash[f]])
    :              +- LocalHashAggregate(groupBy=[f], select=[f, Partial_COUNT(d) AS count$0])
    :                 +- Calc(select=[f, d], where=[<(e, 100)])
-   :                    +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+   :                    +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
    +- Union(all=[true], union=[cnt, c])
       :- Calc(select=[cnt, c])
       :  +- HashAggregate(isMerge=[true], groupBy=[c], select=[c, Final_COUNT(count$0) AS cnt])
       :     +- Exchange(distribution=[hash[c]])
       :        +- LocalHashAggregate(groupBy=[c], select=[c, Partial_COUNT(a) AS count$0])
       :           +- Calc(select=[c, a], where=[>(b, 10)])
-      :              +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+      :              +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
       +- Calc(select=[cnt, f])
          +- HashAggregate(isMerge=[true], groupBy=[f], select=[f, Final_COUNT(count$0) AS cnt])
             +- Exchange(distribution=[hash[f]])
                +- LocalHashAggregate(groupBy=[f], select=[f, Partial_COUNT(d) AS count$0])
                   +- Calc(select=[f, d], where=[<(e, 100)])
-                     +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+                     +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 ]]>
     </Resource>
   </TestCase>
diff --git a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/SetOperatorsTest.xml b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/SetOperatorsTest.xml
index 3ad0e67..76cbfc3 100644
--- a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/SetOperatorsTest.xml
+++ b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/SetOperatorsTest.xml
@@ -24,9 +24,9 @@ limitations under the License.
       <![CDATA[
 LogicalIntersect(all=[false])
 :- LogicalProject(c=[$2])
-:  +- LogicalTableScan(table=[[T1, source: [TestTableSource(a, b, c)]]])
+:  +- LogicalTableScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a, b, c)]]])
 +- LogicalProject(f=[$2])
-   +- LogicalTableScan(table=[[T2, source: [TestTableSource(d, e, f)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, T2, source: [TestTableSource(d, e, f)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -35,10 +35,10 @@ HashAggregate(isMerge=[false], groupBy=[c], select=[c])
 +- HashJoin(joinType=[LeftSemiJoin], where=[OR(=(c, f), AND(IS NULL(c), IS NULL(f)))], select=[c], build=[left])
    :- Exchange(distribution=[hash[c]])
    :  +- Calc(select=[c])
-   :     +- TableSourceScan(table=[[T1, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+   :     +- TableSourceScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
    +- Exchange(distribution=[hash[f]])
       +- Calc(select=[f])
-         +- TableSourceScan(table=[[T2, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+         +- TableSourceScan(table=[[default_catalog, default_database, T2, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 ]]>
     </Resource>
   </TestCase>
@@ -51,9 +51,9 @@ HashAggregate(isMerge=[false], groupBy=[c], select=[c])
 LogicalIntersect(all=[false])
 :- LogicalProject(c=[$2])
 :  +- LogicalFilter(condition=[=(1, 0)])
-:     +- LogicalTableScan(table=[[T1, source: [TestTableSource(a, b, c)]]])
+:     +- LogicalTableScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a, b, c)]]])
 +- LogicalProject(f=[$2])
-   +- LogicalTableScan(table=[[T2, source: [TestTableSource(d, e, f)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, T2, source: [TestTableSource(d, e, f)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -70,10 +70,10 @@ Values(tuples=[[]], values=[c])
       <![CDATA[
 LogicalIntersect(all=[false])
 :- LogicalProject(c=[$2])
-:  +- LogicalTableScan(table=[[T1, source: [TestTableSource(a, b, c)]]])
+:  +- LogicalTableScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a, b, c)]]])
 +- LogicalProject(f=[$2])
    +- LogicalFilter(condition=[=(1, 0)])
-      +- LogicalTableScan(table=[[T2, source: [TestTableSource(d, e, f)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, T2, source: [TestTableSource(d, e, f)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -90,9 +90,9 @@ Values(tuples=[[]], values=[c])
       <![CDATA[
 LogicalMinus(all=[false])
 :- LogicalProject(c=[$2])
-:  +- LogicalTableScan(table=[[T1, source: [TestTableSource(a, b, c)]]])
+:  +- LogicalTableScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a, b, c)]]])
 +- LogicalProject(f=[$2])
-   +- LogicalTableScan(table=[[T2, source: [TestTableSource(d, e, f)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, T2, source: [TestTableSource(d, e, f)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -101,10 +101,10 @@ HashAggregate(isMerge=[false], groupBy=[c], select=[c])
 +- HashJoin(joinType=[LeftAntiJoin], where=[OR(=(c, f), AND(IS NULL(c), IS NULL(f)))], select=[c], build=[left])
    :- Exchange(distribution=[hash[c]])
    :  +- Calc(select=[c])
-   :     +- TableSourceScan(table=[[T1, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+   :     +- TableSourceScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
    +- Exchange(distribution=[hash[f]])
       +- Calc(select=[f])
-         +- TableSourceScan(table=[[T2, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+         +- TableSourceScan(table=[[default_catalog, default_database, T2, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 ]]>
     </Resource>
   </TestCase>
@@ -117,9 +117,9 @@ HashAggregate(isMerge=[false], groupBy=[c], select=[c])
 LogicalMinus(all=[false])
 :- LogicalProject(c=[$2])
 :  +- LogicalFilter(condition=[=(1, 0)])
-:     +- LogicalTableScan(table=[[T1, source: [TestTableSource(a, b, c)]]])
+:     +- LogicalTableScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a, b, c)]]])
 +- LogicalProject(f=[$2])
-   +- LogicalTableScan(table=[[T2, source: [TestTableSource(d, e, f)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, T2, source: [TestTableSource(d, e, f)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -136,10 +136,10 @@ Values(tuples=[[]], values=[c])
       <![CDATA[
 LogicalMinus(all=[false])
 :- LogicalProject(c=[$2])
-:  +- LogicalTableScan(table=[[T1, source: [TestTableSource(a, b, c)]]])
+:  +- LogicalTableScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a, b, c)]]])
 +- LogicalProject(f=[$2])
    +- LogicalFilter(condition=[=(1, 0)])
-      +- LogicalTableScan(table=[[T2, source: [TestTableSource(d, e, f)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, T2, source: [TestTableSource(d, e, f)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -148,7 +148,7 @@ HashAggregate(isMerge=[true], groupBy=[c], select=[c])
 +- Exchange(distribution=[hash[c]])
    +- LocalHashAggregate(groupBy=[c], select=[c])
       +- Calc(select=[c])
-         +- TableSourceScan(table=[[T1, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+         +- TableSourceScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -160,9 +160,9 @@ HashAggregate(isMerge=[true], groupBy=[c], select=[c])
       <![CDATA[
 LogicalMinus(all=[false])
 :- LogicalProject(a=[$0], b=[$1], c=[$2])
-:  +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+:  +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 +- LogicalProject(a=[$0], b=[$1], c=[$2])
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -170,7 +170,7 @@ LogicalMinus(all=[false])
 HashAggregate(isMerge=[false], groupBy=[a, b, c], select=[a, b, c])
 +- HashJoin(joinType=[LeftAntiJoin], where=[AND(OR(=(a, a0), AND(IS NULL(a), IS NULL(a0))), OR(=(b, b0), AND(IS NULL(b), IS NULL(b0))), OR(=(c, c0), AND(IS NULL(c), IS NULL(c0))))], select=[a, b, c], build=[left])
    :- Exchange(distribution=[hash[a, b, c]], exchange_mode=[BATCH], reuse_id=[1])
-   :  +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+   :  +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
    +- Reused(reference_id=[1])
 ]]>
     </Resource>
@@ -183,16 +183,16 @@ HashAggregate(isMerge=[false], groupBy=[a, b, c], select=[a, b, c])
       <![CDATA[
 LogicalUnion(all=[true])
 :- LogicalProject(a=[$0])
-:  +- LogicalTableScan(table=[[A, source: [TestTableSource(a, b, c)]]])
+:  +- LogicalTableScan(table=[[default_catalog, default_database, A, source: [TestTableSource(a, b, c)]]])
 +- LogicalProject(EXPR$0=[CASE(>($2, 0), $1, null:RecordType:peek_no_expand(INTEGER _1, VARCHAR(2147483647) CHARACTER SET "UTF-16LE" _2))])
-   +- LogicalTableScan(table=[[A, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, A, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
 Union(all=[true], union=[a])
 :- Calc(select=[a])
-:  +- TableSourceScan(table=[[A, source: [TestTableSource(a, b, c)]]], fields=[a, b, c], reuse_id=[1])
+:  +- TableSourceScan(table=[[default_catalog, default_database, A, source: [TestTableSource(a, b, c)]]], fields=[a, b, c], reuse_id=[1])
 +- Calc(select=[CASE(>(c, 0), b, null:RecordType:peek_no_expand(INTEGER _1, VARCHAR(2147483647) CHARACTER SET "UTF-16LE" _2)) AS EXPR$0])
    +- Reused(reference_id=[1])
 ]]>
@@ -206,16 +206,16 @@ Union(all=[true], union=[a])
       <![CDATA[
 LogicalUnion(all=[true])
 :- LogicalProject(a=[$0])
-:  +- LogicalTableScan(table=[[A, source: [TestTableSource(a, b)]]])
+:  +- LogicalTableScan(table=[[default_catalog, default_database, A, source: [TestTableSource(a, b)]]])
 +- LogicalProject(b=[$1])
-   +- LogicalTableScan(table=[[A, source: [TestTableSource(a, b)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, A, source: [TestTableSource(a, b)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
 Union(all=[true], union=[a])
 :- Calc(select=[a])
-:  +- TableSourceScan(table=[[A, source: [TestTableSource(a, b)]]], fields=[a, b], reuse_id=[1])
+:  +- TableSourceScan(table=[[default_catalog, default_database, A, source: [TestTableSource(a, b)]]], fields=[a, b], reuse_id=[1])
 +- Calc(select=[b])
    +- Reused(reference_id=[1])
 ]]>
diff --git a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/SinkTest.xml b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/SinkTest.xml
index 7652254..6128386 100644
--- a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/SinkTest.xml
+++ b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/SinkTest.xml
@@ -23,7 +23,7 @@ LogicalSink(fields=[a])
 +- LogicalProject(cnt=[$1])
    +- LogicalAggregate(group=[{0}], cnt=[COUNT()])
       +- LogicalProject(a=[$0])
-         +- LogicalTableScan(table=[[MyTable]])
+         +- LogicalTableScan(table=[[default_catalog, default_database, MyTable]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -34,7 +34,7 @@ Sink(fields=[a])
       +- Exchange(distribution=[hash[a]])
          +- LocalHashAggregate(groupBy=[a], select=[a, Partial_COUNT(*) AS count1$0])
             +- Calc(select=[a])
-               +- BoundedStreamScan(table=[[MyTable]], fields=[a, b, c])
+               +- BoundedStreamScan(table=[[default_catalog, default_database, MyTable]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -47,7 +47,7 @@ LogicalSink(fields=[total_sum])
       +- LogicalProject(sum_a=[$1], c=[$0])
          +- LogicalAggregate(group=[{0}], sum_a=[SUM($1)])
             +- LogicalProject(c=[$2], a=[$0])
-               +- LogicalTableScan(table=[[MyTable]])
+               +- LogicalTableScan(table=[[default_catalog, default_database, MyTable]])
 
 LogicalSink(fields=[total_min])
 +- LogicalAggregate(group=[{}], total_min=[MIN($0)])
@@ -55,7 +55,7 @@ LogicalSink(fields=[total_min])
       +- LogicalProject(sum_a=[$1], c=[$0])
          +- LogicalAggregate(group=[{0}], sum_a=[SUM($1)])
             +- LogicalProject(c=[$2], a=[$0])
-               +- LogicalTableScan(table=[[MyTable]])
+               +- LogicalTableScan(table=[[default_catalog, default_database, MyTable]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -65,7 +65,7 @@ Calc(select=[sum_a], reuse_id=[1])
    +- Exchange(distribution=[hash[c]])
       +- LocalHashAggregate(groupBy=[c], select=[c, Partial_SUM(a) AS sum$0])
          +- Calc(select=[c, a])
-            +- BoundedStreamScan(table=[[MyTable]], fields=[a, b, c])
+            +- BoundedStreamScan(table=[[default_catalog, default_database, MyTable]], fields=[a, b, c])
 
 Sink(fields=[total_sum])
 +- HashAggregate(isMerge=[true], select=[Final_SUM(sum$0) AS total_sum])
diff --git a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/SortLimitTest.xml b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/SortLimitTest.xml
index 94c59b3..74112af 100644
--- a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/SortLimitTest.xml
+++ b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/SortLimitTest.xml
@@ -24,7 +24,7 @@ limitations under the License.
       <![CDATA[
 LogicalSort(sort0=[$0], sort1=[$1], dir0=[DESC-nulls-last], dir1=[ASC-nulls-first], offset=[1], fetch=[10])
 +- LogicalProject(a=[$0], b=[$1], c=[$2])
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -32,7 +32,7 @@ LogicalSort(sort0=[$0], sort1=[$1], dir0=[DESC-nulls-last], dir1=[ASC-nulls-firs
 SortLimit(orderBy=[a DESC, b ASC], offset=[1], fetch=[10], global=[true])
 +- Exchange(distribution=[single])
    +- SortLimit(orderBy=[a DESC, b ASC], offset=[0], fetch=[11], global=[false])
-      +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+      +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -44,7 +44,7 @@ SortLimit(orderBy=[a DESC, b ASC], offset=[1], fetch=[10], global=[true])
       <![CDATA[
 LogicalSort(sort0=[$0], sort1=[$1], dir0=[DESC-nulls-last], dir1=[ASC-nulls-first], offset=[1], fetch=[0])
 +- LogicalProject(a=[$0], b=[$1], c=[$2])
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -61,14 +61,14 @@ Values(tuples=[[]], values=[a, b, c])
       <![CDATA[
 LogicalSort(sort0=[$0], dir0=[DESC-nulls-last], offset=[10])
 +- LogicalProject(a=[$0], b=[$1], c=[$2])
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
 SortLimit(orderBy=[a DESC], offset=[10], fetch=[unlimited], global=[true])
 +- Exchange(distribution=[single])
-   +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+   +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -80,7 +80,7 @@ SortLimit(orderBy=[a DESC], offset=[10], fetch=[unlimited], global=[true])
       <![CDATA[
 LogicalSort(sort0=[$0], dir0=[DESC-nulls-last], fetch=[0])
 +- LogicalProject(a=[$0], b=[$1], c=[$2])
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -97,7 +97,7 @@ Values(tuples=[[]], values=[a, b, c])
       <![CDATA[
 LogicalSort(sort0=[$0], dir0=[DESC-nulls-last], fetch=[5])
 +- LogicalProject(a=[$0], b=[$1], c=[$2])
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -105,7 +105,7 @@ LogicalSort(sort0=[$0], dir0=[DESC-nulls-last], fetch=[5])
 SortLimit(orderBy=[a DESC], offset=[0], fetch=[5], global=[true])
 +- Exchange(distribution=[single])
    +- SortLimit(orderBy=[a DESC], offset=[0], fetch=[5], global=[false])
-      +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+      +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -117,14 +117,14 @@ SortLimit(orderBy=[a DESC], offset=[0], fetch=[5], global=[true])
       <![CDATA[
 LogicalSort(sort0=[$0], dir0=[DESC-nulls-last], offset=[10])
 +- LogicalProject(a=[$0], b=[$1], c=[$2])
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
 SortLimit(orderBy=[a DESC], offset=[10], fetch=[unlimited], global=[true])
 +- Exchange(distribution=[single])
-   +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+   +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -136,7 +136,7 @@ SortLimit(orderBy=[a DESC], offset=[10], fetch=[unlimited], global=[true])
       <![CDATA[
 LogicalSort(sort0=[$0], dir0=[DESC-nulls-last], fetch=[0])
 +- LogicalProject(a=[$0], b=[$1], c=[$2])
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -153,7 +153,7 @@ Values(tuples=[[]], values=[a, b, c])
       <![CDATA[
 LogicalSort(sort0=[$0], dir0=[DESC-nulls-last], fetch=[5])
 +- LogicalProject(a=[$0], b=[$1], c=[$2])
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -161,7 +161,7 @@ LogicalSort(sort0=[$0], dir0=[DESC-nulls-last], fetch=[5])
 SortLimit(orderBy=[a DESC], offset=[0], fetch=[5], global=[true])
 +- Exchange(distribution=[single])
    +- SortLimit(orderBy=[a DESC], offset=[0], fetch=[5], global=[false])
-      +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+      +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -173,7 +173,7 @@ SortLimit(orderBy=[a DESC], offset=[0], fetch=[5], global=[true])
       <![CDATA[
 LogicalSort(sort0=[$0], sort1=[$1], dir0=[DESC-nulls-last], dir1=[ASC-nulls-first], offset=[1], fetch=[10])
 +- LogicalProject(a=[$0], b=[$1], c=[$2])
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -181,7 +181,7 @@ LogicalSort(sort0=[$0], sort1=[$1], dir0=[DESC-nulls-last], dir1=[ASC-nulls-firs
 SortLimit(orderBy=[a DESC, b ASC], offset=[1], fetch=[10], global=[true])
 +- Exchange(distribution=[single])
    +- SortLimit(orderBy=[a DESC, b ASC], offset=[0], fetch=[11], global=[false])
-      +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+      +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -193,7 +193,7 @@ SortLimit(orderBy=[a DESC, b ASC], offset=[1], fetch=[10], global=[true])
       <![CDATA[
 LogicalSort(sort0=[$0], sort1=[$1], dir0=[DESC-nulls-last], dir1=[ASC-nulls-first], offset=[1], fetch=[0])
 +- LogicalProject(a=[$0], b=[$1], c=[$2])
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
diff --git a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/SortTest.xml b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/SortTest.xml
index b2d7e99..d08cb76 100644
--- a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/SortTest.xml
+++ b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/SortTest.xml
@@ -24,14 +24,14 @@ limitations under the License.
       <![CDATA[
 LogicalSort(sort0=[$0], sort1=[$1], dir0=[DESC-nulls-last], dir1=[ASC-nulls-first])
 +- LogicalProject(a=[$0], b=[$1], c=[$2])
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
 Sort(orderBy=[a DESC, b ASC])
 +- Exchange(distribution=[single])
-   +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+   +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -43,14 +43,14 @@ Sort(orderBy=[a DESC, b ASC])
       <![CDATA[
 LogicalSort(sort0=[$0], dir0=[DESC-nulls-last])
 +- LogicalProject(a=[$0], b=[$1], c=[$2])
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
 Sort(orderBy=[a DESC])
 +- Exchange(distribution=[range[a DESC]])
-   +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+   +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -62,14 +62,14 @@ Sort(orderBy=[a DESC])
       <![CDATA[
 LogicalSort(sort0=[$0], dir0=[DESC-nulls-last])
 +- LogicalProject(a=[$0], b=[$1], c=[$2])
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
 Sort(orderBy=[a DESC])
 +- Exchange(distribution=[single])
-   +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+   +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -81,14 +81,14 @@ Sort(orderBy=[a DESC])
       <![CDATA[
 LogicalSort(sort0=[$0], dir0=[DESC-nulls-last])
 +- LogicalProject(a=[$0], b=[$1], c=[$2])
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
 Sort(orderBy=[a DESC])
 +- Exchange(distribution=[range[a DESC]])
-   +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+   +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -100,7 +100,7 @@ Sort(orderBy=[a DESC])
       <![CDATA[
 LogicalSort(sort0=[$0], dir0=[DESC-nulls-last])
 +- LogicalProject(a=[$0], b=[$1], c=[$2])
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -108,7 +108,7 @@ LogicalSort(sort0=[$0], dir0=[DESC-nulls-last])
 SortLimit(orderBy=[a DESC], offset=[0], fetch=[200], global=[true])
 +- Exchange(distribution=[single])
    +- SortLimit(orderBy=[a DESC], offset=[0], fetch=[200], global=[false])
-      +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+      +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
diff --git a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/SubplanReuseTest.xml b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/SubplanReuseTest.xml
index 6d366bb..b0e8f8b 100644
--- a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/SubplanReuseTest.xml
+++ b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/SubplanReuseTest.xml
@@ -30,10 +30,10 @@ LogicalProject(a=[$0])
    +- LogicalJoin(condition=[true], joinType=[inner])
       :- LogicalSort(fetch=[10])
       :  +- LogicalProject(a=[$0])
-      :     +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+      :     +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
       +- LogicalSort(fetch=[10])
          +- LogicalProject(a=[$0])
-            +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+            +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -45,7 +45,7 @@ Calc(select=[a])
    :     +- Limit(offset=[0], fetch=[10], global=[true])
    :        +- Exchange(distribution=[single])
    :           +- Limit(offset=[0], fetch=[10], global=[false])
-   :              +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+   :              +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
    +- Exchange(distribution=[broadcast])
       +- Reused(reference_id=[1])
 ]]>
@@ -65,10 +65,10 @@ LogicalProject(a=[$0])
    +- LogicalJoin(condition=[true], joinType=[inner])
       :- LogicalSort(fetch=[10])
       :  +- LogicalProject(a=[$0])
-      :     +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+      :     +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
       +- LogicalSort(fetch=[10])
          +- LogicalProject(a=[$0])
-            +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+            +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -80,7 +80,7 @@ Calc(select=[a])
    :     +- Limit(offset=[0], fetch=[10], global=[true])
    :        +- Exchange(distribution=[single])
    :           +- Limit(offset=[0], fetch=[10], global=[false])
-   :              +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+   :              +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
    +- Exchange(distribution=[any], exchange_mode=[BATCH])
       +- Reused(reference_id=[1])
 ]]>
@@ -101,13 +101,13 @@ LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5], a0=[$6], b0=[$7],
       :- LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5])
       :  +- LogicalFilter(condition=[=($0, $3)])
       :     +- LogicalJoin(condition=[true], joinType=[inner])
-      :        :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
-      :        +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+      :        :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
+      :        +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
       +- LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5])
          +- LogicalFilter(condition=[=($0, $3)])
             +- LogicalJoin(condition=[true], joinType=[inner])
-               :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
-               +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+               :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
+               +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -117,16 +117,16 @@ HashJoin(joinType=[InnerJoin], where=[=(b, e0)], select=[a, b, c, d, e, f, a0, b
 :  +- HashJoin(joinType=[InnerJoin], where=[=(a, d)], select=[a, b, c, d, e, f], build=[left])
 :     :- Exchange(distribution=[hash[a]])
 :     :  +- Calc(select=[a, b, c], where=[<(a, 10)])
-:     :     +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+:     :     +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 :     +- Exchange(distribution=[hash[d]])
-:        +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+:        +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 +- Exchange(distribution=[hash[e]])
    +- HashJoin(joinType=[InnerJoin], where=[=(a, d)], select=[a, b, c, d, e, f], build=[left])
       :- Exchange(distribution=[hash[a]])
       :  +- Calc(select=[a, b, c], where=[>(a, 5)])
-      :     +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+      :     +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
       +- Exchange(distribution=[hash[d]])
-         +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+         +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 ]]>
     </Resource>
   </TestCase>
@@ -145,13 +145,13 @@ LogicalProject(a=[$0], b=[$1], d=[$2], e=[$3], a0=[$4], b0=[$5], d0=[$6], e0=[$7
       :- LogicalProject(a=[$0], b=[$1], d=[$3], e=[$4])
       :  +- LogicalFilter(condition=[=($0, $3)])
       :     +- LogicalJoin(condition=[true], joinType=[inner])
-      :        :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
-      :        +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+      :        :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
+      :        +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
       +- LogicalProject(a=[$0], b=[$1], d=[$3], e=[$4])
          +- LogicalFilter(condition=[=($0, $3)])
             +- LogicalJoin(condition=[true], joinType=[inner])
-               :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
-               +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+               :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
+               +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -161,10 +161,10 @@ HashJoin(joinType=[InnerJoin], where=[=(b, e0)], select=[a, b, d, e, a0, b0, d0,
 :  +- HashJoin(joinType=[InnerJoin], where=[=(a, d)], select=[a, b, d, e], build=[left])
 :     :- Exchange(distribution=[hash[a]])
 :     :  +- Calc(select=[a, b], where=[<(a, 10)])
-:     :     +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c], reuse_id=[1])
+:     :     +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c], reuse_id=[1])
 :     +- Exchange(distribution=[hash[d]], reuse_id=[2])
 :        +- Calc(select=[d, e])
-:           +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+:           +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 +- Exchange(distribution=[hash[e]])
    +- HashJoin(joinType=[InnerJoin], where=[=(a, d)], select=[a, b, d, e], build=[left])
       :- Exchange(distribution=[hash[a]])
@@ -218,22 +218,22 @@ LogicalProject(c=[$0], e=[$1], avg_b=[$2], sum_b=[$3], psum=[$4], nsum=[$5], avg
             :  :     +- LogicalProject(c=[$2], e=[$4], b=[$1])
             :  :        +- LogicalFilter(condition=[AND(=($0, $3), IS NOT NULL($2), >($4, 10))])
             :  :           +- LogicalJoin(condition=[true], joinType=[inner])
-            :  :              :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
-            :  :              +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+            :  :              :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
+            :  :              +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
             :  +- LogicalProject(sum_b=[$2], avg_b=[/(CAST(CASE(>(COUNT($2) OVER (PARTITION BY $0, $1 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING), 0), $SUM0($2) OVER (PARTITION BY $0, $1 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING), null:BIGINT)):DOUBLE, COUNT($2) OVER (PARTITION BY $0, $1 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING))], rn=[RANK() OVER (PARTITION BY $0, $1 ORDER BY $0 NULLS FIRST, $1 NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING [...]
             :     +- LogicalAggregate(group=[{0, 1}], sum_b=[SUM($2)])
             :        +- LogicalProject(c=[$2], e=[$4], b=[$1])
             :           +- LogicalFilter(condition=[AND(=($0, $3), IS NOT NULL($2), >($4, 10))])
             :              +- LogicalJoin(condition=[true], joinType=[inner])
-            :                 :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
-            :                 +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+            :                 :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
+            :                 +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
             +- LogicalProject(sum_b=[$2], avg_b=[/(CAST(CASE(>(COUNT($2) OVER (PARTITION BY $0, $1 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING), 0), $SUM0($2) OVER (PARTITION BY $0, $1 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING), null:BIGINT)):DOUBLE, COUNT($2) OVER (PARTITION BY $0, $1 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING))], rn=[RANK() OVER (PARTITION BY $0, $1 ORDER BY $0 NULLS FIRST, $1 NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING AN [...]
                +- LogicalAggregate(group=[{0, 1}], sum_b=[SUM($2)])
                   +- LogicalProject(c=[$2], e=[$4], b=[$1])
                      +- LogicalFilter(condition=[AND(=($0, $3), IS NOT NULL($2), >($4, 10))])
                         +- LogicalJoin(condition=[true], joinType=[inner])
-                           :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
-                           +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+                           :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
+                           +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -253,10 +253,10 @@ Calc(select=[c, e, avg_b, sum_b, sum_b0 AS psum, sum_b1 AS nsum, avg_b0 AS avg_b
    :     :                       +- HashJoin(joinType=[InnerJoin], where=[=(a, d)], select=[a, b, c, d, e], build=[right])
    :     :                          :- Exchange(distribution=[hash[a]])
    :     :                          :  +- Calc(select=[a, b, c], where=[IS NOT NULL(c)])
-   :     :                          :     +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+   :     :                          :     +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
    :     :                          +- Exchange(distribution=[hash[d]])
    :     :                             +- Calc(select=[d, e], where=[>(e, 10)])
-   :     :                                +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+   :     :                                +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
    :     +- Exchange(distribution=[hash[c, e, $f5]], exchange_mode=[BATCH])
    :        +- Calc(select=[sum_b, /(CAST(CASE(>(w0$o0, 0:BIGINT), w0$o1, null:BIGINT)), w0$o0) AS avg_b, c, e, +(w1$o0, 1) AS $f5])
    :           +- Reused(reference_id=[1])
@@ -281,10 +281,10 @@ LogicalProject(c=[$0], a=[$1], b=[$2], c0=[$3], a0=[$4], b0=[$5])
    +- LogicalJoin(condition=[true], joinType=[inner])
       :- LogicalAggregate(group=[{0}], a=[MyFirst($1)], b=[MyLast($2)])
       :  +- LogicalProject(c=[$2], a=[$0], b=[$1])
-      :     +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+      :     +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
       +- LogicalAggregate(group=[{0}], a=[MyFirst($1)], b=[MyLast($2)])
          +- LogicalProject(c=[$2], a=[$0], b=[$1])
-            +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+            +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -296,7 +296,7 @@ Calc(select=[c, a, b, c0, a1, b0])
    :     +- SortAggregate(isMerge=[false], groupBy=[c], select=[c, MyFirst(a) AS a, MyLast(b) AS b], reuse_id=[1])
    :        +- Sort(orderBy=[c ASC])
    :           +- Exchange(distribution=[hash[c]])
-   :              +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+   :              +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
    +- Exchange(distribution=[hash[b]])
       +- Calc(select=[c, a, b], where=[>(a, 1)])
          +- Reused(reference_id=[1])
@@ -320,15 +320,15 @@ LogicalUnion(all=[true])
 :     +- LogicalJoin(condition=[true], joinType=[inner])
 :        :- LogicalProject(a=[$0], b=[$1], c=[$2])
 :        :  +- LogicalFilter(condition=[LIKE($2, _UTF-16LE'test%')])
-:        :     +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
-:        +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+:        :     +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
+:        +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
 +- LogicalProject(a=[$0], c=[LOWER($2)], e=[$4])
    +- LogicalFilter(condition=[=($0, $3)])
       +- LogicalJoin(condition=[true], joinType=[inner])
          :- LogicalProject(a=[$0], b=[$1], c=[$2])
          :  +- LogicalFilter(condition=[LIKE($2, _UTF-16LE'test%')])
-         :     +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
-         +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+         :     +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
+         +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -338,10 +338,10 @@ Union(all=[true], union=[a, c, e])
 :  +- HashJoin(joinType=[InnerJoin], where=[=(a, d)], select=[a, c, d, e], build=[left])
 :     :- Exchange(distribution=[hash[a]])
 :     :  +- Calc(select=[a, c], where=[LIKE(c, _UTF-16LE'test%')])
-:     :     +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+:     :     +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 :     +- Exchange(distribution=[hash[d]])
 :        +- Calc(select=[d, e])
-:           +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+:           +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 +- Reused(reference_id=[1])
 ]]>
     </Resource>
@@ -359,17 +359,17 @@ UNION ALL
 LogicalUnion(all=[true])
 :- LogicalProject(a=[$0], EXPR$1=[random_udf()])
 :  +- LogicalFilter(condition=[>($0, 10)])
-:     +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+:     +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
 +- LogicalProject(a=[$0], EXPR$1=[random_udf()])
    +- LogicalFilter(condition=[>($0, 10)])
-      +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
 Union(all=[true], union=[a, EXPR$1])
 :- Calc(select=[a, random_udf() AS EXPR$1], where=[>(a, 10)], reuse_id=[1])
-:  +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+:  +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 +- Reused(reference_id=[1])
 ]]>
     </Resource>
@@ -387,17 +387,17 @@ UNION ALL
 LogicalUnion(all=[true])
 :- LogicalProject(a=[$0])
 :  +- LogicalFilter(condition=[>($1, random_udf($0))])
-:     +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+:     +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
 +- LogicalProject(a=[$0])
    +- LogicalFilter(condition=[>($1, random_udf($0))])
-      +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
 Union(all=[true], union=[a])
 :- Calc(select=[a], where=[>(b, random_udf(a))], reuse_id=[1])
-:  +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+:  +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 +- Reused(reference_id=[1])
 ]]>
     </Resource>
@@ -416,11 +416,11 @@ LogicalProject(a=[$0], b=[$1], c=[$2], v=[$3], a0=[$4], b0=[$5], c0=[$6], v0=[$7
    +- LogicalJoin(condition=[true], joinType=[inner])
       :- LogicalProject(a=[$0], b=[$1], c=[$2], v=[$3])
       :  +- LogicalCorrelate(correlation=[$cor0], joinType=[inner], requiredColumns=[{2}])
-      :     :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+      :     :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
       :     +- LogicalTableFunctionScan(invocation=[str_split($cor0.c, _UTF-16LE'-')], rowType=[RecordType(VARCHAR(2147483647) f0)], elementType=[class [Ljava.lang.Object;])
       +- LogicalProject(a=[$0], b=[$1], c=[$2], v=[$3])
          +- LogicalCorrelate(correlation=[$cor1], joinType=[inner], requiredColumns=[{2}])
-            :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+            :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
             +- LogicalTableFunctionScan(invocation=[str_split($cor1.c, _UTF-16LE'-')], rowType=[RecordType(VARCHAR(2147483647) f0)], elementType=[class [Ljava.lang.Object;])
 ]]>
     </Resource>
@@ -428,10 +428,10 @@ LogicalProject(a=[$0], b=[$1], c=[$2], v=[$3], a0=[$4], b0=[$5], c0=[$6], v0=[$7
       <![CDATA[
 HashJoin(joinType=[InnerJoin], where=[=(f0, f00)], select=[a, b, c, f0, a0, b0, c0, f00], isBroadcast=[true], build=[right])
 :- Correlate(invocation=[str_split($cor0.c, _UTF-16LE'-')], correlate=[table(str_split($cor0.c,_UTF-16LE'-'))], select=[a,b,c,f0], rowType=[RecordType(INTEGER a, BIGINT b, VARCHAR(2147483647) c, VARCHAR(2147483647) f0)], joinType=[INNER])
-:  +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+:  +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 +- Exchange(distribution=[broadcast])
    +- Correlate(invocation=[str_split($cor1.c, _UTF-16LE'-')], correlate=[table(str_split($cor1.c,_UTF-16LE'-'))], select=[a,b,c,f0], rowType=[RecordType(INTEGER a, BIGINT b, VARCHAR(2147483647) c, VARCHAR(2147483647) f0)], joinType=[INNER])
-      +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+      +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -449,11 +449,11 @@ LogicalProject(a=[$0], b=[$1], c=[$2], s=[$3], a0=[$4], b0=[$5], c0=[$6], s0=[$7
    +- LogicalJoin(condition=[true], joinType=[inner])
       :- LogicalProject(a=[$0], b=[$1], c=[$2], s=[$3])
       :  +- LogicalCorrelate(correlation=[$cor0], joinType=[inner], requiredColumns=[{2}])
-      :     :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+      :     :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
       :     +- LogicalTableFunctionScan(invocation=[TableFun($cor0.c)], rowType=[RecordType(VARCHAR(2147483647) f0)], elementType=[class [Ljava.lang.Object;])
       +- LogicalProject(a=[$0], b=[$1], c=[$2], s=[$3])
          +- LogicalCorrelate(correlation=[$cor1], joinType=[inner], requiredColumns=[{2}])
-            :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+            :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
             +- LogicalTableFunctionScan(invocation=[TableFun($cor1.c)], rowType=[RecordType(VARCHAR(2147483647) f0)], elementType=[class [Ljava.lang.Object;])
 ]]>
     </Resource>
@@ -462,9 +462,9 @@ LogicalProject(a=[$0], b=[$1], c=[$2], s=[$3], a0=[$4], b0=[$5], c0=[$6], s0=[$7
 NestedLoopJoin(joinType=[InnerJoin], where=[=(c, f00)], select=[a, b, c, f0, a0, b0, c0, f00], build=[left])
 :- Exchange(distribution=[broadcast])
 :  +- Correlate(invocation=[TableFun($cor0.c)], correlate=[table(TableFun($cor0.c))], select=[a,b,c,f0], rowType=[RecordType(INTEGER a, BIGINT b, VARCHAR(2147483647) c, VARCHAR(2147483647) f0)], joinType=[INNER])
-:     +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+:     +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 +- Correlate(invocation=[TableFun($cor1.c)], correlate=[table(TableFun($cor1.c))], select=[a,b,c,f0], rowType=[RecordType(INTEGER a, BIGINT b, VARCHAR(2147483647) c, VARCHAR(2147483647) f0)], joinType=[INNER])
-   +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+   +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -482,10 +482,10 @@ LogicalProject(a=[$0], b=[$1], a0=[$2])
    +- LogicalJoin(condition=[true], joinType=[inner])
       :- LogicalSort(fetch=[10])
       :  +- LogicalProject(a=[$0], b=[$1])
-      :     +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+      :     +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
       +- LogicalSort(fetch=[10])
          +- LogicalProject(a=[$0], b=[$1])
-            +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+            +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -497,7 +497,7 @@ Calc(select=[a, b, a1 AS a0])
    :     +- Limit(offset=[0], fetch=[10], global=[true], reuse_id=[1])
    :        +- Exchange(distribution=[single])
    :           +- Limit(offset=[0], fetch=[10], global=[false])
-   :              +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+   :              +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
    +- Exchange(distribution=[broadcast])
       +- Calc(select=[a, b])
          +- Reused(reference_id=[1])
@@ -517,17 +517,17 @@ UNION ALL
 LogicalUnion(all=[true])
 :- LogicalProject(a=[$0])
 :  +- LogicalFilter(condition=[>($0, 10)])
-:     +- LogicalTableScan(table=[[t]])
+:     +- LogicalTableScan(table=[[default_catalog, default_database, t]])
 +- LogicalProject(a=[$0])
    +- LogicalFilter(condition=[>($1, 10)])
-      +- LogicalTableScan(table=[[t]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, t]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
 Union(all=[true], union=[a])
 :- Calc(select=[a], where=[>(a, 10)])
-:  +- BoundedStreamScan(table=[[t]], fields=[a, b, c], reuse_id=[1])
+:  +- BoundedStreamScan(table=[[default_catalog, default_database, t]], fields=[a, b, c], reuse_id=[1])
 +- Calc(select=[a], where=[>(b, 10)])
    +- Reused(reference_id=[1])
 ]]>
@@ -550,15 +550,15 @@ LogicalUnion(all=[true])
 :     +- LogicalJoin(condition=[true], joinType=[inner])
 :        :- LogicalProject(a=[$0], b=[$1], c=[$2])
 :        :  +- LogicalFilter(condition=[LIKE($2, _UTF-16LE'test%')])
-:        :     +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
-:        +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+:        :     +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
+:        +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
 +- LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5])
    +- LogicalFilter(condition=[AND(=($0, $3), <>($5, _UTF-16LE''))])
       +- LogicalJoin(condition=[true], joinType=[inner])
          :- LogicalProject(a=[$0], b=[$1], c=[$2])
          :  +- LogicalFilter(condition=[LIKE($2, _UTF-16LE'test%')])
-         :     +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
-         +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+         :     +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
+         +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -567,15 +567,15 @@ Union(all=[true], union=[a, b, c, d, e, f])
 :- HashJoin(joinType=[InnerJoin], where=[=(a, d)], select=[a, b, c, d, e, f], build=[left])
 :  :- Exchange(distribution=[hash[a]], reuse_id=[1])
 :  :  +- Calc(select=[a, b, c], where=[LIKE(c, _UTF-16LE'test%')])
-:  :     +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+:  :     +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 :  +- Exchange(distribution=[hash[d]])
 :     +- Calc(select=[d, e, f], where=[>(e, 10)])
-:        +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+:        +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 +- HashJoin(joinType=[InnerJoin], where=[=(a, d)], select=[a, b, c, d, e, f], build=[left])
    :- Reused(reference_id=[1])
    +- Exchange(distribution=[hash[d]])
       +- Calc(select=[d, e, f], where=[<>(f, _UTF-16LE'':VARCHAR(2147483647) CHARACTER SET "UTF-16LE")])
-         +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+         +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 ]]>
     </Resource>
   </TestCase>
@@ -593,10 +593,10 @@ LogicalProject(c=[$0], a=[$1], b=[$2], c0=[$3], a0=[$4], b0=[$5])
    +- LogicalJoin(condition=[true], joinType=[inner])
       :- LogicalAggregate(group=[{0}], a=[SUM($1)], b=[SUM($2)])
       :  +- LogicalProject(c=[$2], a=[$0], b=[$1])
-      :     +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+      :     +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
       +- LogicalAggregate(group=[{0}], a=[SUM($1)], b=[SUM($2)])
          +- LogicalProject(c=[$2], a=[$0], b=[$1])
-            +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+            +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -608,7 +608,7 @@ Calc(select=[c, a, b, c0, a1, b0])
    :     +- HashAggregate(isMerge=[true], groupBy=[c], select=[c, Final_SUM(sum$0) AS a, Final_SUM(sum$1) AS b], reuse_id=[1])
    :        +- Exchange(distribution=[hash[c]])
    :           +- LocalHashAggregate(groupBy=[c], select=[c, Partial_SUM(a) AS sum$0, Partial_SUM(b) AS sum$1])
-   :              +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+   :              +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
    +- Exchange(distribution=[hash[b]])
       +- Calc(select=[c, a, b], where=[>(a, 1)])
          +- Reused(reference_id=[1])
@@ -630,13 +630,13 @@ LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5], a0=[$6], b0=[$7],
       :- LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5])
       :  +- LogicalFilter(condition=[AND(=($0, $3), LIKE($2, _UTF-16LE'He%'))])
       :     +- LogicalJoin(condition=[true], joinType=[inner])
-      :        :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
-      :        +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+      :        :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
+      :        +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
       +- LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5])
          +- LogicalFilter(condition=[AND(=($0, $3), LIKE($2, _UTF-16LE'He%'))])
             +- LogicalJoin(condition=[true], joinType=[inner])
-               :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
-               +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+               :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
+               +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -646,9 +646,9 @@ HashJoin(joinType=[InnerJoin], where=[=(a, d0)], select=[a, b, c, d, e, f, a0, b
 :  +- HashJoin(joinType=[InnerJoin], where=[=(a, d)], select=[a, b, c, d, e, f], build=[left], reuse_id=[1])
 :     :- Exchange(distribution=[hash[a]])
 :     :  +- Calc(select=[a, b, c], where=[LIKE(c, _UTF-16LE'He%')])
-:     :     +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+:     :     +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 :     +- Exchange(distribution=[hash[d]])
-:        +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+:        +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 +- Reused(reference_id=[1])
 ]]>
     </Resource>
@@ -669,13 +669,13 @@ LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5], a0=[$6], b0=[$7],
       :- LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5])
       :  +- LogicalFilter(condition=[AND(>($1, 1), <($4, 2))])
       :     +- LogicalJoin(condition=[OR(=(ABS($0), ABS($3)), =($2, $5))], joinType=[full])
-      :        :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
-      :        +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+      :        :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
+      :        +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
       +- LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5])
          +- LogicalFilter(condition=[AND(>($1, 1), <($4, 2))])
             +- LogicalJoin(condition=[OR(=(ABS($0), ABS($3)), =($2, $5))], joinType=[full])
-               :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
-               +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+               :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
+               +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -687,9 +687,9 @@ Calc(select=[a, b, c, d, e, f, a1, b0, c0, d0, e0, f0])
    :     +- NestedLoopJoin(joinType=[InnerJoin], where=[OR(=(ABS(a), ABS(d)), =(c, f))], select=[a, b, c, d, e, f], build=[left], reuse_id=[1])
    :        :- Exchange(distribution=[broadcast])
    :        :  +- Calc(select=[a, b, c], where=[>(b, 1)])
-   :        :     +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+   :        :     +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
    :        +- Calc(select=[d, e, f], where=[<(e, 2)])
-   :           +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+   :           +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
    +- Exchange(distribution=[hash[b]])
       +- Reused(reference_id=[1])
 ]]>
@@ -711,13 +711,13 @@ LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5], a0=[$6], b0=[$7],
       :- LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5])
       :  +- LogicalFilter(condition=[AND(>($1, 1), <($4, 2))])
       :     +- LogicalJoin(condition=[OR(=(random_udf($0), random_udf($3)), =($2, $5))], joinType=[full])
-      :        :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
-      :        +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+      :        :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
+      :        +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
       +- LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5])
          +- LogicalFilter(condition=[AND(>($1, 1), <($4, 2))])
             +- LogicalJoin(condition=[OR(=(random_udf($0), random_udf($3)), =($2, $5))], joinType=[full])
-               :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
-               +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+               :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
+               +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -729,9 +729,9 @@ Calc(select=[a, b, c, d, e, f, a1, b0, c0, d0, e0, f0])
    :     +- NestedLoopJoin(joinType=[InnerJoin], where=[OR(=(random_udf(a), random_udf(d)), =(c, f))], select=[a, b, c, d, e, f], build=[left], reuse_id=[1])
    :        :- Exchange(distribution=[broadcast])
    :        :  +- Calc(select=[a, b, c], where=[>(b, 1)])
-   :        :     +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+   :        :     +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
    :        +- Calc(select=[d, e, f], where=[<(e, 2)])
-   :           +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+   :           +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
    +- Exchange(distribution=[hash[b]])
       +- Reused(reference_id=[1])
 ]]>
@@ -751,10 +751,10 @@ LogicalProject(a=[$0], b=[$1], a0=[$2])
    +- LogicalJoin(condition=[true], joinType=[inner])
       :- LogicalSort(fetch=[10])
       :  +- LogicalProject(a=[$0], b=[$1])
-      :     +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+      :     +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
       +- LogicalSort(fetch=[10])
          +- LogicalProject(a=[$0], b=[$1])
-            +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+            +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -766,7 +766,7 @@ Calc(select=[a, b, a1 AS a0])
    :     +- Limit(offset=[0], fetch=[10], global=[true], reuse_id=[1])
    :        +- Exchange(distribution=[single])
    :           +- Limit(offset=[0], fetch=[10], global=[false])
-   :              +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+   :              +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
    +- Exchange(distribution=[broadcast])
       +- Calc(select=[a, b])
          +- Reused(reference_id=[1])
@@ -788,13 +788,13 @@ LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5], a0=[$6], b0=[$7],
       :- LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5])
       :  +- LogicalFilter(condition=[AND(=($0, $3), LIKE($2, _UTF-16LE'He%'))])
       :     +- LogicalJoin(condition=[true], joinType=[inner])
-      :        :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
-      :        +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+      :        :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
+      :        +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
       +- LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5])
          +- LogicalFilter(condition=[AND(=($0, $3), LIKE($2, _UTF-16LE'He%'))])
             +- LogicalJoin(condition=[true], joinType=[inner])
-               :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
-               +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+               :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
+               +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -804,8 +804,8 @@ NestedLoopJoin(joinType=[InnerJoin], where=[=(a, d0)], select=[a, b, c, d, e, f,
 :  +- NestedLoopJoin(joinType=[InnerJoin], where=[=(a, d)], select=[a, b, c, d, e, f], build=[left], reuse_id=[1])
 :     :- Exchange(distribution=[broadcast])
 :     :  +- Calc(select=[a, b, c], where=[LIKE(c, _UTF-16LE'He%')])
-:     :     +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
-:     +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+:     :     +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+:     +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 +- Exchange(distribution=[any], exchange_mode=[BATCH])
    +- Reused(reference_id=[1])
 ]]>
@@ -824,9 +824,9 @@ LogicalProject(a=[$0], b=[$1], EXPR$2=[$2], a0=[$3], b0=[$4], EXPR$20=[$5])
 +- LogicalFilter(condition=[AND(=($0, $3), <($1, 100), >($4, 10))])
    +- LogicalJoin(condition=[true], joinType=[inner])
       :- LogicalProject(a=[$0], b=[$1], EXPR$2=[MyFirst($2) OVER (PARTITION BY $2 ORDER BY $2 DESC NULLS LAST RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)])
-      :  +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+      :  +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
       +- LogicalProject(a=[$0], b=[$1], EXPR$2=[MyFirst($2) OVER (PARTITION BY $2 ORDER BY $2 DESC NULLS LAST RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)])
-         +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+         +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -837,7 +837,7 @@ HashJoin(joinType=[InnerJoin], where=[=(a, a0)], select=[a, b, $2, a0, b0, $20],
 :     +- OverAggregate(partitionBy=[c], orderBy=[c DESC], window#0=[MyFirst(c) AS w0$o0 RANG BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW], select=[a, b, c, w0$o0], reuse_id=[1])
 :        +- Sort(orderBy=[c DESC])
 :           +- Exchange(distribution=[hash[c]])
-:              +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+:              +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 +- Exchange(distribution=[hash[a]])
    +- Calc(select=[a, b, w0$o0 AS $2], where=[>(b, 10)])
       +- Reused(reference_id=[1])
@@ -858,10 +858,10 @@ LogicalProject(c=[$0], a=[$1], b=[$2], c0=[$3], a0=[$4], b0=[$5])
    +- LogicalJoin(condition=[true], joinType=[inner])
       :- LogicalAggregate(group=[{0}], a=[SUM($1)], b=[SUM($2)])
       :  +- LogicalProject(c=[$2], a=[$0], b=[$1])
-      :     +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+      :     +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
       +- LogicalAggregate(group=[{0}], a=[SUM($1)], b=[SUM($2)])
          +- LogicalProject(c=[$2], a=[$0], b=[$1])
-            +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+            +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -872,7 +872,7 @@ HashJoin(joinType=[InnerJoin], where=[=(a, a0)], select=[c, a, b, c0, a0, b0], b
 :     +- HashAggregate(isMerge=[true], groupBy=[c], select=[c, Final_SUM(sum$0) AS a, Final_SUM(sum$1) AS b], reuse_id=[1])
 :        +- Exchange(distribution=[hash[c]])
 :           +- LocalHashAggregate(groupBy=[c], select=[c, Partial_SUM(a) AS sum$0, Partial_SUM(b) AS sum$1])
-:              +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+:              +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 +- Exchange(distribution=[hash[a]])
    +- Calc(select=[c, a, b], where=[<(b, 10)])
       +- Reused(reference_id=[1])
@@ -893,10 +893,10 @@ LogicalProject(c=[$0], a=[$1], b=[$2], c0=[$3], a0=[$4], b0=[$5])
    +- LogicalJoin(condition=[true], joinType=[inner])
       :- LogicalAggregate(group=[{0}], a=[SUM($1)], b=[SUM($2)])
       :  +- LogicalProject(c=[$2], a=[$0], b=[$1])
-      :     +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+      :     +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
       +- LogicalAggregate(group=[{0}], a=[SUM($1)], b=[SUM($2)])
          +- LogicalProject(c=[$2], a=[$0], b=[$1])
-            +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+            +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -910,7 +910,7 @@ Calc(select=[c, a, b, c0, a1, b0])
    :           +- Exchange(distribution=[hash[c]])
    :              +- LocalSortAggregate(groupBy=[c], select=[c, Partial_SUM(a) AS sum$0, Partial_SUM(b) AS sum$1])
    :                 +- Sort(orderBy=[c ASC])
-   :                    +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+   :                    +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
    +- Exchange(distribution=[hash[b]])
       +- Calc(select=[c, a, b], where=[>(a, 1)])
          +- Reused(reference_id=[1])
@@ -930,9 +930,9 @@ LogicalProject(a=[$0], b=[$1], EXPR$2=[$2], a0=[$3], b0=[$4], EXPR$20=[$5])
 +- LogicalFilter(condition=[AND(=($0, $3), <($1, 100), >($4, 10))])
    +- LogicalJoin(condition=[true], joinType=[inner])
       :- LogicalProject(a=[$0], b=[$1], EXPR$2=[RANK() OVER (ORDER BY $2 DESC NULLS LAST RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)])
-      :  +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+      :  +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
       +- LogicalProject(a=[$0], b=[$1], EXPR$2=[RANK() OVER (ORDER BY $2 DESC NULLS LAST RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)])
-         +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+         +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -943,7 +943,7 @@ HashJoin(joinType=[InnerJoin], where=[=(a, a0)], select=[a, b, $2, a0, b0, $20],
 :     +- OverAggregate(orderBy=[c DESC], window#0=[RANK(*) AS w0$o0 RANG BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW], select=[a, b, c, w0$o0], reuse_id=[1])
 :        +- Sort(orderBy=[c DESC])
 :           +- Exchange(distribution=[single])
-:              +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+:              +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 +- Exchange(distribution=[hash[a]])
    +- Calc(select=[a, b, w0$o0 AS $2], where=[>(b, 10)])
       +- Reused(reference_id=[1])
@@ -965,11 +965,11 @@ LogicalProject(c=[$0], a=[$1], b=[$2], c0=[$3], a0=[$4], b0=[$5])
       :- LogicalSort(sort0=[$1], sort1=[$2], dir0=[ASC-nulls-first], dir1=[DESC-nulls-last], fetch=[10])
       :  +- LogicalAggregate(group=[{0}], a=[SUM($1)], b=[SUM($2)])
       :     +- LogicalProject(c=[$2], a=[$0], b=[$1])
-      :        +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+      :        +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
       +- LogicalSort(sort0=[$1], sort1=[$2], dir0=[ASC-nulls-first], dir1=[DESC-nulls-last], fetch=[10])
          +- LogicalAggregate(group=[{0}], a=[SUM($1)], b=[SUM($2)])
             +- LogicalProject(c=[$2], a=[$0], b=[$1])
-               +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+               +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -983,7 +983,7 @@ NestedLoopJoin(joinType=[InnerJoin], where=[=(a, a0)], select=[c, a, b, c0, a0,
 :              +- HashAggregate(isMerge=[true], groupBy=[c], select=[c, Final_SUM(sum$0) AS a, Final_SUM(sum$1) AS b])
 :                 +- Exchange(distribution=[hash[c]])
 :                    +- LocalHashAggregate(groupBy=[c], select=[c, Partial_SUM(a) AS sum$0, Partial_SUM(b) AS sum$1])
-:                       +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+:                       +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 +- Exchange(distribution=[any], exchange_mode=[BATCH])
    +- Calc(select=[c, a, b], where=[<(b, 10)])
       +- Reused(reference_id=[1])
@@ -1005,17 +1005,17 @@ LogicalProject(a=[$0], c=[$1], c0=[$3])
       :- LogicalUnion(all=[true])
       :  :- LogicalProject(a=[$0], c=[$2])
       :  :  +- LogicalFilter(condition=[>($1, 10)])
-      :  :     +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+      :  :     +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
       :  +- LogicalProject(d=[$0], f=[$2])
       :     +- LogicalFilter(condition=[<($1, 100)])
-      :        +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+      :        +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
       +- LogicalUnion(all=[true])
          :- LogicalProject(a=[$0], c=[$2])
          :  +- LogicalFilter(condition=[>($1, 10)])
-         :     +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+         :     +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
          +- LogicalProject(d=[$0], f=[$2])
             +- LogicalFilter(condition=[<($1, 100)])
-               +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+               +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -1025,9 +1025,9 @@ Calc(select=[a, c, c0])
    :- Exchange(distribution=[hash[a]], exchange_mode=[BATCH], reuse_id=[1])
    :  +- Union(all=[true], union=[a, c])
    :     :- Calc(select=[a, c], where=[>(b, 10)])
-   :     :  +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+   :     :  +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
    :     +- Calc(select=[d, f], where=[<(e, 100)])
-   :        +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+   :        +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
    +- Reused(reference_id=[1])
 ]]>
     </Resource>
@@ -1047,13 +1047,13 @@ LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5], a0=[$6], b0=[$7],
       :- LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5])
       :  +- LogicalFilter(condition=[AND(=($0, $3), LIKE($2, _UTF-16LE'He%'))])
       :     +- LogicalJoin(condition=[true], joinType=[inner])
-      :        :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
-      :        +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+      :        :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
+      :        +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
       +- LogicalProject(a=[$0], b=[$1], c=[$2], d=[$3], e=[$4], f=[$5])
          +- LogicalFilter(condition=[AND(=($0, $3), LIKE($2, _UTF-16LE'He%'))])
             +- LogicalJoin(condition=[true], joinType=[inner])
-               :- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
-               +- LogicalTableScan(table=[[y, source: [TestTableSource(d, e, f)]]])
+               :- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
+               +- LogicalTableScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -1062,9 +1062,9 @@ SortMergeJoin(joinType=[InnerJoin], where=[=(a, d0)], select=[a, b, c, d, e, f,
 :- SortMergeJoin(joinType=[InnerJoin], where=[=(a, d)], select=[a, b, c, d, e, f], reuse_id=[1])
 :  :- Exchange(distribution=[hash[a]])
 :  :  +- Calc(select=[a, b, c], where=[LIKE(c, _UTF-16LE'He%')])
-:  :     +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+:  :     +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 :  +- Exchange(distribution=[hash[d]])
-:     +- TableSourceScan(table=[[y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
+:     +- TableSourceScan(table=[[default_catalog, default_database, y, source: [TestTableSource(d, e, f)]]], fields=[d, e, f])
 +- Reused(reference_id=[1])
 ]]>
     </Resource>
@@ -1077,15 +1077,15 @@ LogicalIntersect(all=[false])
 :  :- LogicalProject(random=[$0])
 :  :  +- LogicalSort(sort0=[$1], dir0=[ASC-nulls-first], fetch=[1])
 :  :     +- LogicalProject(random=[$0], EXPR$1=[RAND()])
-:  :        +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+:  :        +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
 :  +- LogicalProject(random=[$0])
 :     +- LogicalSort(sort0=[$1], dir0=[ASC-nulls-first], fetch=[1])
 :        +- LogicalProject(random=[$0], EXPR$1=[RAND()])
-:           +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+:           +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
 +- LogicalProject(random=[$0])
    +- LogicalSort(sort0=[$1], dir0=[ASC-nulls-first], fetch=[1])
       +- LogicalProject(random=[$0], EXPR$1=[RAND()])
-         +- LogicalTableScan(table=[[x, source: [TestTableSource(a, b, c)]]])
+         +- LogicalTableScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -1101,7 +1101,7 @@ NestedLoopJoin(joinType=[LeftSemiJoin], where=[OR(=(random, random0), AND(IS NUL
 :           :        +- Exchange(distribution=[single])
 :           :           +- SortLimit(orderBy=[EXPR$1 ASC], offset=[0], fetch=[1], global=[false])
 :           :              +- Calc(select=[a AS random, RAND() AS EXPR$1])
-:           :                 +- TableSourceScan(table=[[x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+:           :                 +- TableSourceScan(table=[[default_catalog, default_database, x, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 :           +- Exchange(distribution=[broadcast], reuse_id=[2])
 :              +- Reused(reference_id=[1])
 +- Reused(reference_id=[2])
diff --git a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/TableScanTest.xml b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/TableScanTest.xml
index 04c5328..2b2070c 100644
--- a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/TableScanTest.xml
+++ b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/TableScanTest.xml
@@ -23,12 +23,12 @@ limitations under the License.
     <Resource name="planBefore">
       <![CDATA[
 LogicalProject(a=[$0], b=[$1], c=[$2])
-+- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
++- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
-TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
diff --git a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/TableSourceTest.xml b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/TableSourceTest.xml
index 14d0aa7..1a9bddc 100644
--- a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/TableSourceTest.xml
+++ b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/TableSourceTest.xml
@@ -30,13 +30,13 @@ FROM T
     <Resource name="planBefore">
       <![CDATA[
 LogicalProject(id=[$0], nestedName=[$1.nested1.name], nestedValue=[$2.value], nestedFlag=[$1.nested2.flag], nestedNum=[$1.nested2.num])
-+- LogicalTableScan(table=[[T, source: [TestSource(read nested fields: id.*, deepNested.*, nested.*, name.*)]]])
++- LogicalTableScan(table=[[default_catalog, default_database, T, source: [TestSource(read nested fields: id.*, deepNested.*, nested.*, name.*)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
 Calc(select=[id, deepNested.nested1.name AS nestedName, nested.value AS nestedValue, deepNested.nested2.flag AS nestedFlag, deepNested.nested2.num AS nestedNum])
-+- TableSourceScan(table=[[T, source: [TestSource(read nested fields: id.*, deepNested.nested2.num, deepNested.nested2.flag, deepNested.nested1.name, nested.value)]]], fields=[id, deepNested, nested])
++- TableSourceScan(table=[[default_catalog, default_database, T, source: [TestSource(read nested fields: id.*, deepNested.nested2.num, deepNested.nested2.flag, deepNested.nested1.name, nested.value)]]], fields=[id, deepNested, nested])
 ]]>
     </Resource>
   </TestCase>
@@ -47,12 +47,12 @@ Calc(select=[id, deepNested.nested1.name AS nestedName, nested.value AS nestedVa
     <Resource name="planBefore">
       <![CDATA[
 LogicalProject(a=[$0], c=[$2])
-+- LogicalTableScan(table=[[MyTable, source: [TestSource(physical fields: a, b, c)]]])
++- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestSource(physical fields: a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
-TableSourceScan(table=[[MyTable, source: [TestSource(physical fields: a, c)]]], fields=[a, c])
+TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestSource(physical fields: a, c)]]], fields=[a, c])
 ]]>
     </Resource>
   </TestCase>
@@ -64,7 +64,7 @@ TableSourceScan(table=[[MyTable, source: [TestSource(physical fields: a, c)]]],
       <![CDATA[
 LogicalAggregate(group=[{}], EXPR$0=[COUNT()])
 +- LogicalProject($f0=[1])
-   +- LogicalTableScan(table=[[MyTable, source: [TestSource(physical fields: a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestSource(physical fields: a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -72,7 +72,7 @@ LogicalAggregate(group=[{}], EXPR$0=[COUNT()])
 SortAggregate(isMerge=[true], select=[Final_COUNT(count1$0) AS EXPR$0])
 +- Exchange(distribution=[single])
    +- LocalSortAggregate(select=[Partial_COUNT(*) AS count1$0])
-      +- TableSourceScan(table=[[MyTable, source: [TestSource(physical fields: )]]], fields=[])
+      +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestSource(physical fields: )]]], fields=[])
 ]]>
     </Resource>
   </TestCase>
diff --git a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/UnionTest.xml b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/UnionTest.xml
index 216cbc7..5b02e4e 100644
--- a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/UnionTest.xml
+++ b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/UnionTest.xml
@@ -35,11 +35,11 @@ LogicalProject(a=[$0], c=[$1])
    +- LogicalUnion(all=[true])
       :- LogicalUnion(all=[true])
       :  :- LogicalProject(a=[$0], c=[$2])
-      :  :  +- LogicalTableScan(table=[[MyTable1, source: [TestTableSource(a, b, c)]]])
+      :  :  +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(a, b, c)]]])
       :  +- LogicalProject(a=[$0], c=[$2])
-      :     +- LogicalTableScan(table=[[MyTable2, source: [TestTableSource(a, b, c)]]])
+      :     +- LogicalTableScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c)]]])
       +- LogicalProject(a=[$0], c=[$2])
-         +- LogicalTableScan(table=[[MyTable3, source: [TestTableSource(a, b, c)]]])
+         +- LogicalTableScan(table=[[default_catalog, default_database, MyTable3, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -47,11 +47,11 @@ LogicalProject(a=[$0], c=[$1])
 Union(all=[true], union=[a, c])
 :- Union(all=[true], union=[a, c])
 :  :- Calc(select=[a, c], where=[>(a, 2)])
-:  :  +- TableSourceScan(table=[[MyTable1, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+:  :  +- TableSourceScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 :  +- Calc(select=[a, c], where=[>(a, 2)])
-:     +- TableSourceScan(table=[[MyTable2, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+:     +- TableSourceScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 +- Calc(select=[a, c], where=[>(a, 2)])
-   +- TableSourceScan(table=[[MyTable3, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+   +- TableSourceScan(table=[[default_catalog, default_database, MyTable3, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -69,18 +69,18 @@ SELECT * FROM (
 LogicalProject(a=[$0], b=[$1]), rowType=[RecordType(INTEGER a, DECIMAL(20, 1) b)]
 +- LogicalUnion(all=[true]), rowType=[RecordType(INTEGER a, DECIMAL(20, 1) b)]
    :- LogicalProject(a=[$0], b=[$1]), rowType=[RecordType(INTEGER a, BIGINT b)]
-   :  +- LogicalTableScan(table=[[MyTable1, source: [TestTableSource(a, b, c)]]]), rowType=[RecordType(INTEGER a, BIGINT b, VARCHAR(2147483647) c)]
+   :  +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(a, b, c)]]]), rowType=[RecordType(INTEGER a, BIGINT b, VARCHAR(2147483647) c)]
    +- LogicalProject(a=[$0], EXPR$1=[0:DECIMAL(2, 1)]), rowType=[RecordType(INTEGER a, DECIMAL(2, 1) EXPR$1)]
-      +- LogicalTableScan(table=[[MyTable2, source: [TestTableSource(a, b, c)]]]), rowType=[RecordType(INTEGER a, BIGINT b, VARCHAR(2147483647) c)]
+      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c)]]]), rowType=[RecordType(INTEGER a, BIGINT b, VARCHAR(2147483647) c)]
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
 Union(all=[true], union=[a, b]), rowType=[RecordType(INTEGER a, DECIMAL(20, 1) b)]
 :- Calc(select=[a, CAST(b) AS b]), rowType=[RecordType(INTEGER a, DECIMAL(20, 1) b)]
-:  +- TableSourceScan(table=[[MyTable1, source: [TestTableSource(a, b, c)]]], fields=[a, b, c]), rowType=[RecordType(INTEGER a, BIGINT b, VARCHAR(2147483647) c)]
+:  +- TableSourceScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(a, b, c)]]], fields=[a, b, c]), rowType=[RecordType(INTEGER a, BIGINT b, VARCHAR(2147483647) c)]
 +- Calc(select=[a, CAST(0.0:DECIMAL(20, 1)) AS EXPR$1]), rowType=[RecordType(INTEGER a, DECIMAL(20, 1) EXPR$1)]
-   +- TableSourceScan(table=[[MyTable2, source: [TestTableSource(a, b, c)]]], fields=[a, b, c]), rowType=[RecordType(INTEGER a, BIGINT b, VARCHAR(2147483647) c)]
+   +- TableSourceScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c)]]], fields=[a, b, c]), rowType=[RecordType(INTEGER a, BIGINT b, VARCHAR(2147483647) c)]
 ]]>
     </Resource>
   </TestCase>
diff --git a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/UnnestTest.xml b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/UnnestTest.xml
index 9991e1c..a7d748c 100644
--- a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/UnnestTest.xml
+++ b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/UnnestTest.xml
@@ -24,7 +24,7 @@ limitations under the License.
       <![CDATA[
 LogicalProject(a=[$0], s=[$3])
 +- LogicalCorrelate(correlation=[$cor0], joinType=[inner], requiredColumns=[{2}])
-   :- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   :- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
    +- LogicalProject(s=[$0])
       +- Uncollect
          +- LogicalProject(c=[$cor0.c])
@@ -35,7 +35,7 @@ LogicalProject(a=[$0], s=[$3])
       <![CDATA[
 Calc(select=[a, f0 AS s])
 +- Correlate(invocation=[explode($cor0.c)], correlate=[table(explode($cor0.c))], select=[a,b,c,f0], rowType=[RecordType(INTEGER a, BIGINT b, VARCHAR(2147483647) ARRAY c, VARCHAR(2147483647) f0)], joinType=[INNER])
-   +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+   +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -57,7 +57,7 @@ LogicalProject(b=[$0], s=[$2])
       :- LogicalProject(b=[$0], set=[$2])
       :  +- LogicalAggregate(group=[{0, 1}], set=[COLLECT($0)])
       :     +- LogicalProject(b=[$1], $f1=[TUMBLE($3, 3000:INTERVAL SECOND)])
-      :        +- LogicalTableScan(table=[[MyTable]])
+      :        +- LogicalTableScan(table=[[default_catalog, default_database, MyTable]])
       +- LogicalProject(s=[$0])
          +- Uncollect
             +- LogicalProject(set=[$cor0.set])
@@ -74,7 +74,7 @@ Calc(select=[b, f0 AS s])
             +- LocalSortWindowAggregate(groupBy=[b], window=[TumblingGroupWindow], select=[b, Partial_COLLECT(b) AS set])
                +- Sort(orderBy=[b ASC, rowtime ASC])
                   +- Calc(select=[b, rowtime], where=[<(b, 3)])
-                     +- BoundedStreamScan(table=[[MyTable]], fields=[a, b, c, rowtime])
+                     +- BoundedStreamScan(table=[[default_catalog, default_database, MyTable]], fields=[a, b, c, rowtime])
 ]]>
     </Resource>
   </TestCase>
@@ -86,7 +86,7 @@ Calc(select=[b, f0 AS s])
       <![CDATA[
 LogicalProject(a=[$0], b=[$1], v=[$4])
 +- LogicalCorrelate(correlation=[$cor0], joinType=[inner], requiredColumns=[{2}])
-   :- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   :- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
    +- LogicalProject(k=[$0], v=[$1])
       +- Uncollect
          +- LogicalProject(c=[$cor0.c])
@@ -97,7 +97,7 @@ LogicalProject(a=[$0], b=[$1], v=[$4])
       <![CDATA[
 Calc(select=[a, b, f1 AS v])
 +- Correlate(invocation=[explode($cor0.c)], correlate=[table(explode($cor0.c))], select=[a,b,c,f0,f1], rowType=[RecordType(INTEGER a, BIGINT b, (VARCHAR(2147483647), VARCHAR(2147483647)) MAP c, VARCHAR(2147483647) f0, VARCHAR(2147483647) f1)], joinType=[INNER])
-   +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+   +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -117,7 +117,7 @@ LogicalProject(a=[$0], b=[$1], x=[$2], y=[$3])
    +- LogicalCorrelate(correlation=[$cor0], joinType=[inner], requiredColumns=[{1}])
       :- LogicalProject(a=[$0], b=[$1])
       :  +- LogicalFilter(condition=[<($0, 3)])
-      :     +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b)]]])
+      :     +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b)]]])
       +- LogicalProject(x=[$0], y=[$1])
          +- Uncollect
             +- LogicalProject(b=[$cor0.b])
@@ -129,7 +129,7 @@ LogicalProject(a=[$0], b=[$1], x=[$2], y=[$3])
 Calc(select=[a, b, _1, _2], where=[>(_1, a)])
 +- Correlate(invocation=[explode($cor0.b)], correlate=[table(explode($cor0.b))], select=[a,b,_1,_2], rowType=[RecordType(INTEGER a, RecordType:peek_no_expand(INTEGER _1, VARCHAR(2147483647) _2) ARRAY b, INTEGER _1, VARCHAR(2147483647) _2)], joinType=[INNER])
    +- Calc(select=[a, b], where=[<(a, 3)])
-      +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b)]]], fields=[a, b])
+      +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b)]]], fields=[a, b])
 ]]>
     </Resource>
   </TestCase>
@@ -147,7 +147,7 @@ LogicalProject(a=[$0], s=[$2])
    +- LogicalCorrelate(correlation=[$cor0], joinType=[left], requiredColumns=[{1}])
       :- LogicalAggregate(group=[{0}], set=[COLLECT($1)])
       :  +- LogicalProject(a=[$0], b=[$1])
-      :     +- LogicalTableScan(table=[[MyTable]])
+      :     +- LogicalTableScan(table=[[default_catalog, default_database, MyTable]])
       +- LogicalProject(s=[$0])
          +- Uncollect
             +- LogicalProject(set=[$cor0.set])
@@ -164,7 +164,7 @@ Calc(select=[a, f0 AS s])
             +- LocalSortAggregate(groupBy=[a], select=[a, Partial_COLLECT(b) AS set])
                +- Sort(orderBy=[a ASC])
                   +- Calc(select=[a, b], where=[<(a, 5)])
-                     +- BoundedStreamScan(table=[[MyTable]], fields=[a, b, c])
+                     +- BoundedStreamScan(table=[[default_catalog, default_database, MyTable]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -176,7 +176,7 @@ Calc(select=[a, f0 AS s])
       <![CDATA[
 LogicalProject(a=[$0], s=[$3])
 +- LogicalCorrelate(correlation=[$cor0], joinType=[inner], requiredColumns=[{2}])
-   :- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   :- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
    +- LogicalProject(s=[$0])
       +- Uncollect
          +- LogicalProject(c=[$cor0.c])
@@ -187,7 +187,7 @@ LogicalProject(a=[$0], s=[$3])
       <![CDATA[
 Calc(select=[a, f0 AS s])
 +- Correlate(invocation=[explode($cor0.c)], correlate=[table(explode($cor0.c))], select=[a,b,c,f0], rowType=[RecordType(INTEGER a, INTEGER ARRAY b, INTEGER ARRAY ARRAY c, INTEGER ARRAY f0)], joinType=[INNER])
-   +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+   +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -205,7 +205,7 @@ LogicalProject(b=[$0], id=[$2], point=[$3])
    +- LogicalCorrelate(correlation=[$cor0], joinType=[inner], requiredColumns=[{1}])
       :- LogicalAggregate(group=[{0}], set=[COLLECT($1)])
       :  +- LogicalProject(b=[$1], c=[$2])
-      :     +- LogicalTableScan(table=[[MyTable]])
+      :     +- LogicalTableScan(table=[[default_catalog, default_database, MyTable]])
       +- LogicalProject(id=[$0], point=[$1])
          +- Uncollect
             +- LogicalProject(set=[$cor0.set])
@@ -222,7 +222,7 @@ Calc(select=[b, _1 AS id, _2 AS point])
             +- LocalSortAggregate(groupBy=[b], select=[b, Partial_COLLECT(c) AS set])
                +- Sort(orderBy=[b ASC])
                   +- Calc(select=[b, c], where=[<(b, 3)])
-                     +- BoundedStreamScan(table=[[MyTable]], fields=[a, b, c])
+                     +- BoundedStreamScan(table=[[default_catalog, default_database, MyTable]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -234,7 +234,7 @@ Calc(select=[b, _1 AS id, _2 AS point])
       <![CDATA[
 LogicalProject(a=[$0], b=[$1], s=[$3])
 +- LogicalCorrelate(correlation=[$cor0], joinType=[inner], requiredColumns=[{1}])
-   :- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   :- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
    +- LogicalProject(s=[$0])
       +- Uncollect
          +- LogicalProject(b=[$cor0.b])
@@ -245,7 +245,7 @@ LogicalProject(a=[$0], b=[$1], s=[$3])
       <![CDATA[
 Calc(select=[a, b, f0 AS s])
 +- Correlate(invocation=[explode($cor0.b)], correlate=[table(explode($cor0.b))], select=[a,b,c,f0], rowType=[RecordType(INTEGER a, INTEGER ARRAY b, INTEGER ARRAY ARRAY c, INTEGER f0)], joinType=[INNER])
-   +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+   +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -258,7 +258,7 @@ Calc(select=[a, b, f0 AS s])
 LogicalProject(a=[$0], b=[$1], s=[$2], t=[$3])
 +- LogicalFilter(condition=[>($2, 13)])
    +- LogicalCorrelate(correlation=[$cor0], joinType=[inner], requiredColumns=[{1}])
-      :- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b)]]])
+      :- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b)]]])
       +- LogicalProject(s=[$0], t=[$1])
          +- Uncollect
             +- LogicalProject(b=[$cor0.b])
@@ -268,7 +268,7 @@ LogicalProject(a=[$0], b=[$1], s=[$2], t=[$3])
     <Resource name="planAfter">
       <![CDATA[
 Correlate(invocation=[explode($cor0.b)], correlate=[table(explode($cor0.b))], select=[a,b,_1,_2], rowType=[RecordType(INTEGER a, RecordType:peek_no_expand(INTEGER _1, VARCHAR(2147483647) _2) ARRAY b, INTEGER _1, VARCHAR(2147483647) _2)], joinType=[INNER], condition=[>($0, 13)])
-+- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b)]]], fields=[a, b])
++- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b)]]], fields=[a, b])
 ]]>
     </Resource>
   </TestCase>
@@ -281,7 +281,7 @@ Correlate(invocation=[explode($cor0.b)], correlate=[table(explode($cor0.b))], se
 LogicalProject(a=[$0], b=[$1], _1=[$2], _2=[$3])
 +- LogicalFilter(condition=[>($2, 1)])
    +- LogicalCorrelate(correlation=[$cor0], joinType=[inner], requiredColumns=[{1}])
-      :- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b)]]])
+      :- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b)]]])
       +- Uncollect
          +- LogicalProject(b=[$cor0.b])
             +- LogicalValues(tuples=[[{ 0 }]])
@@ -290,7 +290,7 @@ LogicalProject(a=[$0], b=[$1], _1=[$2], _2=[$3])
     <Resource name="planAfter">
       <![CDATA[
 Correlate(invocation=[explode($cor0.b)], correlate=[table(explode($cor0.b))], select=[a,b,_1,_2], rowType=[RecordType(INTEGER a, RecordType:peek_no_expand(INTEGER _1, VARCHAR(2147483647) _2) ARRAY b, INTEGER _1, VARCHAR(2147483647) _2)], joinType=[INNER], condition=[>($0, 1)])
-+- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b)]]], fields=[a, b])
++- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b)]]], fields=[a, b])
 ]]>
     </Resource>
   </TestCase>
diff --git a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/agg/AggregateReduceGroupingTest.xml b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/agg/AggregateReduceGroupingTest.xml
index d815d86..f964110 100644
--- a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/agg/AggregateReduceGroupingTest.xml
+++ b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/agg/AggregateReduceGroupingTest.xml
@@ -25,8 +25,8 @@ limitations under the License.
 LogicalAggregate(group=[{0, 1, 2, 3}], EXPR$4=[COUNT($4)])
 +- LogicalProject(a1=[$0], b1=[$1], a2=[$4], b2=[$5], c1=[$2])
    +- LogicalJoin(condition=[=($0, $5)], joinType=[full])
-      :- LogicalTableScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]])
-      +- LogicalTableScan(table=[[T2, source: [TestTableSource(a2, b2, c2)]]])
+      :- LogicalTableScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, T2, source: [TestTableSource(a2, b2, c2)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -37,10 +37,10 @@ Calc(select=[a1, b1, a2, b2, EXPR$4])
       +- HashJoin(joinType=[FullOuterJoin], where=[=(a1, b2)], select=[a1, b1, c1, a2, b2], build=[right])
          :- Exchange(distribution=[hash[a1]])
          :  +- Calc(select=[a1, b1, c1])
-         :     +- TableSourceScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
+         :     +- TableSourceScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
          +- Exchange(distribution=[hash[b2]])
             +- Calc(select=[a2, b2])
-               +- TableSourceScan(table=[[T2, source: [TestTableSource(a2, b2, c2)]]], fields=[a2, b2, c2])
+               +- TableSourceScan(table=[[default_catalog, default_database, T2, source: [TestTableSource(a2, b2, c2)]]], fields=[a2, b2, c2])
 ]]>
     </Resource>
   </TestCase>
@@ -53,8 +53,8 @@ Calc(select=[a1, b1, a2, b2, EXPR$4])
 LogicalAggregate(group=[{0, 1, 2, 3}], EXPR$4=[COUNT($4)])
 +- LogicalProject(a1=[$0], b1=[$1], a3=[$4], b3=[$5], c1=[$2])
    +- LogicalJoin(condition=[=($0, $4)], joinType=[full])
-      :- LogicalTableScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]])
-      +- LogicalTableScan(table=[[T3, source: [TestTableSource(a3, b3, c3, d3)]]])
+      :- LogicalTableScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, T3, source: [TestTableSource(a3, b3, c3, d3)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -66,10 +66,10 @@ Calc(select=[a1, b1, a3, b3, EXPR$4])
          +- HashJoin(joinType=[FullOuterJoin], where=[=(a1, a3)], select=[a1, b1, c1, a3, b3], build=[right])
             :- Exchange(distribution=[hash[a1]])
             :  +- Calc(select=[a1, b1, c1])
-            :     +- TableSourceScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
+            :     +- TableSourceScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
             +- Exchange(distribution=[hash[a3]])
                +- Calc(select=[a3, b3])
-                  +- TableSourceScan(table=[[T3, source: [TestTableSource(a3, b3, c3, d3)]]], fields=[a3, b3, c3, d3])
+                  +- TableSourceScan(table=[[default_catalog, default_database, T3, source: [TestTableSource(a3, b3, c3, d3)]]], fields=[a3, b3, c3, d3])
 ]]>
     </Resource>
   </TestCase>
@@ -83,8 +83,8 @@ LogicalAggregate(group=[{0, 1, 2, 3}], EXPR$4=[COUNT($4)])
 +- LogicalProject(a1=[$0], b1=[$1], a2=[$4], b2=[$5], c1=[$2])
    +- LogicalFilter(condition=[=($0, $5)])
       +- LogicalJoin(condition=[true], joinType=[inner])
-         :- LogicalTableScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]])
-         +- LogicalTableScan(table=[[T2, source: [TestTableSource(a2, b2, c2)]]])
+         :- LogicalTableScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]])
+         +- LogicalTableScan(table=[[default_catalog, default_database, T2, source: [TestTableSource(a2, b2, c2)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -93,10 +93,10 @@ HashAggregate(isMerge=[false], groupBy=[a1], auxGrouping=[b1, a2, b2], select=[a
 +- HashJoin(joinType=[InnerJoin], where=[=(a1, b2)], select=[a1, b1, c1, a2, b2], build=[right])
    :- Exchange(distribution=[hash[a1]])
    :  +- Calc(select=[a1, b1, c1])
-   :     +- TableSourceScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
+   :     +- TableSourceScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
    +- Exchange(distribution=[hash[b2]])
       +- Calc(select=[a2, b2])
-         +- TableSourceScan(table=[[T2, source: [TestTableSource(a2, b2, c2)]]], fields=[a2, b2, c2])
+         +- TableSourceScan(table=[[default_catalog, default_database, T2, source: [TestTableSource(a2, b2, c2)]]], fields=[a2, b2, c2])
 ]]>
     </Resource>
   </TestCase>
@@ -110,8 +110,8 @@ LogicalAggregate(group=[{0, 1, 2, 3}], EXPR$4=[COUNT($4)], EXPR$5=[AVG($5)])
 +- LogicalProject(a2=[$0], b2=[$1], a3=[$3], b3=[$4], c2=[$2], d3=[$6])
    +- LogicalFilter(condition=[=($1, $3)])
       +- LogicalJoin(condition=[true], joinType=[inner])
-         :- LogicalTableScan(table=[[T2, source: [TestTableSource(a2, b2, c2)]]])
-         +- LogicalTableScan(table=[[T3, source: [TestTableSource(a3, b3, c3, d3)]]])
+         :- LogicalTableScan(table=[[default_catalog, default_database, T2, source: [TestTableSource(a2, b2, c2)]]])
+         +- LogicalTableScan(table=[[default_catalog, default_database, T3, source: [TestTableSource(a3, b3, c3, d3)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -119,13 +119,13 @@ LogicalAggregate(group=[{0, 1, 2, 3}], EXPR$4=[COUNT($4)], EXPR$5=[AVG($5)])
 Calc(select=[a2, b2, a3, b3, *($f2, $f20) AS EXPR$4, /(CAST(CASE(=($f4, 0), null:BIGINT, $f3)), $f4) AS EXPR$5])
 +- HashJoin(joinType=[InnerJoin], where=[=(b2, a3)], select=[a2, b2, $f2, a3, b3, $f20, $f3, $f4], isBroadcast=[true], build=[right])
    :- Calc(select=[a2, b2, CAST(CASE(IS NOT NULL(c2), 1, 0)) AS $f2])
-   :  +- TableSourceScan(table=[[T2, source: [TestTableSource(a2, b2, c2)]]], fields=[a2, b2, c2])
+   :  +- TableSourceScan(table=[[default_catalog, default_database, T2, source: [TestTableSource(a2, b2, c2)]]], fields=[a2, b2, c2])
    +- Exchange(distribution=[broadcast])
       +- HashAggregate(isMerge=[true], groupBy=[a3, b3], select=[a3, b3, Final_COUNT(count1$0) AS $f2, Final_$SUM0(sum$1) AS $f3, Final_COUNT(count$2) AS $f4])
          +- Exchange(distribution=[hash[a3, b3]])
             +- LocalHashAggregate(groupBy=[a3, b3], select=[a3, b3, Partial_COUNT(*) AS count1$0, Partial_$SUM0(d3) AS sum$1, Partial_COUNT(d3) AS count$2])
                +- Calc(select=[a3, b3, d3])
-                  +- TableSourceScan(table=[[T3, source: [TestTableSource(a3, b3, c3, d3)]]], fields=[a3, b3, c3, d3])
+                  +- TableSourceScan(table=[[default_catalog, default_database, T3, source: [TestTableSource(a3, b3, c3, d3)]]], fields=[a3, b3, c3, d3])
 ]]>
     </Resource>
   </TestCase>
@@ -140,9 +140,9 @@ LogicalAggregate(group=[{0, 1, 2, 3, 4, 5}], EXPR$6=[COUNT($6)])
    +- LogicalFilter(condition=[AND(=($0, $5), =($0, $7))])
       +- LogicalJoin(condition=[true], joinType=[inner])
          :- LogicalJoin(condition=[true], joinType=[inner])
-         :  :- LogicalTableScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]])
-         :  +- LogicalTableScan(table=[[T2, source: [TestTableSource(a2, b2, c2)]]])
-         +- LogicalTableScan(table=[[T3, source: [TestTableSource(a3, b3, c3, d3)]]])
+         :  :- LogicalTableScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]])
+         :  +- LogicalTableScan(table=[[default_catalog, default_database, T2, source: [TestTableSource(a2, b2, c2)]]])
+         +- LogicalTableScan(table=[[default_catalog, default_database, T3, source: [TestTableSource(a3, b3, c3, d3)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -153,16 +153,16 @@ Calc(select=[a1, b1, a2, b2, a3, b3, *($f4, $f2) AS EXPR$6])
    :  +- HashJoin(joinType=[InnerJoin], where=[=(a1, b2)], select=[a1, b1, c1, a2, b2], build=[right])
    :     :- Exchange(distribution=[hash[a1]])
    :     :  +- Calc(select=[a1, b1, c1])
-   :     :     +- TableSourceScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
+   :     :     +- TableSourceScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
    :     +- Exchange(distribution=[hash[b2]])
    :        +- Calc(select=[a2, b2])
-   :           +- TableSourceScan(table=[[T2, source: [TestTableSource(a2, b2, c2)]]], fields=[a2, b2, c2])
+   :           +- TableSourceScan(table=[[default_catalog, default_database, T2, source: [TestTableSource(a2, b2, c2)]]], fields=[a2, b2, c2])
    +- Exchange(distribution=[broadcast])
       +- HashAggregate(isMerge=[true], groupBy=[a3, b3], select=[a3, b3, Final_COUNT(count1$0) AS $f2])
          +- Exchange(distribution=[hash[a3, b3]])
             +- LocalHashAggregate(groupBy=[a3, b3], select=[a3, b3, Partial_COUNT(*) AS count1$0])
                +- Calc(select=[a3, b3])
-                  +- TableSourceScan(table=[[T3, source: [TestTableSource(a3, b3, c3, d3)]]], fields=[a3, b3, c3, d3])
+                  +- TableSourceScan(table=[[default_catalog, default_database, T3, source: [TestTableSource(a3, b3, c3, d3)]]], fields=[a3, b3, c3, d3])
 ]]>
     </Resource>
   </TestCase>
@@ -175,8 +175,8 @@ Calc(select=[a1, b1, a2, b2, a3, b3, *($f4, $f2) AS EXPR$6])
 LogicalAggregate(group=[{0, 1, 2, 3}], EXPR$4=[COUNT($4)])
 +- LogicalProject(a1=[$0], b1=[$1], a2=[$4], b2=[$5], c1=[$2])
    +- LogicalJoin(condition=[=($0, $5)], joinType=[left])
-      :- LogicalTableScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]])
-      +- LogicalTableScan(table=[[T2, source: [TestTableSource(a2, b2, c2)]]])
+      :- LogicalTableScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, T2, source: [TestTableSource(a2, b2, c2)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -185,10 +185,10 @@ HashAggregate(isMerge=[false], groupBy=[a1], auxGrouping=[b1, a2, b2], select=[a
 +- HashJoin(joinType=[LeftOuterJoin], where=[=(a1, b2)], select=[a1, b1, c1, a2, b2], build=[right])
    :- Exchange(distribution=[hash[a1]])
    :  +- Calc(select=[a1, b1, c1])
-   :     +- TableSourceScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
+   :     +- TableSourceScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
    +- Exchange(distribution=[hash[b2]])
       +- Calc(select=[a2, b2])
-         +- TableSourceScan(table=[[T2, source: [TestTableSource(a2, b2, c2)]]], fields=[a2, b2, c2])
+         +- TableSourceScan(table=[[default_catalog, default_database, T2, source: [TestTableSource(a2, b2, c2)]]], fields=[a2, b2, c2])
 ]]>
     </Resource>
   </TestCase>
@@ -201,8 +201,8 @@ HashAggregate(isMerge=[false], groupBy=[a1], auxGrouping=[b1, a2, b2], select=[a
 LogicalAggregate(group=[{0, 1, 2, 3}], EXPR$4=[COUNT($4)])
 +- LogicalProject(a1=[$0], b1=[$1], a3=[$4], b3=[$5], c1=[$2])
    +- LogicalJoin(condition=[=($0, $4)], joinType=[left])
-      :- LogicalTableScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]])
-      +- LogicalTableScan(table=[[T3, source: [TestTableSource(a3, b3, c3, d3)]]])
+      :- LogicalTableScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, T3, source: [TestTableSource(a3, b3, c3, d3)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -213,10 +213,10 @@ Calc(select=[a1, b1, a3, b3, EXPR$4])
       +- LocalHashAggregate(groupBy=[a1, a3, b3], auxGrouping=[b1], select=[a1, a3, b3, b1, Partial_COUNT(c1) AS count$0])
          +- HashJoin(joinType=[LeftOuterJoin], where=[=(a1, a3)], select=[a1, b1, c1, a3, b3], isBroadcast=[true], build=[right])
             :- Calc(select=[a1, b1, c1])
-            :  +- TableSourceScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
+            :  +- TableSourceScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
             +- Exchange(distribution=[broadcast])
                +- Calc(select=[a3, b3])
-                  +- TableSourceScan(table=[[T3, source: [TestTableSource(a3, b3, c3, d3)]]], fields=[a3, b3, c3, d3])
+                  +- TableSourceScan(table=[[default_catalog, default_database, T3, source: [TestTableSource(a3, b3, c3, d3)]]], fields=[a3, b3, c3, d3])
 ]]>
     </Resource>
   </TestCase>
@@ -229,8 +229,8 @@ Calc(select=[a1, b1, a3, b3, EXPR$4])
 LogicalAggregate(group=[{0, 1, 2, 3}], EXPR$4=[COUNT($4)])
 +- LogicalProject(a3=[$0], b3=[$1], a1=[$4], b1=[$5], c1=[$6])
    +- LogicalJoin(condition=[=($4, $0)], joinType=[left])
-      :- LogicalTableScan(table=[[T3, source: [TestTableSource(a3, b3, c3, d3)]]])
-      +- LogicalTableScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]])
+      :- LogicalTableScan(table=[[default_catalog, default_database, T3, source: [TestTableSource(a3, b3, c3, d3)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -239,10 +239,10 @@ HashAggregate(isMerge=[false], groupBy=[a3, b3], auxGrouping=[a1, b1], select=[a
 +- HashJoin(joinType=[LeftOuterJoin], where=[=(a1, a3)], select=[a3, b3, a1, b1, c1], build=[left])
    :- Exchange(distribution=[hash[a3]])
    :  +- Calc(select=[a3, b3])
-   :     +- TableSourceScan(table=[[T3, source: [TestTableSource(a3, b3, c3, d3)]]], fields=[a3, b3, c3, d3])
+   :     +- TableSourceScan(table=[[default_catalog, default_database, T3, source: [TestTableSource(a3, b3, c3, d3)]]], fields=[a3, b3, c3, d3])
    +- Exchange(distribution=[hash[a1]])
       +- Calc(select=[a1, b1, c1])
-         +- TableSourceScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
+         +- TableSourceScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
 ]]>
     </Resource>
   </TestCase>
@@ -254,7 +254,7 @@ HashAggregate(isMerge=[false], groupBy=[a3, b3], auxGrouping=[a1, b1], select=[a
       <![CDATA[
 LogicalAggregate(group=[{0, 1, 2}], EXPR$3=[COUNT($3)])
 +- LogicalProject(a1=[$0], b1=[$1], c=[COUNT() OVER (PARTITION BY $2 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)], d1=[$3])
-   +- LogicalTableScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -267,7 +267,7 @@ Calc(select=[a1, b1, c, EXPR$3])
             +- OverAggregate(partitionBy=[c1], window#0=[COUNT(*) AS w0$o0 RANG BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING], select=[a1, b1, c1, d1, w0$o0])
                +- Sort(orderBy=[c1 ASC])
                   +- Exchange(distribution=[hash[c1]])
-                     +- TableSourceScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
+                     +- TableSourceScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
 ]]>
     </Resource>
   </TestCase>
@@ -280,8 +280,8 @@ Calc(select=[a1, b1, c, EXPR$3])
 LogicalAggregate(group=[{0, 1, 2, 3}], EXPR$4=[COUNT($4)])
 +- LogicalProject(a1=[$0], b1=[$1], a2=[$4], b2=[$5], c1=[$2])
    +- LogicalJoin(condition=[=($0, $5)], joinType=[right])
-      :- LogicalTableScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]])
-      +- LogicalTableScan(table=[[T2, source: [TestTableSource(a2, b2, c2)]]])
+      :- LogicalTableScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, T2, source: [TestTableSource(a2, b2, c2)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -291,10 +291,10 @@ Calc(select=[a1, b1, a2, b2, EXPR$4])
    +- HashJoin(joinType=[RightOuterJoin], where=[=(a1, b2)], select=[a1, b1, c1, a2, b2], build=[right])
       :- Exchange(distribution=[hash[a1]])
       :  +- Calc(select=[a1, b1, c1])
-      :     +- TableSourceScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
+      :     +- TableSourceScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
       +- Exchange(distribution=[hash[b2]])
          +- Calc(select=[a2, b2])
-            +- TableSourceScan(table=[[T2, source: [TestTableSource(a2, b2, c2)]]], fields=[a2, b2, c2])
+            +- TableSourceScan(table=[[default_catalog, default_database, T2, source: [TestTableSource(a2, b2, c2)]]], fields=[a2, b2, c2])
 ]]>
     </Resource>
   </TestCase>
@@ -307,8 +307,8 @@ Calc(select=[a1, b1, a2, b2, EXPR$4])
 LogicalAggregate(group=[{0, 1, 2, 3}], EXPR$4=[COUNT($4)])
 +- LogicalProject(a1=[$0], b1=[$1], a3=[$4], b3=[$5], c1=[$2])
    +- LogicalJoin(condition=[=($0, $4)], joinType=[right])
-      :- LogicalTableScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]])
-      +- LogicalTableScan(table=[[T3, source: [TestTableSource(a3, b3, c3, d3)]]])
+      :- LogicalTableScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, T3, source: [TestTableSource(a3, b3, c3, d3)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -318,10 +318,10 @@ Calc(select=[a1, b1, a3, b3, EXPR$4])
    +- HashJoin(joinType=[RightOuterJoin], where=[=(a1, a3)], select=[a1, b1, c1, a3, b3], build=[right])
       :- Exchange(distribution=[hash[a1]])
       :  +- Calc(select=[a1, b1, c1])
-      :     +- TableSourceScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
+      :     +- TableSourceScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
       +- Exchange(distribution=[hash[a3]])
          +- Calc(select=[a3, b3])
-            +- TableSourceScan(table=[[T3, source: [TestTableSource(a3, b3, c3, d3)]]], fields=[a3, b3, c3, d3])
+            +- TableSourceScan(table=[[default_catalog, default_database, T3, source: [TestTableSource(a3, b3, c3, d3)]]], fields=[a3, b3, c3, d3])
 ]]>
     </Resource>
   </TestCase>
@@ -334,8 +334,8 @@ Calc(select=[a1, b1, a3, b3, EXPR$4])
 LogicalAggregate(group=[{0, 1, 2, 3}], EXPR$4=[COUNT($4)])
 +- LogicalProject(a3=[$0], b3=[$1], a1=[$4], b1=[$5], c1=[$6])
    +- LogicalJoin(condition=[=($4, $0)], joinType=[right])
-      :- LogicalTableScan(table=[[T3, source: [TestTableSource(a3, b3, c3, d3)]]])
-      +- LogicalTableScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]])
+      :- LogicalTableScan(table=[[default_catalog, default_database, T3, source: [TestTableSource(a3, b3, c3, d3)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -346,9 +346,9 @@ HashAggregate(isMerge=[true], groupBy=[a3, b3, a1], auxGrouping=[b1], select=[a3
       +- HashJoin(joinType=[RightOuterJoin], where=[=(a1, a3)], select=[a3, b3, a1, b1, c1], isBroadcast=[true], build=[left])
          :- Exchange(distribution=[broadcast])
          :  +- Calc(select=[a3, b3])
-         :     +- TableSourceScan(table=[[T3, source: [TestTableSource(a3, b3, c3, d3)]]], fields=[a3, b3, c3, d3])
+         :     +- TableSourceScan(table=[[default_catalog, default_database, T3, source: [TestTableSource(a3, b3, c3, d3)]]], fields=[a3, b3, c3, d3])
          +- Calc(select=[a1, b1, c1])
-            +- TableSourceScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
+            +- TableSourceScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
 ]]>
     </Resource>
   </TestCase>
@@ -361,14 +361,14 @@ HashAggregate(isMerge=[true], groupBy=[a3, b3, a1], auxGrouping=[b1], select=[a3
 LogicalProject(a4=[$0], b4=[$1], EXPR$2=[$3])
 +- LogicalAggregate(group=[{0, 1, 2}], EXPR$2=[COUNT($3)])
    +- LogicalProject(a4=[$0], b4=[$1], $f2=[TUMBLE($3, 900000:INTERVAL MINUTE)], c4=[$2])
-      +- LogicalTableScan(table=[[T4, source: [TestTableSource(a4, b4, c4, d4)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, T4, source: [TestTableSource(a4, b4, c4, d4)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
 HashWindowAggregate(groupBy=[a4], auxGrouping=[b4], window=[TumblingGroupWindow], select=[a4, b4 AS EXPR$2, COUNT(c4) AS EXPR$2])
 +- Exchange(distribution=[hash[a4]])
-   +- TableSourceScan(table=[[T4, source: [TestTableSource(a4, b4, c4, d4)]]], fields=[a4, b4, c4, d4])
+   +- TableSourceScan(table=[[default_catalog, default_database, T4, source: [TestTableSource(a4, b4, c4, d4)]]], fields=[a4, b4, c4, d4])
 ]]>
     </Resource>
   </TestCase>
@@ -381,14 +381,14 @@ HashWindowAggregate(groupBy=[a4], auxGrouping=[b4], window=[TumblingGroupWindow]
 LogicalProject(a4=[$0], c4=[$1], EXPR$2=[$3], EXPR$3=[$4])
 +- LogicalAggregate(group=[{0, 1, 2}], EXPR$2=[COUNT($3)], EXPR$3=[AVG($3)])
    +- LogicalProject(a4=[$0], c4=[$2], $f2=[TUMBLE($3, 900000:INTERVAL MINUTE)], b4=[$1])
-      +- LogicalTableScan(table=[[T4, source: [TestTableSource(a4, b4, c4, d4)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, T4, source: [TestTableSource(a4, b4, c4, d4)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
 HashWindowAggregate(groupBy=[a4], auxGrouping=[c4], window=[TumblingGroupWindow], select=[a4, c4 AS EXPR$2, COUNT(b4) AS EXPR$2, AVG(b4) AS EXPR$3])
 +- Exchange(distribution=[hash[a4]])
-   +- TableSourceScan(table=[[T4, source: [TestTableSource(a4, b4, c4, d4)]]], fields=[a4, b4, c4, d4])
+   +- TableSourceScan(table=[[default_catalog, default_database, T4, source: [TestTableSource(a4, b4, c4, d4)]]], fields=[a4, b4, c4, d4])
 ]]>
     </Resource>
   </TestCase>
@@ -402,7 +402,7 @@ LogicalAggregate(group=[{0, 1, 2}], EXPR$3=[COUNT($3)])
 +- LogicalProject(a4=[$0], c4=[$1], s=[TUMBLE_START($2)], b4=[$3])
    +- LogicalAggregate(group=[{0, 1, 2}], b4=[VAR_POP($3)])
       +- LogicalProject(a4=[$0], c4=[$2], $f2=[TUMBLE($3, 900000:INTERVAL MINUTE)], b4=[$1])
-         +- LogicalTableScan(table=[[T4, source: [TestTableSource(a4, b4, c4, d4)]]])
+         +- LogicalTableScan(table=[[default_catalog, default_database, T4, source: [TestTableSource(a4, b4, c4, d4)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -415,7 +415,7 @@ Calc(select=[a4, c4, s, EXPR$3])
             +- HashWindowAggregate(groupBy=[a4], auxGrouping=[c4], window=[TumblingGroupWindow], properties=[w$start, w$end, w$rowtime], select=[a4, c4 AS $f2, SUM($f4) AS $f2, SUM(b4) AS $f3, COUNT(b4) AS $f4])
                +- Calc(select=[a4, c4, d4, b4, *(CAST(b4), CAST(b4)) AS $f4])
                   +- Exchange(distribution=[hash[a4]])
-                     +- TableSourceScan(table=[[T4, source: [TestTableSource(a4, b4, c4, d4)]]], fields=[a4, b4, c4, d4])
+                     +- TableSourceScan(table=[[default_catalog, default_database, T4, source: [TestTableSource(a4, b4, c4, d4)]]], fields=[a4, b4, c4, d4])
 ]]>
     </Resource>
   </TestCase>
@@ -429,7 +429,7 @@ LogicalAggregate(group=[{0, 1, 2}], EXPR$3=[COUNT($3)])
 +- LogicalProject(a4=[$0], c4=[$1], e=[TUMBLE_END($2)], b4=[$3])
    +- LogicalAggregate(group=[{0, 1, 2}], b4=[VAR_POP($3)])
       +- LogicalProject(a4=[$0], c4=[$2], $f2=[TUMBLE($3, 900000:INTERVAL MINUTE)], b4=[$1])
-         +- LogicalTableScan(table=[[T4, source: [TestTableSource(a4, b4, c4, d4)]]])
+         +- LogicalTableScan(table=[[default_catalog, default_database, T4, source: [TestTableSource(a4, b4, c4, d4)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -442,7 +442,7 @@ Calc(select=[a4, c4, e, EXPR$3])
             +- HashWindowAggregate(groupBy=[a4], auxGrouping=[c4], window=[TumblingGroupWindow], properties=[w$start, w$end, w$rowtime], select=[a4, c4 AS $f2, SUM($f4) AS $f2, SUM(b4) AS $f3, COUNT(b4) AS $f4])
                +- Calc(select=[a4, c4, d4, b4, *(CAST(b4), CAST(b4)) AS $f4])
                   +- Exchange(distribution=[hash[a4]])
-                     +- TableSourceScan(table=[[T4, source: [TestTableSource(a4, b4, c4, d4)]]], fields=[a4, b4, c4, d4])
+                     +- TableSourceScan(table=[[default_catalog, default_database, T4, source: [TestTableSource(a4, b4, c4, d4)]]], fields=[a4, b4, c4, d4])
 ]]>
     </Resource>
   </TestCase>
@@ -456,7 +456,7 @@ LogicalAggregate(group=[{0, 1, 2}], EXPR$3=[COUNT()])
 +- LogicalProject(a4=[$0], b4=[$3], c4=[$1])
    +- LogicalAggregate(group=[{0, 1, 2}], b4=[VAR_POP($3)])
       +- LogicalProject(a4=[$0], c4=[$2], $f2=[TUMBLE($3, 900000:INTERVAL MINUTE)], b4=[$1])
-         +- LogicalTableScan(table=[[T4, source: [TestTableSource(a4, b4, c4, d4)]]])
+         +- LogicalTableScan(table=[[default_catalog, default_database, T4, source: [TestTableSource(a4, b4, c4, d4)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -468,7 +468,7 @@ HashAggregate(isMerge=[true], groupBy=[a4, b4], auxGrouping=[c4], select=[a4, b4
          +- HashWindowAggregate(groupBy=[a4], auxGrouping=[c4], window=[TumblingGroupWindow], select=[a4, c4 AS $f2, SUM($f4) AS $f2, SUM(b4) AS $f3, COUNT(b4) AS $f4])
             +- Calc(select=[a4, c4, d4, b4, *(CAST(b4), CAST(b4)) AS $f4])
                +- Exchange(distribution=[hash[a4]])
-                  +- TableSourceScan(table=[[T4, source: [TestTableSource(a4, b4, c4, d4)]]], fields=[a4, b4, c4, d4])
+                  +- TableSourceScan(table=[[default_catalog, default_database, T4, source: [TestTableSource(a4, b4, c4, d4)]]], fields=[a4, b4, c4, d4])
 ]]>
     </Resource>
   </TestCase>
@@ -479,7 +479,7 @@ HashAggregate(isMerge=[true], groupBy=[a4, b4], auxGrouping=[c4], select=[a4, b4
     <Resource name="planBefore">
       <![CDATA[
 LogicalAggregate(group=[{0, 1, 2}], groups=[[{0, 1, 2}, {0, 1}, {0, 2}, {0}, {1, 2}, {1}, {2}, {}]], EXPR$3=[COUNT($3)])
-+- LogicalTableScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]])
++- LogicalTableScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -489,7 +489,7 @@ Calc(select=[a1, b1, c1, EXPR$3])
    +- Exchange(distribution=[hash[a1, b1, c1, $e]])
       +- LocalHashAggregate(groupBy=[a1, b1, c1, $e], select=[a1, b1, c1, $e, Partial_COUNT(d1) AS count$0])
          +- Expand(projects=[{a1=[$0], b1=[$1], c1=[$2], d1=[$3], $e=[0]}, {a1=[$0], b1=[$1], c1=[null], d1=[$3], $e=[1]}, {a1=[$0], b1=[null], c1=[$2], d1=[$3], $e=[2]}, {a1=[$0], b1=[null], c1=[null], d1=[$3], $e=[3]}, {a1=[null], b1=[$1], c1=[$2], d1=[$3], $e=[4]}, {a1=[null], b1=[$1], c1=[null], d1=[$3], $e=[5]}, {a1=[null], b1=[null], c1=[$2], d1=[$3], $e=[6]}, {a1=[null], b1=[null], c1=[null], d1=[$3], $e=[7]}], projects=[{a1, b1, c1, d1, 0 AS $e}, {a1, b1, null AS c1, d1, 1 AS $e} [...]
-            +- TableSourceScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
+            +- TableSourceScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
 ]]>
     </Resource>
   </TestCase>
@@ -500,7 +500,7 @@ Calc(select=[a1, b1, c1, EXPR$3])
     <Resource name="planBefore">
       <![CDATA[
 LogicalAggregate(group=[{0, 1, 2}], groups=[[{0, 1}, {0, 2}]], EXPR$3=[COUNT($3)])
-+- LogicalTableScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]])
++- LogicalTableScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -509,7 +509,7 @@ Calc(select=[a1, b1, c1, EXPR$3])
 +- HashAggregate(isMerge=[false], groupBy=[a1, b1, c1, $e], select=[a1, b1, c1, $e, COUNT(d1) AS EXPR$3])
    +- Exchange(distribution=[hash[a1, b1, c1, $e]])
       +- Expand(projects=[{a1=[$0], b1=[$1], c1=[null], d1=[$3], $e=[1]}, {a1=[$0], b1=[null], c1=[$2], d1=[$3], $e=[2]}], projects=[{a1, b1, null AS c1, d1, 1 AS $e}, {a1, null AS b1, c1, d1, 2 AS $e}])
-         +- TableSourceScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
+         +- TableSourceScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
 ]]>
     </Resource>
   </TestCase>
@@ -522,7 +522,7 @@ Calc(select=[a1, b1, c1, EXPR$3])
 LogicalProject(a1=[$0], s=[$2])
 +- LogicalAggregate(group=[{0, 1}], groups=[[{0, 1}, {0}, {}]], s=[SUM($2)])
    +- LogicalProject(a1=[$0], c1=[$2], b1=[$1])
-      +- LogicalTableScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -532,7 +532,7 @@ Calc(select=[a1, s])
    +- Exchange(distribution=[hash[a1, c1, $e]])
       +- Expand(projects=[{a1=[$0], c1=[$1], b1=[$2], $e=[0]}, {a1=[$0], c1=[null], b1=[$2], $e=[1]}, {a1=[null], c1=[null], b1=[$2], $e=[3]}], projects=[{a1, c1, b1, 0 AS $e}, {a1, null AS c1, b1, 1 AS $e}, {null AS a1, null AS c1, b1, 3 AS $e}])
          +- Calc(select=[a1, c1, b1])
-            +- TableSourceScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
+            +- TableSourceScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
 ]]>
     </Resource>
   </TestCase>
@@ -544,7 +544,7 @@ Calc(select=[a1, s])
       <![CDATA[
 LogicalProject(a1=[$0], b1=[$1], c1=[$2], EXPR$3=[$4])
 +- LogicalAggregate(group=[{0, 1, 2, 3}], groups=[[{0, 1, 2}, {0, 1, 3}]], EXPR$3=[COUNT($3)])
-   +- LogicalTableScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -553,7 +553,7 @@ Calc(select=[a1, b1, c1, EXPR$3])
 +- HashAggregate(isMerge=[false], groupBy=[a1, c1, d1, $e], auxGrouping=[b1], select=[a1, c1, d1, $e, b1, COUNT(d1_0) AS EXPR$3])
    +- Exchange(distribution=[hash[a1, c1, d1, $e]])
       +- Expand(projects=[{a1=[$0], b1=[$1], c1=[$2], d1=[null], $e=[1], d1_0=[$3]}, {a1=[$0], b1=[$1], c1=[null], d1=[$3], $e=[2], d1_0=[$3]}], projects=[{a1, b1, c1, null AS d1, 1 AS $e, d1 AS d1_0}, {a1, b1, null AS c1, d1, 2 AS $e, d1 AS d1_0}])
-         +- TableSourceScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
+         +- TableSourceScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
 ]]>
     </Resource>
   </TestCase>
@@ -565,7 +565,7 @@ Calc(select=[a1, b1, c1, EXPR$3])
       <![CDATA[
 LogicalAggregate(group=[{0, 1, 2}])
 +- LogicalProject(a1=[$0], b1=[$1], c1=[$2])
-   +- LogicalTableScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -573,7 +573,7 @@ LogicalAggregate(group=[{0, 1, 2}])
 HashAggregate(isMerge=[false], groupBy=[a1], auxGrouping=[b1, c1], select=[a1, b1, c1])
 +- Exchange(distribution=[hash[a1]])
    +- Calc(select=[a1, b1, c1])
-      +- TableSourceScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
+      +- TableSourceScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
 ]]>
     </Resource>
   </TestCase>
@@ -585,7 +585,7 @@ HashAggregate(isMerge=[false], groupBy=[a1], auxGrouping=[b1, c1], select=[a1, b
       <![CDATA[
 LogicalAggregate(group=[{0, 1}], EXPR$2=[COUNT($2)])
 +- LogicalProject(a3=[$0], b3=[$1], c3=[$2])
-   +- LogicalTableScan(table=[[T3, source: [TestTableSource(a3, b3, c3, d3)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, T3, source: [TestTableSource(a3, b3, c3, d3)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -594,7 +594,7 @@ HashAggregate(isMerge=[true], groupBy=[a3, b3], select=[a3, b3, Final_COUNT(coun
 +- Exchange(distribution=[hash[a3, b3]])
    +- LocalHashAggregate(groupBy=[a3, b3], select=[a3, b3, Partial_COUNT(c3) AS count$0])
       +- Calc(select=[a3, b3, c3])
-         +- TableSourceScan(table=[[T3, source: [TestTableSource(a3, b3, c3, d3)]]], fields=[a3, b3, c3, d3])
+         +- TableSourceScan(table=[[default_catalog, default_database, T3, source: [TestTableSource(a3, b3, c3, d3)]]], fields=[a3, b3, c3, d3])
 ]]>
     </Resource>
   </TestCase>
@@ -605,7 +605,7 @@ HashAggregate(isMerge=[true], groupBy=[a3, b3], select=[a3, b3, Final_COUNT(coun
     <Resource name="planBefore">
       <![CDATA[
 LogicalAggregate(group=[{0, 1, 2}], groups=[[{0, 1, 2}, {0, 1}, {0}, {}]], EXPR$3=[COUNT($3)])
-+- LogicalTableScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]])
++- LogicalTableScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -614,7 +614,7 @@ Calc(select=[a1, b1, c1, EXPR$3])
 +- HashAggregate(isMerge=[false], groupBy=[a1, b1, c1, $e], select=[a1, b1, c1, $e, COUNT(d1) AS EXPR$3])
    +- Exchange(distribution=[hash[a1, b1, c1, $e]])
       +- Expand(projects=[{a1=[$0], b1=[$1], c1=[$2], d1=[$3], $e=[0]}, {a1=[$0], b1=[$1], c1=[null], d1=[$3], $e=[1]}, {a1=[$0], b1=[null], c1=[null], d1=[$3], $e=[3]}, {a1=[null], b1=[null], c1=[null], d1=[$3], $e=[7]}], projects=[{a1, b1, c1, d1, 0 AS $e}, {a1, b1, null AS c1, d1, 1 AS $e}, {a1, null AS b1, null AS c1, d1, 3 AS $e}, {null AS a1, null AS b1, null AS c1, d1, 7 AS $e}])
-         +- TableSourceScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
+         +- TableSourceScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
 ]]>
     </Resource>
   </TestCase>
@@ -626,7 +626,7 @@ Calc(select=[a1, b1, c1, EXPR$3])
       <![CDATA[
 LogicalAggregate(group=[{0, 1, 2, 3, 4}], EXPR$5=[COUNT()])
 +- LogicalAggregate(group=[{0, 1, 2}], d1=[COUNT($3)], m=[MAX($3)])
-   +- LogicalTableScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -635,7 +635,7 @@ SortAggregate(isMerge=[false], groupBy=[a1], auxGrouping=[b1, c1, d1, m], select
 +- SortAggregate(isMerge=[false], groupBy=[a1], auxGrouping=[b1, c1], select=[a1, b1, c1, COUNT(d1) AS d1, MAX(d1) AS m])
    +- Sort(orderBy=[a1 ASC])
       +- Exchange(distribution=[hash[a1]])
-         +- TableSourceScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
+         +- TableSourceScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
 ]]>
     </Resource>
   </TestCase>
@@ -647,7 +647,7 @@ SortAggregate(isMerge=[false], groupBy=[a1], auxGrouping=[b1, c1, d1, m], select
       <![CDATA[
 LogicalAggregate(group=[{0, 1, 2, 3, 4}], EXPR$5=[COUNT()])
 +- LogicalAggregate(group=[{0, 1}], c=[COUNT($2)], s=[SUM($3)], a=[AVG($3)])
-   +- LogicalTableScan(table=[[T3, source: [TestTableSource(a3, b3, c3, d3)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, T3, source: [TestTableSource(a3, b3, c3, d3)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -656,7 +656,7 @@ HashAggregate(isMerge=[false], groupBy=[a3, b3], auxGrouping=[c, s, a], select=[
 +- HashAggregate(isMerge=[true], groupBy=[a3, b3], select=[a3, b3, Final_COUNT(count$0) AS c, Final_SUM(sum$1) AS s, Final_AVG(sum$2, count$3) AS a])
    +- Exchange(distribution=[hash[a3, b3]])
       +- LocalHashAggregate(groupBy=[a3, b3], select=[a3, b3, Partial_COUNT(c3) AS count$0, Partial_SUM(d3) AS sum$1, Partial_AVG(d3) AS (sum$2, count$3)])
-         +- TableSourceScan(table=[[T3, source: [TestTableSource(a3, b3, c3, d3)]]], fields=[a3, b3, c3, d3])
+         +- TableSourceScan(table=[[default_catalog, default_database, T3, source: [TestTableSource(a3, b3, c3, d3)]]], fields=[a3, b3, c3, d3])
 ]]>
     </Resource>
   </TestCase>
@@ -668,7 +668,7 @@ HashAggregate(isMerge=[false], groupBy=[a3, b3], auxGrouping=[c, s, a], select=[
       <![CDATA[
 LogicalAggregate(group=[{0}], EXPR$1=[COUNT(DISTINCT $1)], EXPR$2=[SUM(DISTINCT $1)])
 +- LogicalProject(a1=[$0], b1=[$1])
-   +- LogicalTableScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -676,7 +676,7 @@ LogicalAggregate(group=[{0}], EXPR$1=[COUNT(DISTINCT $1)], EXPR$2=[SUM(DISTINCT
 HashAggregate(isMerge=[false], groupBy=[a1], select=[a1, COUNT(b1) AS EXPR$1, SUM(b1) AS EXPR$2])
 +- Exchange(distribution=[hash[a1]])
    +- Calc(select=[a1, b1])
-      +- TableSourceScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
+      +- TableSourceScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
 ]]>
     </Resource>
   </TestCase>
@@ -688,7 +688,7 @@ HashAggregate(isMerge=[false], groupBy=[a1], select=[a1, COUNT(b1) AS EXPR$1, SU
       <![CDATA[
 LogicalAggregate(group=[{0, 1}], EXPR$2=[COUNT(DISTINCT $2)], EXPR$3=[SUM(DISTINCT $3)])
 +- LogicalProject(a1=[$0], d1=[$3], c1=[$2], b1=[$1])
-   +- LogicalTableScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -697,7 +697,7 @@ HashAggregate(isMerge=[false], groupBy=[a1], auxGrouping=[d1], select=[a1, d1, C
 +- Exchange(distribution=[hash[a1]])
    +- Calc(select=[a1, b1, c1, d1, =(CASE(=($e, 2:BIGINT), 2:BIGINT, 4:BIGINT), 2) AS $g_2, =(CASE(=($e, 2:BIGINT), 2:BIGINT, 4:BIGINT), 4) AS $g_4])
       +- Expand(projects=[{a1=[$0], b1=[$1], c1=[null], d1=[$3], $e=[2]}, {a1=[$0], b1=[null], c1=[$2], d1=[$3], $e=[4]}], projects=[{a1, b1, null AS c1, d1, 2 AS $e}, {a1, null AS b1, c1, d1, 4 AS $e}])
-         +- TableSourceScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
+         +- TableSourceScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
 ]]>
     </Resource>
   </TestCase>
@@ -709,13 +709,13 @@ HashAggregate(isMerge=[false], groupBy=[a1], auxGrouping=[d1], select=[a1, d1, C
       <![CDATA[
 LogicalAggregate(group=[{0}], EXPR$1=[SUM(DISTINCT $1)], EXPR$2=[MAX(DISTINCT $1)], EXPR$3=[MIN(DISTINCT $2)])
 +- LogicalProject(a1=[$0], b1=[$1], c1=[$2])
-   +- LogicalTableScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
 Calc(select=[a1, b1, b1 AS b10, c1])
-+- TableSourceScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
++- TableSourceScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
 ]]>
     </Resource>
   </TestCase>
@@ -727,7 +727,7 @@ Calc(select=[a1, b1, b1 AS b10, c1])
       <![CDATA[
 LogicalAggregate(group=[{0, 1}], EXPR$2=[COUNT(DISTINCT $2)], EXPR$3=[MAX(DISTINCT $3)], EXPR$4=[SUM($3)])
 +- LogicalProject(a1=[$0], d1=[$3], c1=[$2], b1=[$1])
-   +- LogicalTableScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -737,7 +737,7 @@ SortAggregate(isMerge=[false], groupBy=[a1], select=[a1, MIN(d1) FILTER $g_3 AS
    +- Exchange(distribution=[hash[a1]])
       +- Calc(select=[a1, b1, c1, d1, b1_0 AS EXPR$4, =(CASE(=($e, 1:BIGINT), 1:BIGINT, =($e, 2:BIGINT), 2:BIGINT, 3:BIGINT), 1) AS $g_1, =(CASE(=($e, 1:BIGINT), 1:BIGINT, =($e, 2:BIGINT), 2:BIGINT, 3:BIGINT), 2) AS $g_2, =(CASE(=($e, 1:BIGINT), 1:BIGINT, =($e, 2:BIGINT), 2:BIGINT, 3:BIGINT), 3) AS $g_3])
          +- Expand(projects=[{a1=[$0], b1=[$1], c1=[null], d1=[$3], $e=[1], b1_0=[$1]}, {a1=[$0], b1=[null], c1=[$2], d1=[$3], $e=[2], b1_0=[$1]}, {a1=[$0], b1=[null], c1=[null], d1=[$3], $e=[3], b1_0=[$1]}], projects=[{a1, b1, null AS c1, d1, 1 AS $e, b1 AS b1_0}, {a1, null AS b1, c1, d1, 2 AS $e, b1 AS b1_0}, {a1, null AS b1, null AS c1, d1, 3 AS $e, b1 AS b1_0}])
-            +- TableSourceScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
+            +- TableSourceScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
 ]]>
     </Resource>
   </TestCase>
@@ -750,7 +750,7 @@ SortAggregate(isMerge=[false], groupBy=[a1], select=[a1, MIN(d1) FILTER $g_3 AS
 LogicalProject(EXPR$0=[$2])
 +- LogicalAggregate(group=[{0, 1}], EXPR$0=[COUNT($2)])
    +- LogicalProject($f0=[1], $f1=[true], c1=[$2])
-      +- LogicalTableScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -760,7 +760,7 @@ Calc(select=[EXPR$0])
    +- Exchange(distribution=[hash[$f0]])
       +- LocalHashAggregate(groupBy=[$f0], select=[$f0, Partial_COUNT(c1) AS count$0])
          +- Calc(select=[1 AS $f0, true AS $f1, c1])
-            +- TableSourceScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
+            +- TableSourceScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
 ]]>
     </Resource>
   </TestCase>
@@ -772,7 +772,7 @@ Calc(select=[EXPR$0])
       <![CDATA[
 LogicalAggregate(group=[{0, 1}], EXPR$2=[COUNT($2)])
 +- LogicalProject(a3=[$0], b3=[$1], c3=[$2])
-   +- LogicalTableScan(table=[[T3, source: [TestTableSource(a3, b3, c3, d3)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, T3, source: [TestTableSource(a3, b3, c3, d3)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -781,7 +781,7 @@ HashAggregate(isMerge=[true], groupBy=[a3, b3], select=[a3, b3, Final_COUNT(coun
 +- Exchange(distribution=[hash[a3, b3]])
    +- LocalHashAggregate(groupBy=[a3, b3], select=[a3, b3, Partial_COUNT(c3) AS count$0])
       +- Calc(select=[a3, b3, c3])
-         +- TableSourceScan(table=[[T3, source: [TestTableSource(a3, b3, c3, d3)]]], fields=[a3, b3, c3, d3])
+         +- TableSourceScan(table=[[default_catalog, default_database, T3, source: [TestTableSource(a3, b3, c3, d3)]]], fields=[a3, b3, c3, d3])
 ]]>
     </Resource>
   </TestCase>
@@ -793,7 +793,7 @@ HashAggregate(isMerge=[true], groupBy=[a3, b3], select=[a3, b3, Final_COUNT(coun
       <![CDATA[
 LogicalAggregate(group=[{0, 1}], EXPR$2=[COUNT($2)])
 +- LogicalProject(a1=[$0], b1=[$1], c1=[$2])
-   +- LogicalTableScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -801,7 +801,7 @@ LogicalAggregate(group=[{0, 1}], EXPR$2=[COUNT($2)])
 HashAggregate(isMerge=[false], groupBy=[a1], auxGrouping=[b1], select=[a1, b1, COUNT(c1) AS EXPR$2])
 +- Exchange(distribution=[hash[a1]])
    +- Calc(select=[a1, b1, c1])
-      +- TableSourceScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
+      +- TableSourceScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
 ]]>
     </Resource>
   </TestCase>
@@ -813,14 +813,14 @@ HashAggregate(isMerge=[false], groupBy=[a1], auxGrouping=[b1], select=[a1, b1, C
       <![CDATA[
 LogicalAggregate(group=[{0, 1}], EXPR$2=[AVG($2)])
 +- LogicalProject(b2=[$1], c2=[$2], a2=[$0])
-   +- LogicalTableScan(table=[[T2, source: [TestTableSource(a2, b2, c2)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, T2, source: [TestTableSource(a2, b2, c2)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
 HashAggregate(isMerge=[false], groupBy=[b2], auxGrouping=[c2], select=[b2, c2, AVG(a2) AS EXPR$2])
 +- Exchange(distribution=[hash[b2]])
-   +- TableSourceScan(table=[[T2, source: [TestTableSource(a2, b2, c2)]]], fields=[a2, b2, c2])
+   +- TableSourceScan(table=[[default_catalog, default_database, T2, source: [TestTableSource(a2, b2, c2)]]], fields=[a2, b2, c2])
 ]]>
     </Resource>
   </TestCase>
@@ -833,7 +833,7 @@ HashAggregate(isMerge=[false], groupBy=[b2], auxGrouping=[c2], select=[b2, c2, A
 LogicalProject(a1=[$0], b1=[$1], EXPR$2=[$4])
 +- LogicalAggregate(group=[{0, 1, 2, 3}], EXPR$2=[COUNT($4)])
    +- LogicalProject(a1=[$0], b1=[$1], $f2=[1], $f3=[true], c1=[$2])
-      +- LogicalTableScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -841,7 +841,7 @@ LogicalProject(a1=[$0], b1=[$1], EXPR$2=[$4])
 HashAggregate(isMerge=[false], groupBy=[a1], auxGrouping=[b1], select=[a1, b1, COUNT(c1) AS EXPR$2])
 +- Exchange(distribution=[hash[a1]])
    +- Calc(select=[a1, b1, 1 AS $f2, true AS $f3, c1])
-      +- TableSourceScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
+      +- TableSourceScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
 ]]>
     </Resource>
   </TestCase>
@@ -853,7 +853,7 @@ HashAggregate(isMerge=[false], groupBy=[a1], auxGrouping=[b1], select=[a1, b1, C
       <![CDATA[
 LogicalAggregate(group=[{0}], EXPR$1=[COUNT(DISTINCT $1)])
 +- LogicalProject(a1=[$0], c1=[$2])
-   +- LogicalTableScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -861,7 +861,7 @@ LogicalAggregate(group=[{0}], EXPR$1=[COUNT(DISTINCT $1)])
 HashAggregate(isMerge=[false], groupBy=[a1], select=[a1, COUNT(c1) AS EXPR$1])
 +- Exchange(distribution=[hash[a1]])
    +- Calc(select=[a1, c1])
-      +- TableSourceScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
+      +- TableSourceScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
 ]]>
     </Resource>
   </TestCase>
@@ -873,7 +873,7 @@ HashAggregate(isMerge=[false], groupBy=[a1], select=[a1, COUNT(c1) AS EXPR$1])
       <![CDATA[
 LogicalAggregate(group=[{0, 1}], EXPR$2=[COUNT(DISTINCT $2)])
 +- LogicalProject(a1=[$0], b1=[$1], c1=[$2])
-   +- LogicalTableScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -881,7 +881,7 @@ LogicalAggregate(group=[{0, 1}], EXPR$2=[COUNT(DISTINCT $2)])
 HashAggregate(isMerge=[false], groupBy=[a1], auxGrouping=[b1], select=[a1, b1, COUNT(c1) AS EXPR$2])
 +- Exchange(distribution=[hash[a1]])
    +- Calc(select=[a1, b1, c1])
-      +- TableSourceScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
+      +- TableSourceScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
 ]]>
     </Resource>
   </TestCase>
@@ -893,7 +893,7 @@ HashAggregate(isMerge=[false], groupBy=[a1], auxGrouping=[b1], select=[a1, b1, C
       <![CDATA[
 LogicalAggregate(group=[{0}], EXPR$1=[COUNT(DISTINCT $1)], EXPR$2=[SUM($1)])
 +- LogicalProject(a1=[$0], b1=[$1])
-   +- LogicalTableScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -902,7 +902,7 @@ HashAggregate(isMerge=[false], groupBy=[a1], select=[a1, COUNT(b1) FILTER $g_0 A
 +- Exchange(distribution=[hash[a1]])
    +- Calc(select=[a1, b1, b1_0 AS EXPR$2, =(CASE(=($e, 0:BIGINT), 0:BIGINT, 1:BIGINT), 0) AS $g_0, =(CASE(=($e, 0:BIGINT), 0:BIGINT, 1:BIGINT), 1) AS $g_1])
       +- Expand(projects=[{a1=[$0], b1=[$1], c1=[$2], d1=[$3], $e=[0], b1_0=[$1]}, {a1=[$0], b1=[null], c1=[$2], d1=[$3], $e=[1], b1_0=[$1]}], projects=[{a1, b1, c1, d1, 0 AS $e, b1 AS b1_0}, {a1, null AS b1, c1, d1, 1 AS $e, b1 AS b1_0}])
-         +- TableSourceScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
+         +- TableSourceScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
 ]]>
     </Resource>
   </TestCase>
@@ -914,7 +914,7 @@ HashAggregate(isMerge=[false], groupBy=[a1], select=[a1, COUNT(b1) FILTER $g_0 A
       <![CDATA[
 LogicalAggregate(group=[{0, 1}], EXPR$2=[COUNT(DISTINCT $2)], EXPR$3=[SUM($2)])
 +- LogicalProject(a1=[$0], c1=[$2], b1=[$1])
-   +- LogicalTableScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -924,7 +924,7 @@ SortAggregate(isMerge=[false], groupBy=[a1], select=[a1, MIN(c1) FILTER $g_1 AS
    +- Exchange(distribution=[hash[a1]])
       +- Calc(select=[a1, b1, c1, b1_0 AS EXPR$3, =(CASE(=($e, 0:BIGINT), 0:BIGINT, 1:BIGINT), 0) AS $g_0, =(CASE(=($e, 0:BIGINT), 0:BIGINT, 1:BIGINT), 1) AS $g_1])
          +- Expand(projects=[{a1=[$0], b1=[$1], c1=[$2], d1=[$3], $e=[0], b1_0=[$1]}, {a1=[$0], b1=[null], c1=[$2], d1=[$3], $e=[1], b1_0=[$1]}], projects=[{a1, b1, c1, d1, 0 AS $e, b1 AS b1_0}, {a1, null AS b1, c1, d1, 1 AS $e, b1 AS b1_0}])
-            +- TableSourceScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
+            +- TableSourceScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
 ]]>
     </Resource>
   </TestCase>
@@ -936,7 +936,7 @@ SortAggregate(isMerge=[false], groupBy=[a1], select=[a1, MIN(c1) FILTER $g_1 AS
       <![CDATA[
 LogicalAggregate(group=[{0}], EXPR$1=[COUNT(DISTINCT $1)], EXPR$2=[SUM($2)])
 +- LogicalProject(a1=[$0], c1=[$2], b1=[$1])
-   +- LogicalTableScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -945,7 +945,7 @@ HashAggregate(isMerge=[false], groupBy=[a1], select=[a1, COUNT(c1) FILTER $g_0 A
 +- Exchange(distribution=[hash[a1]])
    +- Calc(select=[a1, c1, b1 AS EXPR$2, =(CASE(=($e, 0:BIGINT), 0:BIGINT, 1:BIGINT), 0) AS $g_0, =(CASE(=($e, 0:BIGINT), 0:BIGINT, 1:BIGINT), 1) AS $g_1])
       +- Expand(projects=[{a1=[$0], b1=[$1], c1=[$2], d1=[$3], $e=[0]}, {a1=[$0], b1=[$1], c1=[null], d1=[$3], $e=[1]}], projects=[{a1, b1, c1, d1, 0 AS $e}, {a1, b1, null AS c1, d1, 1 AS $e}])
-         +- TableSourceScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
+         +- TableSourceScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
 ]]>
     </Resource>
   </TestCase>
@@ -957,7 +957,7 @@ HashAggregate(isMerge=[false], groupBy=[a1], select=[a1, COUNT(c1) FILTER $g_0 A
       <![CDATA[
 LogicalAggregate(group=[{0, 1}], EXPR$2=[COUNT(DISTINCT $2)], EXPR$3=[SUM($3)])
 +- LogicalProject(a1=[$0], d1=[$3], c1=[$2], b1=[$1])
-   +- LogicalTableScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -967,7 +967,7 @@ SortAggregate(isMerge=[false], groupBy=[a1], select=[a1, MIN(d1) FILTER $g_1 AS
    +- Exchange(distribution=[hash[a1]])
       +- Calc(select=[a1, c1, d1, b1 AS EXPR$3, =(CASE(=($e, 0:BIGINT), 0:BIGINT, 1:BIGINT), 0) AS $g_0, =(CASE(=($e, 0:BIGINT), 0:BIGINT, 1:BIGINT), 1) AS $g_1])
          +- Expand(projects=[{a1=[$0], b1=[$1], c1=[$2], d1=[$3], $e=[0]}, {a1=[$0], b1=[$1], c1=[null], d1=[$3], $e=[1]}], projects=[{a1, b1, c1, d1, 0 AS $e}, {a1, b1, null AS c1, d1, 1 AS $e}])
-            +- TableSourceScan(table=[[T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
+            +- TableSourceScan(table=[[default_catalog, default_database, T1, source: [TestTableSource(a1, b1, c1, d1)]]], fields=[a1, b1, c1, d1])
 ]]>
     </Resource>
   </TestCase>
diff --git a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/agg/DistinctAggregateTest.xml b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/agg/DistinctAggregateTest.xml
index db0315d..91e43f6 100644
--- a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/agg/DistinctAggregateTest.xml
+++ b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/agg/DistinctAggregateTest.xml
@@ -24,7 +24,7 @@ limitations under the License.
       <![CDATA[
 LogicalAggregate(group=[{}], EXPR$0=[COUNT(DISTINCT $0)], EXPR$1=[SUM(DISTINCT $1)])
 +- LogicalProject(a=[$0], b=[$1])
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -38,7 +38,7 @@ SortAggregate(isMerge=[true], select=[Final_COUNT(count$0) AS EXPR$0, Final_SUM(
                +- LocalHashAggregate(groupBy=[a, b, $e], select=[a, b, $e])
                   +- Expand(projects=[{a=[$0], b=[null], $e=[1]}, {a=[null], b=[$1], $e=[2]}], projects=[{a, null AS b, 1 AS $e}, {null AS a, b, 2 AS $e}])
                      +- Calc(select=[a, b])
-                        +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+                        +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -50,7 +50,7 @@ SortAggregate(isMerge=[true], select=[Final_COUNT(count$0) AS EXPR$0, Final_SUM(
       <![CDATA[
 LogicalAggregate(group=[{}], EXPR$0=[COUNT(DISTINCT $0)], EXPR$1=[SUM(DISTINCT $0)], EXPR$2=[MAX(DISTINCT $0)])
 +- LogicalProject(a=[$0])
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -62,7 +62,7 @@ SortAggregate(isMerge=[true], select=[Final_COUNT(count$0) AS EXPR$0, Final_SUM(
          +- Exchange(distribution=[hash[a]])
             +- LocalHashAggregate(groupBy=[a], select=[a])
                +- Calc(select=[a])
-                  +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+                  +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -73,7 +73,7 @@ SortAggregate(isMerge=[true], select=[Final_COUNT(count$0) AS EXPR$0, Final_SUM(
     <Resource name="planBefore">
       <![CDATA[
 LogicalAggregate(group=[{}], EXPR$0=[COUNT(DISTINCT $0)], EXPR$1=[SUM(DISTINCT $1)], EXPR$2=[COUNT($2)])
-+- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
++- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -87,7 +87,7 @@ Calc(select=[EXPR$0, EXPR$1, CAST(CASE(IS NOT NULL(EXPR$2), EXPR$2, 0)) AS EXPR$
                +- Exchange(distribution=[hash[a, b, $e]])
                   +- LocalHashAggregate(groupBy=[a, b, $e], select=[a, b, $e, Partial_COUNT(c) AS count$0])
                      +- Expand(projects=[{a=[$0], b=[null], c=[$2], $e=[1]}, {a=[null], b=[$1], c=[$2], $e=[2]}, {a=[null], b=[null], c=[$2], $e=[3]}], projects=[{a, null AS b, c, 1 AS $e}, {null AS a, b, c, 2 AS $e}, {null AS a, null AS b, c, 3 AS $e}])
-                        +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+                        +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -99,7 +99,7 @@ Calc(select=[EXPR$0, EXPR$1, CAST(CASE(IS NOT NULL(EXPR$2), EXPR$2, 0)) AS EXPR$
       <![CDATA[
 LogicalAggregate(group=[{}], EXPR$0=[COUNT(DISTINCT $0)])
 +- LogicalProject(a=[$0])
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -111,7 +111,7 @@ SortAggregate(isMerge=[true], select=[Final_COUNT(count$0) AS EXPR$0])
          +- Exchange(distribution=[hash[a]])
             +- LocalHashAggregate(groupBy=[a], select=[a])
                +- Calc(select=[a])
-                  +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+                  +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -123,7 +123,7 @@ SortAggregate(isMerge=[true], select=[Final_COUNT(count$0) AS EXPR$0])
       <![CDATA[
 LogicalAggregate(group=[{}], EXPR$0=[COUNT(DISTINCT $0)], EXPR$1=[SUM($1)])
 +- LogicalProject(a=[$0], b=[$1])
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -137,7 +137,7 @@ SortAggregate(isMerge=[true], select=[Final_COUNT(count$0) AS EXPR$0, Final_MIN(
                +- LocalHashAggregate(groupBy=[a, $e], select=[a, $e, Partial_SUM(b) AS sum$0])
                   +- Expand(projects=[{a=[$0], b=[$1], $e=[0]}, {a=[null], b=[$1], $e=[1]}], projects=[{a, b, 0 AS $e}, {null AS a, b, 1 AS $e}])
                      +- Calc(select=[a, b])
-                        +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+                        +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -148,7 +148,7 @@ SortAggregate(isMerge=[true], select=[Final_COUNT(count$0) AS EXPR$0, Final_MIN(
     <Resource name="planBefore">
       <![CDATA[
 LogicalAggregate(group=[{0}], EXPR$1=[COUNT()], EXPR$2=[SUM(DISTINCT $1)], EXPR$3=[COUNT(DISTINCT $2)])
-+- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
++- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -162,7 +162,7 @@ Calc(select=[a, CAST(EXPR$1) AS EXPR$1, EXPR$2, EXPR$3])
                +- Exchange(distribution=[hash[a, b, c, $e]])
                   +- LocalHashAggregate(groupBy=[a, b, c, $e], select=[a, b, c, $e, Partial_COUNT(*) AS count1$0])
                      +- Expand(projects=[{a=[$0], b=[$1], c=[null], $e=[1]}, {a=[$0], b=[null], c=[$2], $e=[2]}, {a=[$0], b=[null], c=[null], $e=[3]}], projects=[{a, b, null AS c, 1 AS $e}, {a, null AS b, c, 2 AS $e}, {a, null AS b, null AS c, 3 AS $e}])
-                        +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+                        +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -174,7 +174,7 @@ Calc(select=[a, CAST(EXPR$1) AS EXPR$1, EXPR$2, EXPR$3])
       <![CDATA[
 LogicalAggregate(group=[{}], EXPR$0=[COUNT($0)], EXPR$1=[SUM(DISTINCT $1)])
 +- LogicalProject(a=[$0], b=[$1])
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -189,7 +189,7 @@ Calc(select=[CAST(CASE(IS NOT NULL(EXPR$0), EXPR$0, 0)) AS EXPR$0, EXPR$1])
                   +- LocalHashAggregate(groupBy=[b, $e], select=[b, $e, Partial_COUNT(a) AS count$0])
                      +- Expand(projects=[{a=[$0], b=[$1], $e=[0]}, {a=[$0], b=[null], $e=[1]}], projects=[{a, b, 0 AS $e}, {a, null AS b, 1 AS $e}])
                         +- Calc(select=[a, b])
-                           +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+                           +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -201,7 +201,7 @@ Calc(select=[CAST(CASE(IS NOT NULL(EXPR$0), EXPR$0, 0)) AS EXPR$0, EXPR$1])
       <![CDATA[
 LogicalAggregate(group=[{0}], EXPR$1=[COUNT($0)], EXPR$2=[SUM(DISTINCT $1)])
 +- LogicalProject(a=[$0], b=[$1])
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -216,7 +216,7 @@ Calc(select=[a, CAST(EXPR$1) AS EXPR$1, EXPR$2])
                   +- LocalHashAggregate(groupBy=[a, b, $e], select=[a, b, $e, Partial_COUNT(a) AS count$0])
                      +- Expand(projects=[{a=[$0], b=[$1], $e=[0]}, {a=[$0], b=[null], $e=[1]}], projects=[{a, b, 0 AS $e}, {a, null AS b, 1 AS $e}])
                         +- Calc(select=[a, b])
-                           +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+                           +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -228,7 +228,7 @@ Calc(select=[a, CAST(EXPR$1) AS EXPR$1, EXPR$2])
       <![CDATA[
 LogicalAggregate(group=[{0}], EXPR$1=[COUNT()], EXPR$2=[SUM(DISTINCT $1)])
 +- LogicalProject(a=[$0], b=[$1])
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -243,7 +243,7 @@ Calc(select=[a, CAST(EXPR$1) AS EXPR$1, EXPR$2])
                   +- LocalHashAggregate(groupBy=[a, b, $e], select=[a, b, $e, Partial_COUNT(*) AS count1$0])
                      +- Expand(projects=[{a=[$0], b=[$1], $e=[0]}, {a=[$0], b=[null], $e=[1]}], projects=[{a, b, 0 AS $e}, {a, null AS b, 1 AS $e}])
                         +- Calc(select=[a, b])
-                           +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+                           +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -255,7 +255,7 @@ Calc(select=[a, CAST(EXPR$1) AS EXPR$1, EXPR$2])
       <![CDATA[
 LogicalAggregate(group=[{0}], EXPR$1=[COUNT()], EXPR$2=[SUM(DISTINCT $1)], EXPR$3=[COUNT(DISTINCT $1)])
 +- LogicalProject(a=[$0], b=[$1])
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -270,7 +270,7 @@ Calc(select=[a, CAST(EXPR$1) AS EXPR$1, EXPR$2, EXPR$3])
                   +- LocalHashAggregate(groupBy=[a, b, $e], select=[a, b, $e, Partial_COUNT(*) AS count1$0])
                      +- Expand(projects=[{a=[$0], b=[$1], $e=[0]}, {a=[$0], b=[null], $e=[1]}], projects=[{a, b, 0 AS $e}, {a, null AS b, 1 AS $e}])
                         +- Calc(select=[a, b])
-                           +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+                           +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
diff --git a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/agg/GroupingSetsTest.xml b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/agg/GroupingSetsTest.xml
index b1b75dd..e142899 100644
--- a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/agg/GroupingSetsTest.xml
+++ b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/agg/GroupingSetsTest.xml
@@ -28,7 +28,7 @@ FROM emp GROUP BY CUBE(MOD(deptno, 20), gender)
 LogicalProject(d=[$0], c=[$2], g=[$1])
 +- LogicalAggregate(group=[{0, 1}], groups=[[{0, 1}, {0}, {1}, {}]], c=[COUNT()])
    +- LogicalProject(d=[MOD($1, 20)], g=[$2])
-      +- LogicalTableScan(table=[[emp, source: [TestTableSource(ename, deptno, gender)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, emp, source: [TestTableSource(ename, deptno, gender)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -39,7 +39,7 @@ Calc(select=[d, c, g])
       +- LocalHashAggregate(groupBy=[d, g, $e], select=[d, g, $e, Partial_COUNT(*) AS count1$0])
          +- Expand(projects=[{d=[$0], g=[$1], $e=[0]}, {d=[$0], g=[null], $e=[1]}, {d=[null], g=[$1], $e=[2]}, {d=[null], g=[null], $e=[3]}], projects=[{d, g, 0 AS $e}, {d, null AS g, 1 AS $e}, {null AS d, g, 2 AS $e}, {null AS d, null AS g, 3 AS $e}])
             +- Calc(select=[MOD(deptno, 20) AS d, gender AS g])
-               +- TableSourceScan(table=[[emp, source: [TestTableSource(ename, deptno, gender)]]], fields=[ename, deptno, gender])
+               +- TableSourceScan(table=[[default_catalog, default_database, emp, source: [TestTableSource(ename, deptno, gender)]]], fields=[ename, deptno, gender])
 ]]>
     </Resource>
   </TestCase>
@@ -52,7 +52,7 @@ Calc(select=[d, c, g])
 LogicalProject(c=[$1])
 +- LogicalAggregate(group=[{0}], groups=[[{0}, {}]], c=[COUNT()])
    +- LogicalProject($f0=[1])
-      +- LogicalTableScan(table=[[emp, source: [TestTableSource(ename, deptno, gender)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, emp, source: [TestTableSource(ename, deptno, gender)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -63,7 +63,7 @@ Calc(select=[c])
       +- LocalHashAggregate(groupBy=[$f0, $e], select=[$f0, $e, Partial_COUNT(*) AS count1$0])
          +- Expand(projects=[{$f0=[$0], $e=[0]}, {$f0=[null], $e=[1]}], projects=[{$f0, 0 AS $e}, {null AS $f0, 1 AS $e}])
             +- Calc(select=[1 AS $f0])
-               +- TableSourceScan(table=[[emp, source: [TestTableSource(ename, deptno, gender)]]], fields=[ename, deptno, gender])
+               +- TableSourceScan(table=[[default_catalog, default_database, emp, source: [TestTableSource(ename, deptno, gender)]]], fields=[ename, deptno, gender])
 ]]>
     </Resource>
   </TestCase>
@@ -79,7 +79,7 @@ FROM emp GROUP BY ROLLUP (deptno + 1)
 LogicalProject(d1=[$0], d0=[-($0, 1)], c=[$1])
 +- LogicalAggregate(group=[{0}], groups=[[{0}, {}]], c=[COUNT()])
    +- LogicalProject(d1=[+($1, 1)])
-      +- LogicalTableScan(table=[[emp, source: [TestTableSource(ename, deptno, gender)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, emp, source: [TestTableSource(ename, deptno, gender)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -90,7 +90,7 @@ Calc(select=[d1, -(d1, 1) AS d0, c])
       +- LocalHashAggregate(groupBy=[d1, $e], select=[d1, $e, Partial_COUNT(*) AS count1$0])
          +- Expand(projects=[{d1=[$0], $e=[0]}, {d1=[null], $e=[1]}], projects=[{d1, 0 AS $e}, {null AS d1, 1 AS $e}])
             +- Calc(select=[+(deptno, 1) AS d1])
-               +- TableSourceScan(table=[[emp, source: [TestTableSource(ename, deptno, gender)]]], fields=[ename, deptno, gender])
+               +- TableSourceScan(table=[[default_catalog, default_database, emp, source: [TestTableSource(ename, deptno, gender)]]], fields=[ename, deptno, gender])
 ]]>
     </Resource>
   </TestCase>
@@ -106,7 +106,7 @@ FROM emp GROUP BY ROLLUP(MOD(deptno, 20), gender)
 LogicalProject(d=[$0], c=[$2], g=[$1])
 +- LogicalAggregate(group=[{0, 1}], groups=[[{0, 1}, {0}, {}]], c=[COUNT()])
    +- LogicalProject(d=[MOD($1, 20)], g=[$2])
-      +- LogicalTableScan(table=[[emp, source: [TestTableSource(ename, deptno, gender)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, emp, source: [TestTableSource(ename, deptno, gender)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -117,7 +117,7 @@ Calc(select=[d, c, g])
       +- LocalHashAggregate(groupBy=[d, g, $e], select=[d, g, $e, Partial_COUNT(*) AS count1$0])
          +- Expand(projects=[{d=[$0], g=[$1], $e=[0]}, {d=[$0], g=[null], $e=[1]}, {d=[null], g=[null], $e=[3]}], projects=[{d, g, 0 AS $e}, {d, null AS g, 1 AS $e}, {null AS d, null AS g, 3 AS $e}])
             +- Calc(select=[MOD(deptno, 20) AS d, gender AS g])
-               +- TableSourceScan(table=[[emp, source: [TestTableSource(ename, deptno, gender)]]], fields=[ename, deptno, gender])
+               +- TableSourceScan(table=[[default_catalog, default_database, emp, source: [TestTableSource(ename, deptno, gender)]]], fields=[ename, deptno, gender])
 ]]>
     </Resource>
   </TestCase>
@@ -130,7 +130,7 @@ Calc(select=[d, c, g])
 LogicalProject(c=[$1])
 +- LogicalAggregate(group=[{0}], groups=[[{0}, {}]], c=[COUNT()])
    +- LogicalProject($f0=[1])
-      +- LogicalTableScan(table=[[emp, source: [TestTableSource(ename, deptno, gender)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, emp, source: [TestTableSource(ename, deptno, gender)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -141,7 +141,7 @@ Calc(select=[c])
       +- LocalHashAggregate(groupBy=[$f0, $e], select=[$f0, $e, Partial_COUNT(*) AS count1$0])
          +- Expand(projects=[{$f0=[$0], $e=[0]}, {$f0=[null], $e=[1]}], projects=[{$f0, 0 AS $e}, {null AS $f0, 1 AS $e}])
             +- Calc(select=[1 AS $f0])
-               +- TableSourceScan(table=[[emp, source: [TestTableSource(ename, deptno, gender)]]], fields=[ename, deptno, gender])
+               +- TableSourceScan(table=[[default_catalog, default_database, emp, source: [TestTableSource(ename, deptno, gender)]]], fields=[ename, deptno, gender])
 ]]>
     </Resource>
   </TestCase>
@@ -153,7 +153,7 @@ Calc(select=[c])
       <![CDATA[
 LogicalAggregate(group=[{0}], groups=[[{0}, {}]], c=[COUNT()])
 +- LogicalProject(deptno=[$2])
-   +- LogicalTableScan(table=[[emps, source: [TestTableSource(empno, name, deptno, gender, city, empid, age, slacker, manager, joinedat)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, emps, source: [TestTableSource(empno, name, deptno, gender, city, empid, age, slacker, manager, joinedat)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -164,7 +164,7 @@ Calc(select=[deptno, c])
       +- LocalHashAggregate(groupBy=[deptno, $e], select=[deptno, $e, Partial_COUNT(*) AS count1$0])
          +- Expand(projects=[{deptno=[$0], $e=[0]}, {deptno=[null], $e=[1]}], projects=[{deptno, 0 AS $e}, {null AS deptno, 1 AS $e}])
             +- Calc(select=[deptno])
-               +- TableSourceScan(table=[[emps, source: [TestTableSource(empno, name, deptno, gender, city, empid, age, slacker, manager, joinedat)]]], fields=[empno, name, deptno, gender, city, empid, age, slacker, manager, joinedat])
+               +- TableSourceScan(table=[[default_catalog, default_database, emps, source: [TestTableSource(empno, name, deptno, gender, city, empid, age, slacker, manager, joinedat)]]], fields=[empno, name, deptno, gender, city, empid, age, slacker, manager, joinedat])
 ]]>
     </Resource>
   </TestCase>
@@ -179,7 +179,7 @@ FROM scott_emp GROUP BY GROUPING SETS (deptno, (), ())
       <![CDATA[
 LogicalAggregate(group=[{0}], groups=[[{0}, {}]], g=[GROUP_ID()], c=[COUNT()])
 +- LogicalProject(deptno=[$7])
-   +- LogicalTableScan(table=[[scott_emp, source: [TestTableSource(empno, ename, job, mgr, hiredate, sal, comm, deptno)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, scott_emp, source: [TestTableSource(empno, ename, job, mgr, hiredate, sal, comm, deptno)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -190,7 +190,7 @@ Calc(select=[deptno, 0:BIGINT AS g, c])
       +- LocalHashAggregate(groupBy=[deptno, $e], select=[deptno, $e, Partial_COUNT(*) AS count1$0])
          +- Expand(projects=[{deptno=[$0], $e=[0]}, {deptno=[null], $e=[1]}], projects=[{deptno, 0 AS $e}, {null AS deptno, 1 AS $e}])
             +- Calc(select=[deptno])
-               +- TableSourceScan(table=[[scott_emp, source: [TestTableSource(empno, ename, job, mgr, hiredate, sal, comm, deptno)]]], fields=[empno, ename, job, mgr, hiredate, sal, comm, deptno])
+               +- TableSourceScan(table=[[default_catalog, default_database, scott_emp, source: [TestTableSource(empno, ename, job, mgr, hiredate, sal, comm, deptno)]]], fields=[empno, ename, job, mgr, hiredate, sal, comm, deptno])
 ]]>
     </Resource>
   </TestCase>
@@ -213,7 +213,7 @@ FROM MyTable
       <![CDATA[
 LogicalAggregate(group=[{0, 1}], groups=[[{0, 1}, {0}, {1}, {}]], a=[AVG($2)], g=[GROUP_ID()], gb=[GROUPING($0)], gc=[GROUPING($1)], gib=[GROUPING_ID($0)], gic=[GROUPING_ID($1)], gid=[GROUPING_ID($0, $1)])
 +- LogicalProject(b=[$1], c=[$2], a=[$0])
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -223,7 +223,7 @@ Calc(select=[b, c, a, 0:BIGINT AS g, CASE(OR(=($e, 0:BIGINT), =($e, 1:BIGINT)),
    +- Exchange(distribution=[hash[b, c, $e]])
       +- LocalHashAggregate(groupBy=[b, c, $e], select=[b, c, $e, Partial_AVG(a) AS (sum$0, count$1)])
          +- Expand(projects=[{a=[$0], b=[$1], c=[$2], $e=[0]}, {a=[$0], b=[$1], c=[null], $e=[1]}, {a=[$0], b=[null], c=[$2], $e=[2]}, {a=[$0], b=[null], c=[null], $e=[3]}], projects=[{a, b, c, 0 AS $e}, {a, b, null AS c, 1 AS $e}, {a, null AS b, c, 2 AS $e}, {a, null AS b, null AS c, 3 AS $e}])
-            +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+            +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -237,7 +237,7 @@ LogicalAggregate(group=[{0}])
 +- LogicalProject(EXPR$0=[$2])
    +- LogicalAggregate(group=[{0, 1}], groups=[[{0, 1}, {0}, {1}, {}]], EXPR$0=[COUNT()])
       +- LogicalProject(deptno=[$1], gender=[$2])
-         +- LogicalTableScan(table=[[emp, source: [TestTableSource(ename, deptno, gender)]]])
+         +- LogicalTableScan(table=[[default_catalog, default_database, emp, source: [TestTableSource(ename, deptno, gender)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -251,7 +251,7 @@ HashAggregate(isMerge=[true], groupBy=[EXPR$0], select=[EXPR$0])
                +- LocalHashAggregate(groupBy=[deptno, gender, $e], select=[deptno, gender, $e, Partial_COUNT(*) AS count1$0])
                   +- Expand(projects=[{deptno=[$0], gender=[$1], $e=[0]}, {deptno=[$0], gender=[null], $e=[1]}, {deptno=[null], gender=[$1], $e=[2]}, {deptno=[null], gender=[null], $e=[3]}], projects=[{deptno, gender, 0 AS $e}, {deptno, null AS gender, 1 AS $e}, {null AS deptno, gender, 2 AS $e}, {null AS deptno, null AS gender, 3 AS $e}])
                      +- Calc(select=[deptno, gender])
-                        +- TableSourceScan(table=[[emp, source: [TestTableSource(ename, deptno, gender)]]], fields=[ename, deptno, gender])
+                        +- TableSourceScan(table=[[default_catalog, default_database, emp, source: [TestTableSource(ename, deptno, gender)]]], fields=[ename, deptno, gender])
 ]]>
     </Resource>
   </TestCase>
@@ -272,8 +272,8 @@ LogicalProject(deptno=[$0], gender=[$2], min_name=[$3])
    +- LogicalAggregate(group=[{0, 1, 2}], groups=[[{0, 1, 2}, {0, 1}, {0, 2}, {0}, {1, 2}, {1}, {2}, {}]], min_name=[MIN($3)], agg#1=[COUNT()])
       +- LogicalProject(deptno=[$1], deptno0=[$3], gender=[$2], ename=[$0])
          +- LogicalJoin(condition=[=($1, $3)], joinType=[inner])
-            :- LogicalTableScan(table=[[emp, source: [TestTableSource(ename, deptno, gender)]]])
-            +- LogicalTableScan(table=[[dept, source: [TestTableSource(deptno, dname)]]])
+            :- LogicalTableScan(table=[[default_catalog, default_database, emp, source: [TestTableSource(ename, deptno, gender)]]])
+            +- LogicalTableScan(table=[[default_catalog, default_database, dept, source: [TestTableSource(deptno, dname)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -285,10 +285,10 @@ Calc(select=[deptno, gender, min_name], where=[OR(>($f5, 2), AND(=(gender, _UTF-
          +- Expand(projects=[{ename=[$0], deptno=[$1], gender=[$2], deptno0=[$3], $e=[0]}, {ename=[$0], deptno=[$1], gender=[$2], deptno0=[null], $e=[1]}, {ename=[$0], deptno=[$1], gender=[null], deptno0=[$3], $e=[2]}, {ename=[$0], deptno=[$1], gender=[null], deptno0=[null], $e=[3]}, {ename=[$0], deptno=[null], gender=[$2], deptno0=[$3], $e=[4]}, {ename=[$0], deptno=[null], gender=[$2], deptno0=[null], $e=[5]}, {ename=[$0], deptno=[null], gender=[null], deptno0=[$3], $e=[6]}, {ename=[$0] [...]
             +- HashJoin(joinType=[InnerJoin], where=[=(deptno, deptno0)], select=[ename, deptno, gender, deptno0], build=[right])
                :- Exchange(distribution=[hash[deptno]])
-               :  +- TableSourceScan(table=[[emp, source: [TestTableSource(ename, deptno, gender)]]], fields=[ename, deptno, gender])
+               :  +- TableSourceScan(table=[[default_catalog, default_database, emp, source: [TestTableSource(ename, deptno, gender)]]], fields=[ename, deptno, gender])
                +- Exchange(distribution=[hash[deptno]])
                   +- Calc(select=[deptno])
-                     +- TableSourceScan(table=[[dept, source: [TestTableSource(deptno, dname)]]], fields=[deptno, dname])
+                     +- TableSourceScan(table=[[default_catalog, default_database, dept, source: [TestTableSource(deptno, dname)]]], fields=[deptno, dname])
 ]]>
     </Resource>
   </TestCase>
@@ -311,7 +311,7 @@ FROM MyTable
       <![CDATA[
 LogicalAggregate(group=[{0, 1}], groups=[[{0, 1}, {0}, {1}, {}]], a=[AVG($2)], g=[GROUP_ID()], gb=[GROUPING($0)], gc=[GROUPING($1)], gib=[GROUPING_ID($0)], gic=[GROUPING_ID($1)], gid=[GROUPING_ID($0, $1)])
 +- LogicalProject(b=[$1], c=[$2], a=[$0])
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -321,7 +321,7 @@ Calc(select=[b, c, a, 0:BIGINT AS g, CASE(OR(=($e, 0:BIGINT), =($e, 1:BIGINT)),
    +- Exchange(distribution=[hash[b, c, $e]])
       +- LocalHashAggregate(groupBy=[b, c, $e], select=[b, c, $e, Partial_AVG(a) AS (sum$0, count$1)])
          +- Expand(projects=[{a=[$0], b=[$1], c=[$2], $e=[0]}, {a=[$0], b=[$1], c=[null], $e=[1]}, {a=[$0], b=[null], c=[$2], $e=[2]}, {a=[$0], b=[null], c=[null], $e=[3]}], projects=[{a, b, c, 0 AS $e}, {a, b, null AS c, 1 AS $e}, {a, null AS b, c, 2 AS $e}, {a, null AS b, null AS c, 3 AS $e}])
-            +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+            +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -341,7 +341,7 @@ LogicalProject(deptno=[$1], gender=[$0], EXPR$2=[$2], c=[$3])
 +- LogicalAggregate(group=[{0, 1}], groups=[[{0, 1}, {0}, {}]], EXPR$2=[GROUPING_ID($1, $0, $1)], c=[COUNT()])
    +- LogicalProject(gender=[$2], deptno=[$1])
       +- LogicalFilter(condition=[=($1, 10)])
-         +- LogicalTableScan(table=[[emp, source: [TestTableSource(ename, deptno, gender)]]])
+         +- LogicalTableScan(table=[[default_catalog, default_database, emp, source: [TestTableSource(ename, deptno, gender)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -352,7 +352,7 @@ Calc(select=[deptno, gender, CASE(=($e, 0:BIGINT), 0:BIGINT, =($e, 1:BIGINT), 5:
       +- LocalHashAggregate(groupBy=[gender, deptno, $e], select=[gender, deptno, $e, Partial_COUNT(*) AS count1$0])
          +- Expand(projects=[{gender=[$0], deptno=[$1], $e=[0]}, {gender=[$0], deptno=[null], $e=[1]}, {gender=[null], deptno=[null], $e=[3]}], projects=[{gender, deptno, 0 AS $e}, {gender, null AS deptno, 1 AS $e}, {null AS gender, null AS deptno, 3 AS $e}])
             +- Calc(select=[gender, CAST(10) AS deptno], where=[=(deptno, 10)])
-               +- TableSourceScan(table=[[emp, source: [TestTableSource(ename, deptno, gender)]]], fields=[ename, deptno, gender])
+               +- TableSourceScan(table=[[default_catalog, default_database, emp, source: [TestTableSource(ename, deptno, gender)]]], fields=[ename, deptno, gender])
 ]]>
     </Resource>
   </TestCase>
@@ -365,7 +365,7 @@ Calc(select=[deptno, gender, CASE(=($e, 0:BIGINT), 0:BIGINT, =($e, 1:BIGINT), 5:
 LogicalProject(EXPR$0=[+($0, 1)], c=[$2])
 +- LogicalAggregate(group=[{0, 1}], groups=[[{0, 1}, {0}, {1}, {}]], c=[COUNT()])
    +- LogicalProject(deptno=[$1], gender=[$2])
-      +- LogicalTableScan(table=[[emp, source: [TestTableSource(ename, deptno, gender)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, emp, source: [TestTableSource(ename, deptno, gender)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -376,7 +376,7 @@ Calc(select=[+(deptno, 1) AS EXPR$0, c])
       +- LocalHashAggregate(groupBy=[deptno, gender, $e], select=[deptno, gender, $e, Partial_COUNT(*) AS count1$0])
          +- Expand(projects=[{deptno=[$0], gender=[$1], $e=[0]}, {deptno=[$0], gender=[null], $e=[1]}, {deptno=[null], gender=[$1], $e=[2]}, {deptno=[null], gender=[null], $e=[3]}], projects=[{deptno, gender, 0 AS $e}, {deptno, null AS gender, 1 AS $e}, {null AS deptno, gender, 2 AS $e}, {null AS deptno, null AS gender, 3 AS $e}])
             +- Calc(select=[deptno, gender])
-               +- TableSourceScan(table=[[emp, source: [TestTableSource(ename, deptno, gender)]]], fields=[ename, deptno, gender])
+               +- TableSourceScan(table=[[default_catalog, default_database, emp, source: [TestTableSource(ename, deptno, gender)]]], fields=[ename, deptno, gender])
 ]]>
     </Resource>
   </TestCase>
@@ -401,7 +401,7 @@ LogicalSort(sort0=[$0], sort1=[$1], sort2=[$2], dir0=[ASC-nulls-first], dir1=[AS
 +- LogicalProject(deptno=[$0], job=[$1], empno=[$2], ename=[$3], sumsal=[$4], gr_text=[CASE(=($5, 0), _UTF-16LE'grouped by deptno,job,empno,ename':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", =($5, 1), _UTF-16LE'grouped by deptno,job':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", =($5, 3), _UTF-16LE'grouped by deptno':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", =($5, 7), _UTF-16LE'grouped by ()':VARCHAR(2147483647) CHARACTER SET "UTF-16LE", null:VARCHAR(2147483647) CHARACTER SET "UTF- [...]
    +- LogicalAggregate(group=[{0, 1, 2, 3}], groups=[[{0, 1, 2, 3}, {0, 1}, {0}, {}]], sumsal=[SUM($4)], agg#1=[GROUPING_ID($0, $1, $2)])
       +- LogicalProject(deptno=[$7], job=[$2], empno=[$0], ename=[$1], sal=[$5])
-         +- LogicalTableScan(table=[[scott_emp, source: [TestTableSource(empno, ename, job, mgr, hiredate, sal, comm, deptno)]]])
+         +- LogicalTableScan(table=[[default_catalog, default_database, scott_emp, source: [TestTableSource(empno, ename, job, mgr, hiredate, sal, comm, deptno)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -415,7 +415,7 @@ Calc(select=[deptno, job, empno, ename, sumsal, CASE(=(CASE(=($e, 0:BIGINT), 0:B
                +- LocalHashAggregate(groupBy=[deptno, job, empno, ename, $e], select=[deptno, job, empno, ename, $e, Partial_SUM(sal) AS sum$0])
                   +- Expand(projects=[{deptno=[$0], job=[$1], empno=[$2], ename=[$3], sal=[$4], $e=[0]}, {deptno=[$0], job=[$1], empno=[null], ename=[null], sal=[$4], $e=[3]}, {deptno=[$0], job=[null], empno=[null], ename=[null], sal=[$4], $e=[7]}, {deptno=[null], job=[null], empno=[null], ename=[null], sal=[$4], $e=[15]}], projects=[{deptno, job, empno, ename, sal, 0 AS $e}, {deptno, job, null AS empno, null AS ename, sal, 3 AS $e}, {deptno, null AS job, null AS empno, null AS ename, sa [...]
                      +- Calc(select=[deptno, job, empno, ename, sal])
-                        +- TableSourceScan(table=[[scott_emp, source: [TestTableSource(empno, ename, job, mgr, hiredate, sal, comm, deptno)]]], fields=[empno, ename, job, mgr, hiredate, sal, comm, deptno])
+                        +- TableSourceScan(table=[[default_catalog, default_database, scott_emp, source: [TestTableSource(empno, ename, job, mgr, hiredate, sal, comm, deptno)]]], fields=[empno, ename, job, mgr, hiredate, sal, comm, deptno])
 ]]>
     </Resource>
   </TestCase>
@@ -438,7 +438,7 @@ LogicalProject(c=[$2], gd=[$3], gid=[$4], gdgd=[$5], gidgd=[$6])
 +- LogicalFilter(condition=[<=($3, $6)])
    +- LogicalAggregate(group=[{0, 1}], groups=[[{0, 1}, {0}, {}]], c=[COUNT()], gd=[GROUPING($0)], gid=[GROUPING_ID($0)], gdgd=[GROUPING($0, $1, $0)], gidgd=[GROUPING_ID($0, $1, $0)])
       +- LogicalProject(deptno=[$1], gender=[$2])
-         +- LogicalTableScan(table=[[emp, source: [TestTableSource(ename, deptno, gender)]]])
+         +- LogicalTableScan(table=[[default_catalog, default_database, emp, source: [TestTableSource(ename, deptno, gender)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -450,7 +450,7 @@ Calc(select=[c, CASE(OR(=($e, 0:BIGINT), =($e, 1:BIGINT)), 0:BIGINT, 1:BIGINT) A
          +- Calc(select=[deptno, gender, $e], where=[<=(CASE(OR(=($e, 0:BIGINT), =($e, 1:BIGINT)), 0:BIGINT, 1:BIGINT), CASE(=($e, 0:BIGINT), 0:BIGINT, =($e, 1:BIGINT), 2:BIGINT, 7:BIGINT))])
             +- Expand(projects=[{deptno=[$0], gender=[$1], $e=[0]}, {deptno=[$0], gender=[null], $e=[1]}, {deptno=[null], gender=[null], $e=[3]}], projects=[{deptno, gender, 0 AS $e}, {deptno, null AS gender, 1 AS $e}, {null AS deptno, null AS gender, 3 AS $e}])
                +- Calc(select=[deptno, gender])
-                  +- TableSourceScan(table=[[emp, source: [TestTableSource(ename, deptno, gender)]]], fields=[ename, deptno, gender])
+                  +- TableSourceScan(table=[[default_catalog, default_database, emp, source: [TestTableSource(ename, deptno, gender)]]], fields=[ename, deptno, gender])
 ]]>
     </Resource>
   </TestCase>
@@ -472,7 +472,7 @@ FROM emp GROUP BY ROLLUP(deptno, gender)
 LogicalProject(c=[$2], g=[$3], gid=[$4], gd=[$5], gg=[$6], ggd=[$7], gdg=[$8])
 +- LogicalAggregate(group=[{0, 1}], groups=[[{0, 1}, {0}, {}]], c=[COUNT()], g=[GROUPING($0)], gid=[GROUP_ID()], gd=[GROUPING_ID($0)], gg=[GROUPING_ID($1)], ggd=[GROUPING_ID($1, $0)], gdg=[GROUPING_ID($0, $1)])
    +- LogicalProject(deptno=[$1], gender=[$2])
-      +- LogicalTableScan(table=[[emp, source: [TestTableSource(ename, deptno, gender)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, emp, source: [TestTableSource(ename, deptno, gender)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -483,7 +483,7 @@ Calc(select=[c, CASE(OR(=($e, 0:BIGINT), =($e, 1:BIGINT)), 0:BIGINT, 1:BIGINT) A
       +- LocalHashAggregate(groupBy=[deptno, gender, $e], select=[deptno, gender, $e, Partial_COUNT(*) AS count1$0])
          +- Expand(projects=[{deptno=[$0], gender=[$1], $e=[0]}, {deptno=[$0], gender=[null], $e=[1]}, {deptno=[null], gender=[null], $e=[3]}], projects=[{deptno, gender, 0 AS $e}, {deptno, null AS gender, 1 AS $e}, {null AS deptno, null AS gender, 3 AS $e}])
             +- Calc(select=[deptno, gender])
-               +- TableSourceScan(table=[[emp, source: [TestTableSource(ename, deptno, gender)]]], fields=[ename, deptno, gender])
+               +- TableSourceScan(table=[[default_catalog, default_database, emp, source: [TestTableSource(ename, deptno, gender)]]], fields=[ename, deptno, gender])
 ]]>
     </Resource>
   </TestCase>
@@ -506,7 +506,7 @@ FROM emp
 LogicalProject(deptno=[$0], gender=[$1], gd=[$2], gg=[$3], dg=[$4], gd0=[$5], gid=[$6], c=[$7])
 +- LogicalAggregate(group=[{0, 1}], groups=[[{0, 1}, {0}, {1}, {}]], gd=[GROUPING($0)], gg=[GROUPING($1)], dg=[GROUPING_ID($0, $1)], gd=[GROUPING_ID($1, $0)], gid=[GROUP_ID()], c=[COUNT()])
    +- LogicalProject(deptno=[$1], gender=[$2])
-      +- LogicalTableScan(table=[[emp, source: [TestTableSource(ename, deptno, gender)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, emp, source: [TestTableSource(ename, deptno, gender)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -517,7 +517,7 @@ Calc(select=[deptno, gender, CASE(OR(=($e, 0:BIGINT), =($e, 1:BIGINT)), 0:BIGINT
       +- LocalHashAggregate(groupBy=[deptno, gender, $e], select=[deptno, gender, $e, Partial_COUNT(*) AS count1$0])
          +- Expand(projects=[{deptno=[$0], gender=[$1], $e=[0]}, {deptno=[$0], gender=[null], $e=[1]}, {deptno=[null], gender=[$1], $e=[2]}, {deptno=[null], gender=[null], $e=[3]}], projects=[{deptno, gender, 0 AS $e}, {deptno, null AS gender, 1 AS $e}, {null AS deptno, gender, 2 AS $e}, {null AS deptno, null AS gender, 3 AS $e}])
             +- Calc(select=[deptno, gender])
-               +- TableSourceScan(table=[[emp, source: [TestTableSource(ename, deptno, gender)]]], fields=[ename, deptno, gender])
+               +- TableSourceScan(table=[[default_catalog, default_database, emp, source: [TestTableSource(ename, deptno, gender)]]], fields=[ename, deptno, gender])
 ]]>
     </Resource>
   </TestCase>
@@ -537,7 +537,7 @@ FROM scott_emp GROUP BY CUBE(deptno, job)
       <![CDATA[
 LogicalAggregate(group=[{0, 1}], groups=[[{0, 1}, {0}, {1}, {}]], c=[COUNT()], d=[GROUPING($0)], j=[GROUPING($1)], x=[GROUPING($0, $1)])
 +- LogicalProject(deptno=[$7], job=[$2])
-   +- LogicalTableScan(table=[[scott_emp, source: [TestTableSource(empno, ename, job, mgr, hiredate, sal, comm, deptno)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, scott_emp, source: [TestTableSource(empno, ename, job, mgr, hiredate, sal, comm, deptno)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -548,7 +548,7 @@ Calc(select=[deptno, job, c, CASE(OR(=($e, 0:BIGINT), =($e, 1:BIGINT)), 0:BIGINT
       +- LocalHashAggregate(groupBy=[deptno, job, $e], select=[deptno, job, $e, Partial_COUNT(*) AS count1$0])
          +- Expand(projects=[{deptno=[$0], job=[$1], $e=[0]}, {deptno=[$0], job=[null], $e=[1]}, {deptno=[null], job=[$1], $e=[2]}, {deptno=[null], job=[null], $e=[3]}], projects=[{deptno, job, 0 AS $e}, {deptno, null AS job, 1 AS $e}, {null AS deptno, job, 2 AS $e}, {null AS deptno, null AS job, 3 AS $e}])
             +- Calc(select=[deptno, job])
-               +- TableSourceScan(table=[[scott_emp, source: [TestTableSource(empno, ename, job, mgr, hiredate, sal, comm, deptno)]]], fields=[empno, ename, job, mgr, hiredate, sal, comm, deptno])
+               +- TableSourceScan(table=[[default_catalog, default_database, scott_emp, source: [TestTableSource(empno, ename, job, mgr, hiredate, sal, comm, deptno)]]], fields=[empno, ename, job, mgr, hiredate, sal, comm, deptno])
 ]]>
     </Resource>
   </TestCase>
@@ -561,7 +561,7 @@ Calc(select=[deptno, job, c, CASE(OR(=($e, 0:BIGINT), =($e, 1:BIGINT)), 0:BIGINT
 LogicalProject(c=[$1], g=[$2])
 +- LogicalAggregate(group=[{0}], c=[COUNT()], g=[GROUPING($0)])
    +- LogicalProject(deptno=[$1])
-      +- LogicalTableScan(table=[[emp, source: [TestTableSource(ename, deptno, gender)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, emp, source: [TestTableSource(ename, deptno, gender)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -571,7 +571,7 @@ Calc(select=[c, 0:BIGINT AS g])
    +- Exchange(distribution=[hash[deptno]])
       +- LocalHashAggregate(groupBy=[deptno], select=[deptno, Partial_COUNT(*) AS count1$0])
          +- Calc(select=[deptno])
-            +- TableSourceScan(table=[[emp, source: [TestTableSource(ename, deptno, gender)]]], fields=[ename, deptno, gender])
+            +- TableSourceScan(table=[[default_catalog, default_database, emp, source: [TestTableSource(ename, deptno, gender)]]], fields=[ename, deptno, gender])
 ]]>
     </Resource>
   </TestCase>
@@ -586,7 +586,7 @@ SELECT COUNT(*) AS c, deptno, GROUPING(deptno) AS g FROM emp GROUP BY ROLLUP(dep
 LogicalProject(c=[$1], deptno=[$0], g=[$2])
 +- LogicalAggregate(group=[{0}], groups=[[{0}, {}]], c=[COUNT()], g=[GROUPING($0)])
    +- LogicalProject(deptno=[$1])
-      +- LogicalTableScan(table=[[emp, source: [TestTableSource(ename, deptno, gender)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, emp, source: [TestTableSource(ename, deptno, gender)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -597,7 +597,7 @@ Calc(select=[c, deptno, CASE(=($e, 0:BIGINT), 0:BIGINT, 1:BIGINT) AS g])
       +- LocalHashAggregate(groupBy=[deptno, $e], select=[deptno, $e, Partial_COUNT(*) AS count1$0])
          +- Expand(projects=[{deptno=[$0], $e=[0]}, {deptno=[null], $e=[1]}], projects=[{deptno, 0 AS $e}, {null AS deptno, 1 AS $e}])
             +- Calc(select=[deptno])
-               +- TableSourceScan(table=[[emp, source: [TestTableSource(ename, deptno, gender)]]], fields=[ename, deptno, gender])
+               +- TableSourceScan(table=[[default_catalog, default_database, emp, source: [TestTableSource(ename, deptno, gender)]]], fields=[ename, deptno, gender])
 ]]>
     </Resource>
   </TestCase>
@@ -612,7 +612,7 @@ GROUP BY GROUPING SETS (b, c)
       <![CDATA[
 LogicalAggregate(group=[{0, 1}], groups=[[{0}, {1}]], a=[AVG($2)], g=[GROUP_ID()])
 +- LogicalProject(b=[$1], c=[$2], a=[$0])
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -622,7 +622,7 @@ Calc(select=[b, c, a, 0:BIGINT AS g])
    +- Exchange(distribution=[hash[b, c, $e]])
       +- LocalHashAggregate(groupBy=[b, c, $e], select=[b, c, $e, Partial_AVG(a) AS (sum$0, count$1)])
          +- Expand(projects=[{a=[$0], b=[$1], c=[null], $e=[1]}, {a=[$0], b=[null], c=[$2], $e=[2]}], projects=[{a, b, null AS c, 1 AS $e}, {a, null AS b, c, 2 AS $e}])
-            +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+            +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -634,7 +634,7 @@ Calc(select=[b, c, a, 0:BIGINT AS g])
       <![CDATA[
 LogicalAggregate(group=[{0, 1}], groups=[[{0}, {1}, {}]], a=[AVG($2)])
 +- LogicalProject(b=[$1], c=[$2], a=[$0])
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -644,7 +644,7 @@ Calc(select=[b, c, a])
    +- Exchange(distribution=[hash[b, c, $e]])
       +- LocalHashAggregate(groupBy=[b, c, $e], select=[b, c, $e, Partial_AVG(a) AS (sum$0, count$1)])
          +- Expand(projects=[{a=[$0], b=[$1], c=[null], $e=[1]}, {a=[$0], b=[null], c=[$2], $e=[2]}, {a=[$0], b=[null], c=[null], $e=[3]}], projects=[{a, b, null AS c, 1 AS $e}, {a, null AS b, c, 2 AS $e}, {a, null AS b, null AS c, 3 AS $e}])
-            +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+            +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -668,7 +668,7 @@ FROM MyTable
       <![CDATA[
 LogicalAggregate(group=[{0, 1}], groups=[[{0}, {1}, {}]], a=[AVG($2)], g=[GROUP_ID()], gb=[GROUPING($0)], gc=[GROUPING($1)], gib=[GROUPING_ID($0)], gic=[GROUPING_ID($1)], gid=[GROUPING_ID($0, $1)], cnt=[COUNT()])
 +- LogicalProject(b=[$1], c=[$2], a=[$0])
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -678,7 +678,7 @@ Calc(select=[b, c, a, 0:BIGINT AS g, CASE(=($e, 1:BIGINT), 0:BIGINT, 1:BIGINT) A
    +- Exchange(distribution=[hash[b, c, $e]])
       +- LocalHashAggregate(groupBy=[b, c, $e], select=[b, c, $e, Partial_AVG(a) AS (sum$0, count$1), Partial_COUNT(*) AS count1$2])
          +- Expand(projects=[{a=[$0], b=[$1], c=[null], $e=[1]}, {a=[$0], b=[null], c=[$2], $e=[2]}, {a=[$0], b=[null], c=[null], $e=[3]}], projects=[{a, b, null AS c, 1 AS $e}, {a, null AS b, c, 2 AS $e}, {a, null AS b, null AS c, 3 AS $e}])
-            +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+            +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -692,7 +692,7 @@ SELECT deptno + 1, COUNT(*) AS c FROM emps GROUP BY GROUPING SETS ((), (deptno +
       <![CDATA[
 LogicalAggregate(group=[{0}], groups=[[{0}, {}]], c=[COUNT()])
 +- LogicalProject(EXPR$0=[+($2, 1)])
-   +- LogicalTableScan(table=[[emps, source: [TestTableSource(empno, name, deptno, gender, city, empid, age, slacker, manager, joinedat)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, emps, source: [TestTableSource(empno, name, deptno, gender, city, empid, age, slacker, manager, joinedat)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -703,7 +703,7 @@ Calc(select=[EXPR$0, c])
       +- LocalHashAggregate(groupBy=[EXPR$0, $e], select=[EXPR$0, $e, Partial_COUNT(*) AS count1$0])
          +- Expand(projects=[{EXPR$0=[$0], $e=[0]}, {EXPR$0=[null], $e=[1]}], projects=[{EXPR$0, 0 AS $e}, {null AS EXPR$0, 1 AS $e}])
             +- Calc(select=[+(deptno, 1) AS EXPR$0])
-               +- TableSourceScan(table=[[emps, source: [TestTableSource(empno, name, deptno, gender, city, empid, age, slacker, manager, joinedat)]]], fields=[empno, name, deptno, gender, city, empid, age, slacker, manager, joinedat])
+               +- TableSourceScan(table=[[default_catalog, default_database, emps, source: [TestTableSource(empno, name, deptno, gender, city, empid, age, slacker, manager, joinedat)]]], fields=[empno, name, deptno, gender, city, empid, age, slacker, manager, joinedat])
 ]]>
     </Resource>
   </TestCase>
@@ -720,7 +720,7 @@ LogicalProject(c=[$0])
    +- LogicalProject(c=[$1], EXPR$1=[$2])
       +- LogicalAggregate(group=[{0}], groups=[[{0}, {}]], c=[COUNT()], agg#1=[GROUPING($0)])
          +- LogicalProject(deptno=[$1])
-            +- LogicalTableScan(table=[[emp, source: [TestTableSource(ename, deptno, gender)]]])
+            +- LogicalTableScan(table=[[default_catalog, default_database, emp, source: [TestTableSource(ename, deptno, gender)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -735,7 +735,7 @@ Calc(select=[c])
                   +- LocalHashAggregate(groupBy=[deptno, $e], select=[deptno, $e, Partial_COUNT(*) AS count1$0])
                      +- Expand(projects=[{deptno=[$0], $e=[0]}, {deptno=[null], $e=[1]}], projects=[{deptno, 0 AS $e}, {null AS deptno, 1 AS $e}])
                         +- Calc(select=[deptno])
-                           +- TableSourceScan(table=[[emp, source: [TestTableSource(ename, deptno, gender)]]], fields=[ename, deptno, gender])
+                           +- TableSourceScan(table=[[default_catalog, default_database, emp, source: [TestTableSource(ename, deptno, gender)]]], fields=[ename, deptno, gender])
 ]]>
     </Resource>
   </TestCase>
@@ -754,7 +754,7 @@ FROM emps GROUP BY GROUPING SETS (deptno)
       <![CDATA[
 LogicalAggregate(group=[{0}], a=[AVG($1)], g=[GROUP_ID()], gb=[GROUPING($0)], gib=[GROUPING_ID($0)])
 +- LogicalProject(deptno=[$2], age=[$6])
-   +- LogicalTableScan(table=[[emps, source: [TestTableSource(empno, name, deptno, gender, city, empid, age, slacker, manager, joinedat)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, emps, source: [TestTableSource(empno, name, deptno, gender, city, empid, age, slacker, manager, joinedat)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -764,7 +764,7 @@ Calc(select=[deptno, a, 0:BIGINT AS g, 0:BIGINT AS gb, 0:BIGINT AS gib])
    +- Exchange(distribution=[hash[deptno]])
       +- LocalHashAggregate(groupBy=[deptno], select=[deptno, Partial_AVG(age) AS (sum$0, count$1)])
          +- Calc(select=[deptno, age])
-            +- TableSourceScan(table=[[emps, source: [TestTableSource(empno, name, deptno, gender, city, empid, age, slacker, manager, joinedat)]]], fields=[empno, name, deptno, gender, city, empid, age, slacker, manager, joinedat])
+            +- TableSourceScan(table=[[default_catalog, default_database, emps, source: [TestTableSource(empno, name, deptno, gender, city, empid, age, slacker, manager, joinedat)]]], fields=[empno, name, deptno, gender, city, empid, age, slacker, manager, joinedat])
 ]]>
     </Resource>
   </TestCase>
@@ -787,7 +787,7 @@ FROM MyTable
       <![CDATA[
 LogicalAggregate(group=[{0, 1}], groups=[[{0, 1}, {0}, {}]], a=[AVG($2)], g=[GROUP_ID()], gb=[GROUPING($0)], gc=[GROUPING($1)], gib=[GROUPING_ID($0)], gic=[GROUPING_ID($1)], gid=[GROUPING_ID($0, $1)])
 +- LogicalProject(b=[$1], c=[$2], a=[$0])
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -797,7 +797,7 @@ Calc(select=[b, c, a, 0:BIGINT AS g, CASE(OR(=($e, 0:BIGINT), =($e, 1:BIGINT)),
    +- Exchange(distribution=[hash[b, c, $e]])
       +- LocalHashAggregate(groupBy=[b, c, $e], select=[b, c, $e, Partial_AVG(a) AS (sum$0, count$1)])
          +- Expand(projects=[{a=[$0], b=[$1], c=[$2], $e=[0]}, {a=[$0], b=[$1], c=[null], $e=[1]}, {a=[$0], b=[null], c=[null], $e=[3]}], projects=[{a, b, c, 0 AS $e}, {a, b, null AS c, 1 AS $e}, {a, null AS b, null AS c, 3 AS $e}])
-            +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+            +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -820,7 +820,7 @@ FROM MyTable
       <![CDATA[
 LogicalAggregate(group=[{0, 1}], groups=[[{0, 1}, {0}, {}]], a=[AVG($2)], g=[GROUP_ID()], gb=[GROUPING($0)], gc=[GROUPING($1)], gib=[GROUPING_ID($0)], gic=[GROUPING_ID($1)], gid=[GROUPING_ID($0, $1)])
 +- LogicalProject(b=[$1], c=[$2], a=[$0])
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -830,7 +830,7 @@ Calc(select=[b, c, a, 0:BIGINT AS g, CASE(OR(=($e, 0:BIGINT), =($e, 1:BIGINT)),
    +- Exchange(distribution=[hash[b, c, $e]])
       +- LocalHashAggregate(groupBy=[b, c, $e], select=[b, c, $e, Partial_AVG(a) AS (sum$0, count$1)])
          +- Expand(projects=[{a=[$0], b=[$1], c=[$2], $e=[0]}, {a=[$0], b=[$1], c=[null], $e=[1]}, {a=[$0], b=[null], c=[null], $e=[3]}], projects=[{a, b, c, 0 AS $e}, {a, b, null AS c, 1 AS $e}, {a, null AS b, null AS c, 3 AS $e}])
-            +- TableSourceScan(table=[[MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+            +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -843,7 +843,7 @@ Calc(select=[b, c, a, 0:BIGINT AS g, CASE(OR(=($e, 0:BIGINT), =($e, 1:BIGINT)),
 LogicalProject(deptno=[$0], c=[$2])
 +- LogicalAggregate(group=[{0, 1}], groups=[[{0, 1}, {0}, {1}, {}]], c=[COUNT()])
    +- LogicalProject(deptno=[$1], gender=[$2])
-      +- LogicalTableScan(table=[[emp, source: [TestTableSource(ename, deptno, gender)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, emp, source: [TestTableSource(ename, deptno, gender)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -854,7 +854,7 @@ Calc(select=[deptno, c])
       +- LocalHashAggregate(groupBy=[deptno, gender, $e], select=[deptno, gender, $e, Partial_COUNT(*) AS count1$0])
          +- Expand(projects=[{deptno=[$0], gender=[$1], $e=[0]}, {deptno=[$0], gender=[null], $e=[1]}, {deptno=[null], gender=[$1], $e=[2]}, {deptno=[null], gender=[null], $e=[3]}], projects=[{deptno, gender, 0 AS $e}, {deptno, null AS gender, 1 AS $e}, {null AS deptno, gender, 2 AS $e}, {null AS deptno, null AS gender, 3 AS $e}])
             +- Calc(select=[deptno, gender])
-               +- TableSourceScan(table=[[emp, source: [TestTableSource(ename, deptno, gender)]]], fields=[ename, deptno, gender])
+               +- TableSourceScan(table=[[default_catalog, default_database, emp, source: [TestTableSource(ename, deptno, gender)]]], fields=[ename, deptno, gender])
 ]]>
     </Resource>
   </TestCase>
@@ -870,7 +870,7 @@ GROUP BY ROLLUP(deptno / 2, gender), ROLLUP(substring(ename FROM 1 FOR 1))
 LogicalProject(half1=[+($0, 1)], c=[$3])
 +- LogicalAggregate(group=[{0, 1, 2}], groups=[[{0, 1, 2}, {0, 1}, {0, 2}, {0}, {2}, {}]], c=[COUNT()])
    +- LogicalProject($f0=[/($1, 2)], gender=[$2], $f2=[SUBSTRING($0, 1, 1)])
-      +- LogicalTableScan(table=[[emp, source: [TestTableSource(ename, deptno, gender)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, emp, source: [TestTableSource(ename, deptno, gender)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -881,7 +881,7 @@ Calc(select=[+($f0, 1) AS half1, c])
       +- LocalHashAggregate(groupBy=[$f0, gender, $f2, $e], select=[$f0, gender, $f2, $e, Partial_COUNT(*) AS count1$0])
          +- Expand(projects=[{$f0=[$0], gender=[$1], $f2=[$2], $e=[0]}, {$f0=[$0], gender=[$1], $f2=[null], $e=[1]}, {$f0=[$0], gender=[null], $f2=[$2], $e=[2]}, {$f0=[$0], gender=[null], $f2=[null], $e=[3]}, {$f0=[null], gender=[null], $f2=[$2], $e=[6]}, {$f0=[null], gender=[null], $f2=[null], $e=[7]}], projects=[{$f0, gender, $f2, 0 AS $e}, {$f0, gender, null AS $f2, 1 AS $e}, {$f0, null AS gender, $f2, 2 AS $e}, {$f0, null AS gender, null AS $f2, 3 AS $e}, {null AS $f0, null AS gender [...]
             +- Calc(select=[/(deptno, 2) AS $f0, gender, SUBSTRING(ename, 1, 1) AS $f2])
-               +- TableSourceScan(table=[[emp, source: [TestTableSource(ename, deptno, gender)]]], fields=[ename, deptno, gender])
+               +- TableSourceScan(table=[[default_catalog, default_database, emp, source: [TestTableSource(ename, deptno, gender)]]], fields=[ename, deptno, gender])
 ]]>
     </Resource>
   </TestCase>
@@ -896,7 +896,7 @@ SELECT gender, deptno + 1, COUNT(*) AS c FROM emp GROUP BY ROLLUP(deptno, gender
 LogicalProject(gender=[$1], EXPR$1=[+($0, 1)], c=[$2])
 +- LogicalAggregate(group=[{0, 1}], groups=[[{0, 1}, {0}, {}]], c=[COUNT()])
    +- LogicalProject(deptno=[$1], gender=[$2])
-      +- LogicalTableScan(table=[[emp, source: [TestTableSource(ename, deptno, gender)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, emp, source: [TestTableSource(ename, deptno, gender)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -907,7 +907,7 @@ Calc(select=[gender, +(deptno, 1) AS EXPR$1, c])
       +- LocalHashAggregate(groupBy=[deptno, gender, $e], select=[deptno, gender, $e, Partial_COUNT(*) AS count1$0])
          +- Expand(projects=[{deptno=[$0], gender=[$1], $e=[0]}, {deptno=[$0], gender=[null], $e=[1]}, {deptno=[null], gender=[null], $e=[3]}], projects=[{deptno, gender, 0 AS $e}, {deptno, null AS gender, 1 AS $e}, {null AS deptno, null AS gender, 3 AS $e}])
             +- Calc(select=[deptno, gender])
-               +- TableSourceScan(table=[[emp, source: [TestTableSource(ename, deptno, gender)]]], fields=[ename, deptno, gender])
+               +- TableSourceScan(table=[[default_catalog, default_database, emp, source: [TestTableSource(ename, deptno, gender)]]], fields=[ename, deptno, gender])
 ]]>
     </Resource>
   </TestCase>
@@ -919,7 +919,7 @@ Calc(select=[gender, +(deptno, 1) AS EXPR$1, c])
       <![CDATA[
 LogicalAggregate(group=[{0}], groups=[[{0}, {}]], c=[COUNT()])
 +- LogicalProject(gender=[$2])
-   +- LogicalTableScan(table=[[emp, source: [TestTableSource(ename, deptno, gender)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, emp, source: [TestTableSource(ename, deptno, gender)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -930,7 +930,7 @@ Calc(select=[gender, c])
       +- LocalHashAggregate(groupBy=[gender, $e], select=[gender, $e, Partial_COUNT(*) AS count1$0])
          +- Expand(projects=[{gender=[$0], $e=[0]}, {gender=[null], $e=[1]}], projects=[{gender, 0 AS $e}, {null AS gender, 1 AS $e}])
             +- Calc(select=[gender])
-               +- TableSourceScan(table=[[emp, source: [TestTableSource(ename, deptno, gender)]]], fields=[ename, deptno, gender])
+               +- TableSourceScan(table=[[default_catalog, default_database, emp, source: [TestTableSource(ename, deptno, gender)]]], fields=[ename, deptno, gender])
 ]]>
     </Resource>
   </TestCase>
@@ -943,7 +943,7 @@ Calc(select=[gender, c])
 LogicalSort(sort0=[$1], dir0=[DESC-nulls-last])
 +- LogicalAggregate(group=[{0}], groups=[[{0}, {}]], c=[COUNT()])
    +- LogicalProject(gender=[$2])
-      +- LogicalTableScan(table=[[emp, source: [TestTableSource(ename, deptno, gender)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, emp, source: [TestTableSource(ename, deptno, gender)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -957,7 +957,7 @@ Calc(select=[gender, c])
                +- LocalHashAggregate(groupBy=[gender, $e], select=[gender, $e, Partial_COUNT(*) AS count1$0])
                   +- Expand(projects=[{gender=[$0], $e=[0]}, {gender=[null], $e=[1]}], projects=[{gender, 0 AS $e}, {null AS gender, 1 AS $e}])
                      +- Calc(select=[gender])
-                        +- TableSourceScan(table=[[emp, source: [TestTableSource(ename, deptno, gender)]]], fields=[ename, deptno, gender])
+                        +- TableSourceScan(table=[[default_catalog, default_database, emp, source: [TestTableSource(ename, deptno, gender)]]], fields=[ename, deptno, gender])
 ]]>
     </Resource>
   </TestCase>
@@ -973,7 +973,7 @@ LogicalProject(d1=[+($0, 1)], c=[$1])
 +- LogicalFilter(condition=[>($1, 3)])
    +- LogicalAggregate(group=[{0}], groups=[[{0}, {}]], c=[COUNT()])
       +- LogicalProject(deptno=[$1])
-         +- LogicalTableScan(table=[[emp, source: [TestTableSource(ename, deptno, gender)]]])
+         +- LogicalTableScan(table=[[default_catalog, default_database, emp, source: [TestTableSource(ename, deptno, gender)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -984,7 +984,7 @@ Calc(select=[+(deptno, 1) AS d1, c], where=[>(c, 3)])
       +- LocalHashAggregate(groupBy=[deptno, $e], select=[deptno, $e, Partial_COUNT(*) AS count1$0])
          +- Expand(projects=[{deptno=[$0], $e=[0]}, {deptno=[null], $e=[1]}], projects=[{deptno, 0 AS $e}, {null AS deptno, 1 AS $e}])
             +- Calc(select=[deptno])
-               +- TableSourceScan(table=[[emp, source: [TestTableSource(ename, deptno, gender)]]], fields=[ename, deptno, gender])
+               +- TableSourceScan(table=[[default_catalog, default_database, emp, source: [TestTableSource(ename, deptno, gender)]]], fields=[ename, deptno, gender])
 ]]>
     </Resource>
   </TestCase>
@@ -997,7 +997,7 @@ Calc(select=[+(deptno, 1) AS d1, c], where=[>(c, 3)])
 LogicalProject(EXPR$0=[+($0, 1)], c=[$1])
 +- LogicalAggregate(group=[{0}], groups=[[{0}, {}]], c=[COUNT()])
    +- LogicalProject(deptno=[$1])
-      +- LogicalTableScan(table=[[emp, source: [TestTableSource(ename, deptno, gender)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, emp, source: [TestTableSource(ename, deptno, gender)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -1008,7 +1008,7 @@ Calc(select=[+(deptno, 1) AS EXPR$0, c])
       +- LocalHashAggregate(groupBy=[deptno, $e], select=[deptno, $e, Partial_COUNT(*) AS count1$0])
          +- Expand(projects=[{deptno=[$0], $e=[0]}, {deptno=[null], $e=[1]}], projects=[{deptno, 0 AS $e}, {null AS deptno, 1 AS $e}])
             +- Calc(select=[deptno])
-               +- TableSourceScan(table=[[emp, source: [TestTableSource(ename, deptno, gender)]]], fields=[ename, deptno, gender])
+               +- TableSourceScan(table=[[default_catalog, default_database, emp, source: [TestTableSource(ename, deptno, gender)]]], fields=[ename, deptno, gender])
 ]]>
     </Resource>
   </TestCase>
diff --git a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/agg/HashAggregateTest.xml b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/agg/HashAggregateTest.xml
index e906502..18a987e 100644
--- a/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/agg/HashAggregateTest.xml
+++ b/flink-table/flink-table-planner-blink/src/test/resources/org/apache/flink/table/plan/batch/sql/agg/HashAggregateTest.xml
@@ -24,7 +24,7 @@ limitations under the License.
       <![CDATA[
 LogicalAggregate(group=[{0}], EXPR$1=[var_sum($1)])
 +- LogicalProject(b=[$1], a=[$0])
-   +- LogicalTableScan(table=[[MyTable1, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -32,7 +32,7 @@ LogicalAggregate(group=[{0}], EXPR$1=[var_sum($1)])
 HashAggregate(isMerge=[false], groupBy=[b], select=[b, var_sum(a) AS EXPR$1])
 +- Exchange(distribution=[hash[b]])
    +- Calc(select=[b, a])
-      +- TableSourceScan(table=[[MyTable1, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+      +- TableSourceScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -44,7 +44,7 @@ HashAggregate(isMerge=[false], groupBy=[b], select=[b, var_sum(a) AS EXPR$1])
       <![CDATA[
 LogicalAggregate(group=[{0}], EXPR$1=[var_sum($1)])
 +- LogicalProject(b=[$1], a=[$0])
-   +- LogicalTableScan(table=[[MyTable1, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -52,7 +52,7 @@ LogicalAggregate(group=[{0}], EXPR$1=[var_sum($1)])
 HashAggregate(isMerge=[false], groupBy=[b], select=[b, var_sum(a) AS EXPR$1])
 +- Exchange(distribution=[hash[b]])
    +- Calc(select=[b, a])
-      +- TableSourceScan(table=[[MyTable1, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+      +- TableSourceScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -64,7 +64,7 @@ HashAggregate(isMerge=[false], groupBy=[b], select=[b, var_sum(a) AS EXPR$1])
       <![CDATA[
 LogicalAggregate(group=[{0}], EXPR$1=[var_sum($1)])
 +- LogicalProject(b=[$1], a=[$0])
-   +- LogicalTableScan(table=[[MyTable1, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -72,7 +72,7 @@ LogicalAggregate(group=[{0}], EXPR$1=[var_sum($1)])
 HashAggregate(isMerge=[false], groupBy=[b], select=[b, var_sum(a) AS EXPR$1])
 +- Exchange(distribution=[hash[b]])
    +- Calc(select=[b, a])
-      +- TableSourceScan(table=[[MyTable1, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+      +- TableSourceScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -84,7 +84,7 @@ HashAggregate(isMerge=[false], groupBy=[b], select=[b, var_sum(a) AS EXPR$1])
       <![CDATA[
 LogicalAggregate(group=[{}], EXPR$0=[AVG($0)], EXPR$1=[SUM($1)], EXPR$2=[COUNT($2)])
 +- LogicalFilter(condition=[=($0, 1)])
-   +- LogicalTableScan(table=[[MyTable1, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -93,7 +93,7 @@ HashAggregate(isMerge=[true], select=[Final_AVG(sum$0, count$1) AS EXPR$0, Final
 +- Exchange(distribution=[single])
    +- LocalHashAggregate(select=[Partial_AVG(a) AS (sum$0, count$1), Partial_SUM(b) AS sum$2, Partial_COUNT(c) AS count$3])
       +- Calc(select=[a, b, c], where=[=(a, 1)])
-         +- TableSourceScan(table=[[MyTable1, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+         +- TableSourceScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -105,7 +105,7 @@ HashAggregate(isMerge=[true], select=[Final_AVG(sum$0, count$1) AS EXPR$0, Final
       <![CDATA[
 LogicalAggregate(group=[{}], EXPR$0=[AVG($0)], EXPR$1=[SUM($1)], EXPR$2=[COUNT($2)])
 +- LogicalFilter(condition=[=($0, 1)])
-   +- LogicalTableScan(table=[[MyTable1, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -113,7 +113,7 @@ LogicalAggregate(group=[{}], EXPR$0=[AVG($0)], EXPR$1=[SUM($1)], EXPR$2=[COUNT($
 HashAggregate(isMerge=[false], select=[AVG(a) AS EXPR$0, SUM(b) AS EXPR$1, COUNT(c) AS EXPR$2])
 +- Exchange(distribution=[single])
    +- Calc(select=[a, b, c], where=[=(a, 1)])
-      +- TableSourceScan(table=[[MyTable1, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+      +- TableSourceScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -125,7 +125,7 @@ HashAggregate(isMerge=[false], select=[AVG(a) AS EXPR$0, SUM(b) AS EXPR$1, COUNT
       <![CDATA[
 LogicalAggregate(group=[{}], EXPR$0=[AVG($0)], EXPR$1=[SUM($1)], EXPR$2=[COUNT($2)])
 +- LogicalFilter(condition=[=($0, 1)])
-   +- LogicalTableScan(table=[[MyTable1, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -134,7 +134,7 @@ HashAggregate(isMerge=[true], select=[Final_AVG(sum$0, count$1) AS EXPR$0, Final
 +- Exchange(distribution=[single])
    +- LocalHashAggregate(select=[Partial_AVG(a) AS (sum$0, count$1), Partial_SUM(b) AS sum$2, Partial_COUNT(c) AS count$3])
       +- Calc(select=[a, b, c], where=[=(a, 1)])
-         +- TableSourceScan(table=[[MyTable1, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+         +- TableSourceScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -147,7 +147,7 @@ HashAggregate(isMerge=[true], select=[Final_AVG(sum$0, count$1) AS EXPR$0, Final
 LogicalAggregate(group=[{}], EXPR$0=[AVG($0)], EXPR$1=[SUM($1)], EXPR$2=[COUNT($2)], EXPR$3=[SUM($3)])
 +- LogicalProject(a=[$0], b=[$1], c=[$2], $f3=[$2._1])
    +- LogicalFilter(condition=[=($0, 1)])
-      +- LogicalTableScan(table=[[MyTable2, source: [TestTableSource(a, b, c)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -156,7 +156,7 @@ HashAggregate(isMerge=[true], select=[Final_AVG(sum$0, count$1) AS EXPR$0, Final
 +- Exchange(distribution=[single])
    +- LocalHashAggregate(select=[Partial_AVG(a) AS (sum$0, count$1), Partial_SUM(b) AS sum$2, Partial_COUNT(c) AS count$3, Partial_SUM($f3) AS sum$4])
       +- Calc(select=[CAST(1) AS a, b, c, c._1 AS $f3], where=[=(a, 1)])
-         +- TableSourceScan(table=[[MyTable2, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+         +- TableSourceScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -169,7 +169,7 @@ HashAggregate(isMerge=[true], select=[Final_AVG(sum$0, count$1) AS EXPR$0, Final
 LogicalAggregate(group=[{}], EXPR$0=[AVG($0)], EXPR$1=[SUM($1)], EXPR$2=[COUNT($2)], EXPR$3=[SUM($3)])
 +- LogicalProject(a=[$0], b=[$1], c=[$2], $f3=[$2._1])
    +- LogicalFilter(condition=[=($0, 1)])
-      +- LogicalTableScan(table=[[MyTable2, source: [TestTableSource(a, b, c)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -177,7 +177,7 @@ LogicalAggregate(group=[{}], EXPR$0=[AVG($0)], EXPR$1=[SUM($1)], EXPR$2=[COUNT($
 HashAggregate(isMerge=[false], select=[AVG(a) AS EXPR$0, SUM(b) AS EXPR$1, COUNT(c) AS EXPR$2, SUM($f3) AS EXPR$3])
 +- Exchange(distribution=[single])
    +- Calc(select=[CAST(1) AS a, b, c, c._1 AS $f3], where=[=(a, 1)])
-      +- TableSourceScan(table=[[MyTable2, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+      +- TableSourceScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -190,7 +190,7 @@ HashAggregate(isMerge=[false], select=[AVG(a) AS EXPR$0, SUM(b) AS EXPR$1, COUNT
 LogicalAggregate(group=[{}], EXPR$0=[AVG($0)], EXPR$1=[SUM($1)], EXPR$2=[COUNT($2)], EXPR$3=[SUM($3)])
 +- LogicalProject(a=[$0], b=[$1], c=[$2], $f3=[$2._1])
    +- LogicalFilter(condition=[=($0, 1)])
-      +- LogicalTableScan(table=[[MyTable2, source: [TestTableSource(a, b, c)]]])
+      +- LogicalTableScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -199,7 +199,7 @@ HashAggregate(isMerge=[true], select=[Final_AVG(sum$0, count$1) AS EXPR$0, Final
 +- Exchange(distribution=[single])
    +- LocalHashAggregate(select=[Partial_AVG(a) AS (sum$0, count$1), Partial_SUM(b) AS sum$2, Partial_COUNT(c) AS count$3, Partial_SUM($f3) AS sum$4])
       +- Calc(select=[CAST(1) AS a, b, c, c._1 AS $f3], where=[=(a, 1)])
-         +- TableSourceScan(table=[[MyTable2, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+         +- TableSourceScan(table=[[default_catalog, default_database, MyTable2, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -211,7 +211,7 @@ HashAggregate(isMerge=[true], select=[Final_AVG(sum$0, count$1) AS EXPR$0, Final
       <![CDATA[
 LogicalAggregate(group=[{0, 1}])
 +- LogicalProject(a=[$0], b=[$1])
-   +- LogicalTableScan(table=[[MyTable1, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -220,7 +220,7 @@ HashAggregate(isMerge=[true], groupBy=[a, b], select=[a, b])
 +- Exchange(distribution=[hash[a, b]])
    +- LocalHashAggregate(groupBy=[a, b], select=[a, b])
       +- Calc(select=[a, b])
-         +- TableSourceScan(table=[[MyTable1, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+         +- TableSourceScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -232,7 +232,7 @@ HashAggregate(isMerge=[true], groupBy=[a, b], select=[a, b])
       <![CDATA[
 LogicalAggregate(group=[{0, 1}])
 +- LogicalProject(a=[$0], b=[$1])
-   +- LogicalTableScan(table=[[MyTable1, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -240,7 +240,7 @@ LogicalAggregate(group=[{0, 1}])
 HashAggregate(isMerge=[false], groupBy=[a, b], select=[a, b])
 +- Exchange(distribution=[hash[a, b]])
    +- Calc(select=[a, b])
-      +- TableSourceScan(table=[[MyTable1, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+      +- TableSourceScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -252,7 +252,7 @@ HashAggregate(isMerge=[false], groupBy=[a, b], select=[a, b])
       <![CDATA[
 LogicalAggregate(group=[{0, 1}])
 +- LogicalProject(a=[$0], b=[$1])
-   +- LogicalTableScan(table=[[MyTable1, source: [TestTableSource(a, b, c)]]])
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -261,7 +261,7 @@ HashAggregate(isMerge=[true], groupBy=[a, b], select=[a, b])
 +- Exchange(distribution=[hash[a, b]])
    +- LocalHashAggregate(groupBy=[a, b], select=[a, b])
       +- Calc(select=[a, b])
-         +- TableSourceScan(table=[[MyTable1, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+         +- TableSourceScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -272,7 +272,7 @@ HashAggregate(isMerge=[true], groupBy=[a, b], select=[a, b])
     <Resource name="planBefore">
       <![CDATA[
 LogicalAggregate(group=[{}], EXPR$0=[AVG($0)], EXPR$1=[SUM($1)], EXPR$2=[COUNT($2)])
-+- LogicalTableScan(table=[[MyTable1, source: [TestTableSource(a, b, c)]]])
++- LogicalTableScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -280,7 +280,7 @@ LogicalAggregate(group=[{}], EXPR$0=[AVG($0)], EXPR$1=[SUM($1)], EXPR$2=[COUNT($
 HashAggregate(isMerge=[true], select=[Final_AVG(sum$0, count$1) AS EXPR$0, Final_SUM(sum$2) AS EXPR$1, Final_COUNT(count$3) AS EXPR$2])
 +- Exchange(distribution=[single])
    +- LocalHashAggregate(select=[Partial_AVG(a) AS (sum$0, count$1), Partial_SUM(b) AS sum$2, Partial_COUNT(c) AS count$3])
-      +- TableSourceScan(table=[[MyTable1, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+      +- TableSourceScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -291,14 +291,14 @@ HashAggregate(isMerge=[true], select=[Final_AVG(sum$0, count$1) AS EXPR$0, Final
     <Resource name="planBefore">
       <![CDATA[
 LogicalAggregate(group=[{}], EXPR$0=[AVG($0)], EXPR$1=[SUM($1)], EXPR$2=[COUNT($2)])
-+- LogicalTableScan(table=[[MyTable1, source: [TestTableSource(a, b, c)]]])
++- LogicalTableScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
 HashAggregate(isMerge=[false], select=[AVG(a) AS EXPR$0, SUM(b) AS EXPR$1, COUNT(c) AS EXPR$2])
 +- Exchange(distribution=[single])
-   +- TableSourceScan(table=[[MyTable1, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+   +- TableSourceScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -309,7 +309,7 @@ HashAggregate(isMerge=[false], select=[AVG(a) AS EXPR$0, SUM(b) AS EXPR$1, COUNT
     <Resource name="planBefore">
       <![CDATA[
 LogicalAggregate(group=[{}], EXPR$0=[AVG($0)], EXPR$1=[SUM($1)], EXPR$2=[COUNT($2)])
-+- LogicalTableScan(table=[[MyTable1, source: [TestTableSource(a, b, c)]]])
++- LogicalTableScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(a, b, c)]]])
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -317,7 +317,7 @@ LogicalAggregate(group=[{}], EXPR$0=[AVG($0)], EXPR$1=[SUM($1)], EXPR$2=[COUNT($
 HashAggregate(isMerge=[true], select=[Final_AVG(sum$0, count$1) AS EXPR$0, Final_SUM(sum$2) AS EXPR$1, Final_COUNT(count$3) AS EXPR$2])
 +- Exchange(distribution=[single])
    +- LocalHashAggregate(select=[Partial_AVG(a) AS (sum$0, count$1), Partial_SUM(b) AS sum$2, Partial_COUNT(c) AS count$3])
-      +- TableSourceScan(table=[[MyTable1, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
+      +- TableSourceScan(table=[[default_catalog, default_database, MyTable1, source: [TestTableSource(a, b, c)]]], fields=[a, b, c])
 ]]>
     </Resource>
   </TestCase>
@@ -339,7 +339,7 @@ FROM MyTable
       <![CDATA[
 LogicalAggregate(group=[{}], EXPR$0=[AVG($0)], EXPR$1=[AVG($1)], EXPR$2=[AVG($2)], EXPR$3=[AVG($3)], EXPR$4=[AVG($4)], EXPR$5=[AVG($5)], EXPR$6=[AVG($6)], EXPR$7=[AVG($7)]), rowType=[RecordType(DOUBLE EXPR$0, DOUBLE EXPR$1, DOUBLE EXPR$2, DOUBLE EXPR$3, DOUBLE EXPR$4, DOUBLE EXPR$5, DECIMAL(38, 20) EXPR$6, DECIMAL(38, 6) EXPR$7)]
 +- LogicalProject(byte=[$0], short=[$1], int=[$2], long=[$3], float=[$4], double=[$5], decimal3020=[$11], decimal105=[$12]), rowType=[RecordType(TINYINT byte, SMALLINT short, INTEGER int, BIGINT long, FLOAT float, DOUBLE double, DECIMAL(30, 20) decimal3020, DECIMAL(10, 5) decimal105)]
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(byte, short, int, long, float, double, boolean, string, date, time, timestamp, decimal3020, decimal105)]]]), rowType=[RecordType(TINYINT byte, SMALLINT short, INTEGER int, BIGINT long, FLOAT float, DOUBLE double, BOOLEAN boolean, VARCHAR(2147483647) string, DATE date, TIME(0) time, TIMESTAMP(3) timestamp, DECIMAL(30, 20) decimal3020, DECIMAL(10, 5) decimal105)]
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(byte, short, int, long, float, double, boolean, string, date, time, timestamp, decimal3020, decimal105)]]]), rowType=[RecordType(TINYINT byte, SMALLINT short, INTEGER int, BIGINT long, FLOAT float, DOUBLE double, BOOLEAN boolean, VARCHAR(2147483647) string, DATE date, TIME(0) time, TIMESTAMP(3) timestamp, DECIMAL(30, 20) decimal3020, DECIMAL(10, 5) decimal105)]
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -348,7 +348,7 @@ HashAggregate(isMerge=[true], select=[Final_AVG(sum$0, count$1) AS EXPR$0, Final
 +- Exchange(distribution=[single]), rowType=[RecordType(BIGINT sum$0, BIGINT count$1, BIGINT sum$2, BIGINT count$3, BIGINT sum$4, BIGINT count$5, BIGINT sum$6, BIGINT count$7, DOUBLE sum$8, BIGINT count$9, DOUBLE sum$10, BIGINT count$11, DECIMAL(38, 20) sum$12, BIGINT count$13, DECIMAL(38, 5) sum$14, BIGINT count$15)]
    +- LocalHashAggregate(select=[Partial_AVG(byte) AS (sum$0, count$1), Partial_AVG(short) AS (sum$2, count$3), Partial_AVG(int) AS (sum$4, count$5), Partial_AVG(long) AS (sum$6, count$7), Partial_AVG(float) AS (sum$8, count$9), Partial_AVG(double) AS (sum$10, count$11), Partial_AVG(decimal3020) AS (sum$12, count$13), Partial_AVG(decimal105) AS (sum$14, count$15)]), rowType=[RecordType(BIGINT sum$0, BIGINT count$1, BIGINT sum$2, BIGINT count$3, BIGINT sum$4, BIGINT count$5, BIGINT sum$6, [...]
       +- Calc(select=[byte, short, int, long, float, double, decimal3020, decimal105]), rowType=[RecordType(TINYINT byte, SMALLINT short, INTEGER int, BIGINT long, FLOAT float, DOUBLE double, DECIMAL(30, 20) decimal3020, DECIMAL(10, 5) decimal105)]
-         +- TableSourceScan(table=[[MyTable, source: [TestTableSource(byte, short, int, long, float, double, boolean, string, date, time, timestamp, decimal3020, decimal105)]]], fields=[byte, short, int, long, float, double, boolean, string, date, time, timestamp, decimal3020, decimal105]), rowType=[RecordType(TINYINT byte, SMALLINT short, INTEGER int, BIGINT long, FLOAT float, DOUBLE double, BOOLEAN boolean, VARCHAR(2147483647) string, DATE date, TIME(0) time, TIMESTAMP(3) timestamp, DE [...]
+         +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(byte, short, int, long, float, double, boolean, string, date, time, timestamp, decimal3020, decimal105)]]], fields=[byte, short, int, long, float, double, boolean, string, date, time, timestamp, decimal3020, decimal105]), rowType=[RecordType(TINYINT byte, SMALLINT short, INTEGER int, BIGINT long, FLOAT float, DOUBLE double, BOOLEAN boolean, VARCHAR(2147483647) string, DATE date, TIME( [...]
 ]]>
     </Resource>
   </TestCase>
@@ -370,7 +370,7 @@ FROM MyTable
       <![CDATA[
 LogicalAggregate(group=[{}], EXPR$0=[AVG($0)], EXPR$1=[AVG($1)], EXPR$2=[AVG($2)], EXPR$3=[AVG($3)], EXPR$4=[AVG($4)], EXPR$5=[AVG($5)], EXPR$6=[AVG($6)], EXPR$7=[AVG($7)]), rowType=[RecordType(DOUBLE EXPR$0, DOUBLE EXPR$1, DOUBLE EXPR$2, DOUBLE EXPR$3, DOUBLE EXPR$4, DOUBLE EXPR$5, DECIMAL(38, 20) EXPR$6, DECIMAL(38, 6) EXPR$7)]
 +- LogicalProject(byte=[$0], short=[$1], int=[$2], long=[$3], float=[$4], double=[$5], decimal3020=[$11], decimal105=[$12]), rowType=[RecordType(TINYINT byte, SMALLINT short, INTEGER int, BIGINT long, FLOAT float, DOUBLE double, DECIMAL(30, 20) decimal3020, DECIMAL(10, 5) decimal105)]
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(byte, short, int, long, float, double, boolean, string, date, time, timestamp, decimal3020, decimal105)]]]), rowType=[RecordType(TINYINT byte, SMALLINT short, INTEGER int, BIGINT long, FLOAT float, DOUBLE double, BOOLEAN boolean, VARCHAR(2147483647) string, DATE date, TIME(0) time, TIMESTAMP(3) timestamp, DECIMAL(30, 20) decimal3020, DECIMAL(10, 5) decimal105)]
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(byte, short, int, long, float, double, boolean, string, date, time, timestamp, decimal3020, decimal105)]]]), rowType=[RecordType(TINYINT byte, SMALLINT short, INTEGER int, BIGINT long, FLOAT float, DOUBLE double, BOOLEAN boolean, VARCHAR(2147483647) string, DATE date, TIME(0) time, TIMESTAMP(3) timestamp, DECIMAL(30, 20) decimal3020, DECIMAL(10, 5) decimal105)]
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -378,7 +378,7 @@ LogicalAggregate(group=[{}], EXPR$0=[AVG($0)], EXPR$1=[AVG($1)], EXPR$2=[AVG($2)
 HashAggregate(isMerge=[false], select=[AVG(byte) AS EXPR$0, AVG(short) AS EXPR$1, AVG(int) AS EXPR$2, AVG(long) AS EXPR$3, AVG(float) AS EXPR$4, AVG(double) AS EXPR$5, AVG(decimal3020) AS EXPR$6, AVG(decimal105) AS EXPR$7]), rowType=[RecordType(DOUBLE EXPR$0, DOUBLE EXPR$1, DOUBLE EXPR$2, DOUBLE EXPR$3, DOUBLE EXPR$4, DOUBLE EXPR$5, DECIMAL(38, 20) EXPR$6, DECIMAL(38, 6) EXPR$7)]
 +- Exchange(distribution=[single]), rowType=[RecordType(TINYINT byte, SMALLINT short, INTEGER int, BIGINT long, FLOAT float, DOUBLE double, DECIMAL(30, 20) decimal3020, DECIMAL(10, 5) decimal105)]
    +- Calc(select=[byte, short, int, long, float, double, decimal3020, decimal105]), rowType=[RecordType(TINYINT byte, SMALLINT short, INTEGER int, BIGINT long, FLOAT float, DOUBLE double, DECIMAL(30, 20) decimal3020, DECIMAL(10, 5) decimal105)]
-      +- TableSourceScan(table=[[MyTable, source: [TestTableSource(byte, short, int, long, float, double, boolean, string, date, time, timestamp, decimal3020, decimal105)]]], fields=[byte, short, int, long, float, double, boolean, string, date, time, timestamp, decimal3020, decimal105]), rowType=[RecordType(TINYINT byte, SMALLINT short, INTEGER int, BIGINT long, FLOAT float, DOUBLE double, BOOLEAN boolean, VARCHAR(2147483647) string, DATE date, TIME(0) time, TIMESTAMP(3) timestamp, DECIM [...]
+      +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(byte, short, int, long, float, double, boolean, string, date, time, timestamp, decimal3020, decimal105)]]], fields=[byte, short, int, long, float, double, boolean, string, date, time, timestamp, decimal3020, decimal105]), rowType=[RecordType(TINYINT byte, SMALLINT short, INTEGER int, BIGINT long, FLOAT float, DOUBLE double, BOOLEAN boolean, VARCHAR(2147483647) string, DATE date, TIME(0)  [...]
 ]]>
     </Resource>
   </TestCase>
@@ -400,7 +400,7 @@ FROM MyTable
       <![CDATA[
 LogicalAggregate(group=[{}], EXPR$0=[AVG($0)], EXPR$1=[AVG($1)], EXPR$2=[AVG($2)], EXPR$3=[AVG($3)], EXPR$4=[AVG($4)], EXPR$5=[AVG($5)], EXPR$6=[AVG($6)], EXPR$7=[AVG($7)]), rowType=[RecordType(DOUBLE EXPR$0, DOUBLE EXPR$1, DOUBLE EXPR$2, DOUBLE EXPR$3, DOUBLE EXPR$4, DOUBLE EXPR$5, DECIMAL(38, 20) EXPR$6, DECIMAL(38, 6) EXPR$7)]
 +- LogicalProject(byte=[$0], short=[$1], int=[$2], long=[$3], float=[$4], double=[$5], decimal3020=[$11], decimal105=[$12]), rowType=[RecordType(TINYINT byte, SMALLINT short, INTEGER int, BIGINT long, FLOAT float, DOUBLE double, DECIMAL(30, 20) decimal3020, DECIMAL(10, 5) decimal105)]
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(byte, short, int, long, float, double, boolean, string, date, time, timestamp, decimal3020, decimal105)]]]), rowType=[RecordType(TINYINT byte, SMALLINT short, INTEGER int, BIGINT long, FLOAT float, DOUBLE double, BOOLEAN boolean, VARCHAR(2147483647) string, DATE date, TIME(0) time, TIMESTAMP(3) timestamp, DECIMAL(30, 20) decimal3020, DECIMAL(10, 5) decimal105)]
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(byte, short, int, long, float, double, boolean, string, date, time, timestamp, decimal3020, decimal105)]]]), rowType=[RecordType(TINYINT byte, SMALLINT short, INTEGER int, BIGINT long, FLOAT float, DOUBLE double, BOOLEAN boolean, VARCHAR(2147483647) string, DATE date, TIME(0) time, TIMESTAMP(3) timestamp, DECIMAL(30, 20) decimal3020, DECIMAL(10, 5) decimal105)]
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -409,7 +409,7 @@ HashAggregate(isMerge=[true], select=[Final_AVG(sum$0, count$1) AS EXPR$0, Final
 +- Exchange(distribution=[single]), rowType=[RecordType(BIGINT sum$0, BIGINT count$1, BIGINT sum$2, BIGINT count$3, BIGINT sum$4, BIGINT count$5, BIGINT sum$6, BIGINT count$7, DOUBLE sum$8, BIGINT count$9, DOUBLE sum$10, BIGINT count$11, DECIMAL(38, 20) sum$12, BIGINT count$13, DECIMAL(38, 5) sum$14, BIGINT count$15)]
    +- LocalHashAggregate(select=[Partial_AVG(byte) AS (sum$0, count$1), Partial_AVG(short) AS (sum$2, count$3), Partial_AVG(int) AS (sum$4, count$5), Partial_AVG(long) AS (sum$6, count$7), Partial_AVG(float) AS (sum$8, count$9), Partial_AVG(double) AS (sum$10, count$11), Partial_AVG(decimal3020) AS (sum$12, count$13), Partial_AVG(decimal105) AS (sum$14, count$15)]), rowType=[RecordType(BIGINT sum$0, BIGINT count$1, BIGINT sum$2, BIGINT count$3, BIGINT sum$4, BIGINT count$5, BIGINT sum$6, [...]
       +- Calc(select=[byte, short, int, long, float, double, decimal3020, decimal105]), rowType=[RecordType(TINYINT byte, SMALLINT short, INTEGER int, BIGINT long, FLOAT float, DOUBLE double, DECIMAL(30, 20) decimal3020, DECIMAL(10, 5) decimal105)]
-         +- TableSourceScan(table=[[MyTable, source: [TestTableSource(byte, short, int, long, float, double, boolean, string, date, time, timestamp, decimal3020, decimal105)]]], fields=[byte, short, int, long, float, double, boolean, string, date, time, timestamp, decimal3020, decimal105]), rowType=[RecordType(TINYINT byte, SMALLINT short, INTEGER int, BIGINT long, FLOAT float, DOUBLE double, BOOLEAN boolean, VARCHAR(2147483647) string, DATE date, TIME(0) time, TIMESTAMP(3) timestamp, DE [...]
+         +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(byte, short, int, long, float, double, boolean, string, date, time, timestamp, decimal3020, decimal105)]]], fields=[byte, short, int, long, float, double, boolean, string, date, time, timestamp, decimal3020, decimal105]), rowType=[RecordType(TINYINT byte, SMALLINT short, INTEGER int, BIGINT long, FLOAT float, DOUBLE double, BOOLEAN boolean, VARCHAR(2147483647) string, DATE date, TIME( [...]
 ]]>
     </Resource>
   </TestCase>
@@ -436,7 +436,7 @@ FROM MyTable
       <![CDATA[
 LogicalAggregate(group=[{}], EXPR$0=[COUNT($0)], EXPR$1=[COUNT($1)], EXPR$2=[COUNT($2)], EXPR$3=[COUNT($3)], EXPR$4=[COUNT($4)], EXPR$5=[COUNT($5)], EXPR$6=[COUNT($6)], EXPR$7=[COUNT($7)], EXPR$8=[COUNT($8)], EXPR$9=[COUNT($9)], EXPR$10=[COUNT($10)], EXPR$11=[COUNT($11)], EXPR$12=[COUNT($12)]), rowType=[RecordType(BIGINT EXPR$0, BIGINT EXPR$1, BIGINT EXPR$2, BIGINT EXPR$3, BIGINT EXPR$4, BIGINT EXPR$5, BIGINT EXPR$6, BIGINT EXPR$7, BIGINT EXPR$8, BIGINT EXPR$9, BIGINT EXPR$10, BIGINT EXP [...]
 +- LogicalProject(byte=[$0], short=[$1], int=[$2], long=[$3], float=[$4], double=[$5], decimal3020=[$11], decimal105=[$12], boolean=[$6], date=[$8], time=[$9], timestamp=[$10], string=[$7]), rowType=[RecordType(TINYINT byte, SMALLINT short, INTEGER int, BIGINT long, FLOAT float, DOUBLE double, DECIMAL(30, 20) decimal3020, DECIMAL(10, 5) decimal105, BOOLEAN boolean, DATE date, TIME(0) time, TIMESTAMP(3) timestamp, VARCHAR(2147483647) string)]
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(byte, short, int, long, float, double, boolean, string, date, time, timestamp, decimal3020, decimal105)]]]), rowType=[RecordType(TINYINT byte, SMALLINT short, INTEGER int, BIGINT long, FLOAT float, DOUBLE double, BOOLEAN boolean, VARCHAR(2147483647) string, DATE date, TIME(0) time, TIMESTAMP(3) timestamp, DECIMAL(30, 20) decimal3020, DECIMAL(10, 5) decimal105)]
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(byte, short, int, long, float, double, boolean, string, date, time, timestamp, decimal3020, decimal105)]]]), rowType=[RecordType(TINYINT byte, SMALLINT short, INTEGER int, BIGINT long, FLOAT float, DOUBLE double, BOOLEAN boolean, VARCHAR(2147483647) string, DATE date, TIME(0) time, TIMESTAMP(3) timestamp, DECIMAL(30, 20) decimal3020, DECIMAL(10, 5) decimal105)]
 ]]>
     </Resource>
     <Resource name="planAfter">
@@ -444,7 +444,7 @@ LogicalAggregate(group=[{}], EXPR$0=[COUNT($0)], EXPR$1=[COUNT($1)], EXPR$2=[COU
 HashAggregate(isMerge=[true], select=[Final_COUNT(count$0) AS EXPR$0, Final_COUNT(count$1) AS EXPR$1, Final_COUNT(count$2) AS EXPR$2, Final_COUNT(count$3) AS EXPR$3, Final_COUNT(count$4) AS EXPR$4, Final_COUNT(count$5) AS EXPR$5, Final_COUNT(count$6) AS EXPR$6, Final_COUNT(count$7) AS EXPR$7, Final_COUNT(count$8) AS EXPR$8, Final_COUNT(count$9) AS EXPR$9, Final_COUNT(count$10) AS EXPR$10, Final_COUNT(count$11) AS EXPR$11, Final_COUNT(count$12) AS EXPR$12]), rowType=[RecordType(BIGINT EXP [...]
 +- Exchange(distribution=[single]), rowType=[RecordType(BIGINT count$0, BIGINT count$1, BIGINT count$2, BIGINT count$3, BIGINT count$4, BIGINT count$5, BIGINT count$6, BIGINT count$7, BIGINT count$8, BIGINT count$9, BIGINT count$10, BIGINT count$11, BIGINT count$12)]
    +- LocalHashAggregate(select=[Partial_COUNT(byte) AS count$0, Partial_COUNT(short) AS count$1, Partial_COUNT(int) AS count$2, Partial_COUNT(long) AS count$3, Partial_COUNT(float) AS count$4, Partial_COUNT(double) AS count$5, Partial_COUNT(decimal3020) AS count$6, Partial_COUNT(decimal105) AS count$7, Partial_COUNT(boolean) AS count$8, Partial_COUNT(date) AS count$9, Partial_COUNT(time) AS count$10, Partial_COUNT(timestamp) AS count$11, Partial_COUNT(string) AS count$12]), rowType=[Rec [...]
-      +- TableSourceScan(table=[[MyTable, source: [TestTableSource(byte, short, int, long, float, double, boolean, string, date, time, timestamp, decimal3020, decimal105)]]], fields=[byte, short, int, long, float, double, boolean, string, date, time, timestamp, decimal3020, decimal105]), rowType=[RecordType(TINYINT byte, SMALLINT short, INTEGER int, BIGINT long, FLOAT float, DOUBLE double, BOOLEAN boolean, VARCHAR(2147483647) string, DATE date, TIME(0) time, TIMESTAMP(3) timestamp, DECIM [...]
+      +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(byte, short, int, long, float, double, boolean, string, date, time, timestamp, decimal3020, decimal105)]]], fields=[byte, short, int, long, float, double, boolean, string, date, time, timestamp, decimal3020, decimal105]), rowType=[RecordType(TINYINT byte, SMALLINT short, INTEGER int, BIGINT long, FLOAT float, DOUBLE double, BOOLEAN boolean, VARCHAR(2147483647) string, DATE date, TIME(0)  [...]
 ]]>
     </Resource>
   </TestCase>
@@ -471,14 +471,14 @@ FROM MyTable
       <![CDATA[
 LogicalAggregate(group=[{}], EXPR$0=[COUNT($0)], EXPR$1=[COUNT($1)], EXPR$2=[COUNT($2)], EXPR$3=[COUNT($3)], EXPR$4=[COUNT($4)], EXPR$5=[COUNT($5)], EXPR$6=[COUNT($6)], EXPR$7=[COUNT($7)], EXPR$8=[COUNT($8)], EXPR$9=[COUNT($9)], EXPR$10=[COUNT($10)], EXPR$11=[COUNT($11)], EXPR$12=[COUNT($12)]), rowType=[RecordType(BIGINT EXPR$0, BIGINT EXPR$1, BIGINT EXPR$2, BIGINT EXPR$3, BIGINT EXPR$4, BIGINT EXPR$5, BIGINT EXPR$6, BIGINT EXPR$7, BIGINT EXPR$8, BIGINT EXPR$9, BIGINT EXPR$10, BIGINT EXP [...]
 +- LogicalProject(byte=[$0], short=[$1], int=[$2], long=[$3], float=[$4], double=[$5], decimal3020=[$11], decimal105=[$12], boolean=[$6], date=[$8], time=[$9], timestamp=[$10], string=[$7]), rowType=[RecordType(TINYINT byte, SMALLINT short, INTEGER int, BIGINT long, FLOAT float, DOUBLE double, DECIMAL(30, 20) decimal3020, DECIMAL(10, 5) decimal105, BOOLEAN boolean, DATE date, TIME(0) time, TIMESTAMP(3) timestamp, VARCHAR(2147483647) string)]
-   +- LogicalTableScan(table=[[MyTable, source: [TestTableSource(byte, short, int, long, float, double, boolean, string, date, time, timestamp, decimal3020, decimal105)]]]), rowType=[RecordType(TINYINT byte, SMALLINT short, INTEGER int, BIGINT long, FLOAT float, DOUBLE double, BOOLEAN boolean, VARCHAR(2147483647) string, DATE date, TIME(0) time, TIMESTAMP(3) timestamp, DECIMAL(30, 20) decimal3020, DECIMAL(10, 5) decimal105)]
+   +- LogicalTableScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(byte, short, int, long, float, double, boolean, string, date, time, timestamp, decimal3020, decimal105)]]]), rowType=[RecordType(TINYINT byte, SMALLINT short, INTEGER int, BIGINT long, FLOAT float, DOUBLE double, BOOLEAN boolean, VARCHAR(2147483647) string, DATE date, TIME(0) time, TIMESTAMP(3) timestamp, DECIMAL(30, 20) decimal3020, DECIMAL(10, 5) decimal105)]
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
 HashAggregate(isMerge=[false], select=[COUNT(byte) AS EXPR$0, COUNT(short) AS EXPR$1, COUNT(int) AS EXPR$2, COUNT(long) AS EXPR$3, COUNT(float) AS EXPR$4, COUNT(double) AS EXPR$5, COUNT(decimal3020) AS EXPR$6, COUNT(decimal105) AS EXPR$7, COUNT(boolean) AS EXPR$8, COUNT(date) AS EXPR$9, COUNT(time) AS EXPR$10, COUNT(timestamp) AS EXPR$11, COUNT(string) AS EXPR$12]), rowType=[RecordType(BIGINT EXPR$0, BIGINT EXPR$1, BIGINT EXPR$2, BIGINT EXPR$3, BIGINT EXPR$4, BIGINT EXPR$5, BIGINT EXPR$6 [...]
 +- Exchange(distribution=[single]), rowType=[RecordType(TINYINT byte, SMALLINT short, INTEGER int, BIGINT long, FLOAT float, DOUBLE double, BOOLEAN boolean, VARCHAR(2147483647) string, DATE date, TIME(0) time, TIMESTAMP(3) timestamp, DECIMAL(30, 20) decimal3020, DECIMAL(10, 5) decimal105)]
-   +- TableSourceScan(table=[[MyTable, source: [TestTableSource(byte, short, int, long, float, double, boolean, string, date, time, timestamp, decimal3020, decimal105)]]], fields=[byte, short, int, long, float, double, boolean, string, date, time, timestamp, decimal3020, decimal105]), rowType=[RecordType(TINYINT byte, SMALLINT short, INTEGER int, BIGINT long, FLOAT float, DOUBLE double, BOOLEAN boolean, VARCHAR(2147483647) string, DATE date, TIME(0) time, TIMESTAMP(3) timestamp, DECIMAL( [...]
+   +- TableSourceScan(table=[[default_catalog, default_database, MyTable, source: [TestTableSource(byte, short, int, long, float, double, boolean, string, date, time, timestamp, decimal3020, decimal105)]]], fields=[byte, short, int, long, float, double, boolean, string, date, time, timestamp, decimal3020, decimal105]), rowType=[RecordType(TINYINT byte, SMALLINT short, INTEGER int, BIGINT long, FLOAT float, DOUBLE double, BOOLEAN boolean, VARCHAR(2147483647) string, DATE date, TIME(0) tim [...]
 ]]>
     </Resource>
... 43390 lines suppressed ...