xuyangzhong commented on a change in pull request #17537: URL: https://github.com/apache/flink/pull/17537#discussion_r735327135
########## File path: flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/factories/TestValuesFactoryUtils.java ########## @@ -0,0 +1,167 @@ +/* + * 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.planner.factories; + +import org.apache.flink.table.api.TableSchema; +import org.apache.flink.table.api.ValidationException; +import org.apache.flink.table.api.WatermarkSpec; +import org.apache.flink.table.catalog.CatalogTable; +import org.apache.flink.table.connector.ChangelogMode; +import org.apache.flink.table.types.DataType; +import org.apache.flink.table.types.logical.LogicalType; +import org.apache.flink.table.types.logical.utils.LogicalTypeParser; +import org.apache.flink.table.types.utils.DataTypeUtils; +import org.apache.flink.table.types.utils.TypeConversions; +import org.apache.flink.types.Row; +import org.apache.flink.types.RowKind; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** Utils for {@link TestValuesTableFactory}. */ +public class TestValuesFactoryUtils { + public static int validateAndExtractRowtimeIndex( + CatalogTable sinkTable, boolean dropLateEvent, boolean isInsertOnly) { + if (!dropLateEvent) { + return -1; + } else if (!isInsertOnly) { Review comment: Now the "-1" controls the sink function's behavior whether need to drop the late events or not. On one hand, if we delete the "-1" here, we should add an other arg to the sink function to drop invalid events. On the other, some test cases don't declare the watermark in source, and if deleting the code here, we will change many test cases. Based on it's not the main work in this pr, the previous logic will be retained. -- 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: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org