Au-Miner commented on code in PR #27099:
URL: https://github.com/apache/flink/pull/27099#discussion_r2443937199


##########
flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/runtime/stream/sql/DeltaJoinITCase.scala:
##########
@@ -129,7 +136,38 @@ class DeltaJoinITCase extends StreamingTestBase {
       .hasMessageContaining("The current sql doesn't support to do delta join 
optimization.")
   }
 
-  @Test
+  @TestTemplate
+  def testDataWithSameJoinKeyColValues(): Unit = {
+    val data1 = List(
+      changelogRow("+I", Double.box(1.0), Int.box(1), LocalDateTime.of(2021, 
1, 1, 1, 1, 1)),
+      changelogRow("+I", Double.box(1.0), Int.box(1), LocalDateTime.of(2022, 
2, 2, 2, 2, 2)),
+      // mismatch
+      changelogRow("+I", Double.box(3.0), Int.box(3), LocalDateTime.of(2023, 
3, 3, 3, 3, 3))
+    )
+
+    val data2 = List(
+      changelogRow("+I", Int.box(1), Double.box(1.0), LocalDateTime.of(2021, 
1, 1, 1, 1, 1)),
+      changelogRow("+I", Int.box(1), Double.box(1.0), LocalDateTime.of(2022, 
2, 2, 2, 2, 22)),
+      // mismatch
+      changelogRow("+I", Int.box(99), Double.box(99.0), LocalDateTime.of(2099, 
2, 2, 2, 2, 2))
+    )
+
+    // TestValuesRuntimeFunctions#KeyedUpsertingSinkFunction will change the 
RowKind from
+    // "+U" to "+I"
+    val expected = List(
+      "+I[1.0, 1, 2022-02-02T02:02:02, 1, 1.0, 2022-02-02T02:02:22]"
+    )
+    testUpsertResult(
+      List("a1"),
+      List("b1"),
+      data1,
+      data2,
+      "a1 = b1",
+      expected,
+      if (enableCache) 4 else 6)
+  }
+

Review Comment:
   The current testJoinKeyContainsIndex does not have SameJoinKeyColValues 
enabled, so even if enableCache is used, there will be no difference.
   
   Assuming we test JoinKeyContainsIndex under the condition of 
SameJoinKeyColValues, there will be a discrepancy in the expected 
LookupFunctionInvokeCount within the testUpsertResult.



-- 
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