lvyanquan commented on code in PR #5486:
URL: https://github.com/apache/iceberg/pull/5486#discussion_r950689430


##########
flink/v1.14/flink/src/test/java/org/apache/iceberg/flink/TestFlinkUpsert.java:
##########
@@ -127,33 +127,32 @@ public void testUpsertAndQuery() {
     LocalDate dt20220302 = LocalDate.of(2022, 3, 2);
 
     sql(
-        "CREATE TABLE %s(id INT NOT NULL, province STRING NOT NULL, dt DATE, 
PRIMARY KEY(id,province) NOT ENFORCED) "
-            + "PARTITIONED BY (province) WITH %s",
+        "CREATE TABLE %s(id INT NOT NULL, name STRING NOT NULL, dt DATE, 
PRIMARY KEY(id,dt) NOT ENFORCED) "
+            + "PARTITIONED BY (dt) WITH %s",
         tableName, toWithClause(tableUpsertProps));
 
     try {
       sql(
           "INSERT INTO %s VALUES "
-              + "(1, 'a', DATE '2022-03-01'),"
-              + "(2, 'b', DATE '2022-03-01'),"
-              + "(1, 'b', DATE '2022-03-01')",
+              + "(1, 'Bill', DATE '2022-03-01'),"
+              + "(1, 'Jane', DATE '2022-03-01'),"
+              + "(2, 'Jane', DATE '2022-03-01')",
           tableName);
 
       sql(
           "INSERT INTO %s VALUES "
-              + "(4, 'a', DATE '2022-03-02'),"
-              + "(5, 'b', DATE '2022-03-02'),"
-              + "(1, 'b', DATE '2022-03-02')",
+              + "(2, 'Bill', DATE '2022-03-01'),"
+              + "(1, 'Jane', DATE '2022-03-02'),"
+              + "(2, 'Jane', DATE '2022-03-02')",
           tableName);
 
       List<Row> rowsOn20220301 =
-          Lists.newArrayList(Row.of(2, "b", dt20220301), Row.of(1, "a", 
dt20220301));
+          Lists.newArrayList(Row.of(1, "Jane", dt20220301), Row.of(2, "Bill", 
dt20220301));
       TestHelpers.assertRows(
           sql("SELECT * FROM %s WHERE dt < '2022-03-02'", tableName), 
rowsOn20220301);
 
       List<Row> rowsOn20220302 =
-          Lists.newArrayList(
-              Row.of(1, "b", dt20220302), Row.of(4, "a", dt20220302), 
Row.of(5, "b", dt20220302));
+          Lists.newArrayList(Row.of(1, "Jane", dt20220302), Row.of(2, "Jane", 
dt20220302));

Review Comment:
   include two situation:
   1)  update rows in one transaction or rows between two transaction if they 
have the same value in primary columns.
   2) don't update rows if they have the same value in only part primary 
columns.
   



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to