raminqaf commented on code in PR #28235: URL: https://github.com/apache/flink/pull/28235#discussion_r3311141329
########## flink-table/flink-table-common/src/test/java/org/apache/flink/table/types/inference/strategies/ToChangelogInputTypeStrategyTest.java: ########## @@ -0,0 +1,142 @@ +/* + * 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.types.inference.strategies; + +import org.apache.flink.table.api.DataTypes; +import org.apache.flink.table.types.DataType; +import org.apache.flink.table.types.inference.InputTypeStrategiesTestBase; +import org.apache.flink.table.types.inference.utils.TableSemanticsMock; +import org.apache.flink.types.ColumnList; + +import java.util.Map; +import java.util.stream.Stream; + +import static org.apache.flink.table.types.inference.strategies.SpecificInputTypeStrategies.TO_CHANGELOG_INPUT_TYPE_STRATEGY; + +/** Tests for {@link ToChangelogTypeStrategy#INPUT_TYPE_STRATEGY}. */ +class ToChangelogInputTypeStrategyTest extends InputTypeStrategiesTestBase { + + private static final DataType TABLE_TYPE = + DataTypes.ROW( + DataTypes.FIELD("name", DataTypes.STRING()), + DataTypes.FIELD("score", DataTypes.BIGINT())); + + private static final DataType DESCRIPTOR_TYPE = DataTypes.DESCRIPTOR(); + + private static final DataType MAP_TYPE = DataTypes.MAP(DataTypes.STRING(), DataTypes.STRING()); + + private static final DataType BOOLEAN_TYPE = DataTypes.BOOLEAN(); + + @Override + protected Stream<TestSpec> testData() { + return Stream.of( + // Valid: produces_full_deletes=true with default op_mapping (includes DELETE) + TestSpec.forStrategy( + "Valid produces_full_deletes=true with default mapping", + TO_CHANGELOG_INPUT_TYPE_STRATEGY) + .calledWithArgumentTypes( + TABLE_TYPE, DESCRIPTOR_TYPE, MAP_TYPE, BOOLEAN_TYPE) + .calledWithTableSemanticsAt(0, new TableSemanticsMock(TABLE_TYPE)) + .calledWithLiteralAt(1, ColumnList.of("op")) + .calledWithLiteralAt(2, null) + .calledWithLiteralAt(3, true) Review Comment: Done, all replaced with the const ########## flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/plan/nodes/exec/stream/ToChangelogTestPrograms.java: ########## @@ -598,4 +599,220 @@ public class ToChangelogTestPrograms { ValidationException.class, "Duplicate change operation: 'DELETE'") .build(); + + public static final TableTestProgram PRODUCES_FULL_DELETES_ON_APPEND_ONLY_INPUT = Review Comment: Moved and renamed test -- 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]
