godfreyhe commented on a change in pull request #18042: URL: https://github.com/apache/flink/pull/18042#discussion_r767377884
########## File path: flink-table/flink-table-planner/src/test/resources/org/apache/flink/table/planner/plan/nodes/exec/operator/BatchOperatorNameTest.xml ########## @@ -0,0 +1,2099 @@ +<?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="testBoundedStreamScan[isNameSimplifyEnabled=false]"> + <Resource name="explain"> + <![CDATA[== Abstract Syntax Tree == +LogicalProject(f0=[$0]) ++- LogicalTableScan(table=[[default_catalog, default_database, MyTable]]) + +== Optimized Physical Plan == +BoundedStreamScan(table=[[default_catalog, default_database, MyTable]], fields=[f0]) + Review comment: these part is unnecessary, only `Optimized Execution Plan` and `Physical Execution Plan` are enough. ########## File path: flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/config/OptimizerConfigOptions.java ########## @@ -123,4 +123,8 @@ .withDescription( "When it is true, the optimizer will merge the operators with pipelined shuffling " + "into a multiple input operator to reduce shuffling and improve performance. Default value is true."); + + @Documentation.TableOption(execMode = Documentation.ExecMode.BATCH_STREAMING) + public static final ConfigOption<Boolean> TABLE_OPTIMIZER_SIMPLIFY_OPERATOR_NAME_ENABLED = Review comment: please add detailed description to explain the option ########## File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/nodes/exec/common/CommonExecSink.java ########## @@ -348,10 +365,23 @@ private int deriveSinkParallelism( tableConfig.getIdleStateRetention().toMillis()), InternalSerializers.create(physicalRowType), equaliser); + final String[] fieldNames = physicalRowType.getFieldNames().toArray(new String[0]); + final List<String> pkFieldNames = + Arrays.stream(primaryKeys) + .mapToObj(idx -> fieldNames[idx]) + .collect(Collectors.toList()); + final String operatorDesc = + getFormattedOperatorDescription( + String.format("SinkMaterializer(pk=[%s])", String.join(", ", pkFieldNames)), Review comment: add a test case to cover it ? ########## File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/nodes/exec/stream/StreamExecIntervalJoin.java ########## @@ -280,34 +286,51 @@ public RowData map(RowData value) { OneInputTransformation<RowData, RowData> filterAllLeftStream = new OneInputTransformation<>( leftInputTransform, - "filter all left input transformation", + "Filter", new StreamFlatMap<>(allFilter), returnTypeInfo, leftParallelism); + filterAllLeftStream.setDescription( + getFormattedOperatorDescription("filter all left input transformation", config)); + filterAllLeftStream.setName( + getFormattedOperatorName(filterAllLeftStream.getDescription(), "Filter", config)); Review comment: "FilterLeft" ? ########## File path: flink-table/flink-table-planner/src/test/resources/explain/filesystem/testFileSystemTableSinkWithParallelismInStreamingSql0.out ########## @@ -15,9 +15,9 @@ Sink(table=[default_catalog.default_database.test_sink_table], fields=[id, real_ { "nodes" : [ { "id" : , - "type" : "Source: TableSourceScan(table=[[default_catalog, default_database, test_source_table]], fields=[id, real_col, double_col, decimal_col])", + "type" : "Source: test_source_table[1]", Review comment: replace the node id to avoid the unstable risk ? ########## File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/nodes/exec/stream/StreamExecIntervalJoin.java ########## @@ -280,34 +286,51 @@ public RowData map(RowData value) { OneInputTransformation<RowData, RowData> filterAllLeftStream = new OneInputTransformation<>( leftInputTransform, - "filter all left input transformation", + "Filter", new StreamFlatMap<>(allFilter), returnTypeInfo, leftParallelism); + filterAllLeftStream.setDescription( + getFormattedOperatorDescription("filter all left input transformation", config)); + filterAllLeftStream.setName( + getFormattedOperatorName(filterAllLeftStream.getDescription(), "Filter", config)); OneInputTransformation<RowData, RowData> filterAllRightStream = new OneInputTransformation<>( rightInputTransform, - "filter all right input transformation", + "Filter", new StreamFlatMap<>(allFilter), returnTypeInfo, rightParallelism); + filterAllRightStream.setDescription( + getFormattedOperatorDescription("filter all right input transformation", config)); + filterAllRightStream.setName( + getFormattedOperatorName(filterAllRightStream.getDescription(), "Filter", config)); Review comment: "FilterRight" ? ########## File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/nodes/exec/common/CommonExecTableSourceScan.java ########## @@ -69,14 +69,19 @@ protected CommonExecTableSourceScan( this.tableSourceSpec = tableSourceSpec; } + @Override + public String getSimplifiedName() { + return tableSourceSpec.getObjectIdentifier().getObjectName(); Review comment: use full identifier to avoid name conflicts ? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
