twalthr commented on code in PR #28763: URL: https://github.com/apache/flink/pull/28763#discussion_r3613754552
########## flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/plan/nodes/exec/batch/LateralSnapshotJoinTestPrograms.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.planner.plan.nodes.exec.batch; + +import org.apache.flink.table.test.program.SinkTestStep; +import org.apache.flink.table.test.program.SourceTestStep; +import org.apache.flink.table.test.program.TableTestProgram; +import org.apache.flink.types.Row; + +/** + * {@link TableTestProgram} definitions for semantically testing {@code LATERAL SNAPSHOT} joins in + * batch mode, where the join degenerates to a regular join of the probe side against the (final) + * build side. + */ +public class LateralSnapshotJoinTestPrograms { + + private static SourceTestStep probe() { + return SourceTestStep.newBuilder("probe") + .addSchema("pk STRING", "pv INT") + .producedValues(Row.of("a", 1), Row.of("b", 2), Row.of("c", 3)) + .build(); + } + + private static SourceTestStep build() { + // The key "a" appears twice: the batch join runs against the final (complete) build side, + // so both "a" rows participate. + return SourceTestStep.newBuilder("b") + .addSchema("bk STRING", "bv INT") + .producedValues(Row.of("a", 10), Row.of("a", 11), Row.of("b", 20)) + .build(); + } + + public static final TableTestProgram INNER_JOIN = + TableTestProgram.of( + "lateral-snapshot-join-inner", + "batch LATERAL SNAPSHOT inner join degrades to a regular join") + .setupTableSource(probe()) + .setupTableSource(build()) + .setupTableSink( + SinkTestStep.newBuilder("sink") + .addSchema("pk STRING", "pv INT", "bk STRING", "bv INT") + .testMaterializedData() Review Comment: `testMaterializedData` can be removed, no? batch mode is always insert only -- 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]
