fhueske commented on code in PR #29421:
URL: https://github.com/apache/flink/pull/29421#discussion_r4250778469


##########
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/plan/nodes/exec/stream/LateralSnapshotJoinSemanticTestPrograms.java:
##########
@@ -193,6 +195,82 @@ public class LateralSnapshotJoinSemanticTestPrograms {
                                     "probe.pk = s.bk AND probe.pv > s.bv"))
                     .build();
 
+    public static final TableTestProgram NON_EQUI =
+            TableTestProgram.of(
+                            "lateral-snapshot-non-equi",
+                            "join with only a non-equi condition (no equi-key) 
runs single-threaded")
+                    .setupTableSource(
+                            probe(
+                                    Arrays.asList(
+                                            Row.of("a", 5, ts("00:01:00")),
+                                            Row.of("a", 15, ts("00:01:01")))))
+                    .setupTableSource(
+                            appendBuild(
+                                    withFlipTrigger(
+                                            Arrays.asList(
+                                                    Row.of("a", 10, 
ts("00:00:01")),
+                                                    Row.of("a", 20, 
ts("00:00:02"))))))
+                    .setupTableSink(
+                            SinkTestStep.newBuilder("sink")
+                                    .addSchema("pv INT", "bv INT")
+                                    .testMaterializedData()
+                                    .consumedValues("+I[5, 10]", "+I[5, 20]", 
"+I[15, 20]")
+                                    .build())
+                    // probe.pv < s.bv keeps the bv=0 flip-trigger row from 
matching any probe.
+                    .runSql(innerJoin("probe.pv, s.bv", MID_FLIP, "probe.pv < 
s.bv"))
+                    .build();
+
+    public static final TableTestProgram NON_EQUI_LEFT =
+            TableTestProgram.of(
+                            "lateral-snapshot-non-equi-left",
+                            "left join with only a non-equi condition 
null-pads unmatched probe rows")
+                    .setupTableSource(
+                            probe(
+                                    Arrays.asList(
+                                            Row.of("a", 5, ts("00:01:00")),
+                                            Row.of("a", 100, ts("00:01:01")))))
+                    .setupTableSource(
+                            appendBuild(
+                                    withFlipTrigger(
+                                            Arrays.asList(
+                                                    Row.of("a", 10, 
ts("00:00:01")),
+                                                    Row.of("a", 20, 
ts("00:00:02"))))))
+                    .setupTableSink(
+                            SinkTestStep.newBuilder("sink")
+                                    .addSchema("pv INT", "bv INT")
+                                    .testMaterializedData()
+                                    .consumedValues("+I[5, 10]", "+I[5, 20]", 
"+I[100, null]")

Review Comment:
   Good point! However, it's difficult to add such a test as a semantic test 
due to the non-determinism of the operator.
   I've added the test as a harness unit 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]

Reply via email to