jnh5y commented on code in PR #23869: URL: https://github.com/apache/flink/pull/23869#discussion_r1416020844
########## flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/plan/nodes/exec/testutils/JoinTestPrograms.java: ########## @@ -0,0 +1,450 @@ +/* + * 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.testutils; + +import org.apache.flink.table.planner.plan.nodes.exec.stream.StreamExecJoin; +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 testing {@link StreamExecJoin}. */ +public class JoinTestPrograms { + static final TableTestProgram NON_WINDOW_INNER_JOIN; + static final TableTestProgram NON_WINDOW_INNER_JOIN_WITH_NULL; + static final TableTestProgram CROSS_JOIN; + static final TableTestProgram JOIN_WITH_FILTER; + static final TableTestProgram INNER_JOIN_WITH_DUPLICATE_KEY; + static final TableTestProgram INNER_JOIN_WITH_NON_EQUI_JOIN; + static final TableTestProgram INNER_JOIN_WITH_EQUAL_PK; + static final TableTestProgram INNER_JOIN_WITH_PK; + static final TableTestProgram LEFT_JOIN; + static final TableTestProgram FULL_OUTER; + static final TableTestProgram RIGHT_JOIN; + static final TableTestProgram SEMI_JOIN; + static final TableTestProgram ANTI_JOIN; + + static final SourceTestStep EMPLOYEE = + SourceTestStep.newBuilder("EMPLOYEE") + .addSchema("deptno int", "salary bigint", "name varchar") + .addOption("filterable-fields", "salary") + .producedBeforeRestore( + Row.of(null, 101L, "Adam"), + Row.of(1, 1L, "Baker"), + Row.of(2, 2L, "Charlie"), + Row.of(3, 2L, "Don"), + Row.of(7, 6L, "Victor")) + .producedAfterRestore( + Row.of(4, 3L, "Juliet"), + Row.of(4, 4L, "Helena"), + Row.of(1, 1L, "Ivana")) + .build(); + + static final SourceTestStep DEPARTMENT = + SourceTestStep.newBuilder("DEPARTMENT") + .addSchema( + "department_num int", "b2 bigint", "b3 int", "department_name varchar") + .producedBeforeRestore( + Row.of(null, 102L, 0, "Accounting"), + Row.of(1, 1L, 0, "Research"), + Row.of(2, 2L, 1, "Human Resources"), + Row.of(2, 3L, 2, "HR"), + Row.of(3, 1L, 2, "Sales")) + .producedAfterRestore( + Row.of(2, 4L, 3, "People Operations"), Row.of(4, 2L, 4, "Engineering")) + .build(); + + static final SourceTestStep DEPARTMENT_NONULLS = + SourceTestStep.newBuilder("DEPARTMENT") + .addSchema( + "department_num int", "b2 bigint", "b3 int", "department_name varchar") + .producedBeforeRestore( + Row.of(1, 1L, 0, "Research"), + Row.of(2, 2L, 1, "Human Resources"), + Row.of(2, 3L, 2, "HR"), + Row.of(3, 1L, 2, "Sales")) + .producedAfterRestore(Row.of(2, 4L, 3, "People Operations")) + .build(); + static final SourceTestStep SOURCE_T1 = + SourceTestStep.newBuilder("T1") + .addSchema("a int", "b bigint", "c varchar") + .producedBeforeRestore( + Row.of(1, 1L, "Baker1"), + Row.of(1, 2L, "Baker2"), + Row.of(1, 2L, "Baker2"), + Row.of(1, 5L, "Baker3"), + Row.of(2, 7L, "Baker5"), + Row.of(1, 9L, "Baker6"), + Row.of(1, 8L, "Baker8"), + Row.of(3, 8L, "Baker9")) + .producedAfterRestore(Row.of(1, 1L, "PostRestore")) + .build(); + static final SourceTestStep SOURCE_T2 = + SourceTestStep.newBuilder("T2") + .addSchema("a int", "b bigint", "c varchar") + .producedBeforeRestore( + Row.of(1, 1L, "BakerBaker"), + Row.of(2, 2L, "HeHe"), + Row.of(3, 2L, "HeHe")) + .producedAfterRestore(Row.of(2, 1L, "PostRestoreRight")) + .build(); + + static { + NON_WINDOW_INNER_JOIN = + TableTestProgram.of("non-window-inner-join", "test non-window inner join") Review Comment: Yes! -- 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