luoyuxia commented on code in PR #1674:
URL: https://github.com/apache/fluss/pull/1674#discussion_r2338397209


##########
fluss-lake/fluss-lake-paimon/src/test/java/org/apache/fluss/lake/paimon/flink/FlinkUnionReadPrimaryKeyTableITCase.java:
##########
@@ -592,6 +598,244 @@ void testUnionReadInStreamMode(Boolean isPartitioned) 
throws Exception {
         }
     }
 
+    @ParameterizedTest
+    @ValueSource(booleans = {false, true})
+    void testUnionReadPrimaryKeyTableFailover(boolean isPartitioned) throws 
Exception {
+        // first of all, start tiering
+        JobClient jobClient = buildTieringJob(execEnv);
+
+        String tableName1 =
+                "restore_pk_table_" + (isPartitioned ? "partitioned" : 
"non_partitioned");
+        String resultTableName =
+                "result_pk_table_" + (isPartitioned ? "partitioned" : 
"non_partitioned");
+
+        TablePath table1 = TablePath.of(DEFAULT_DB, tableName1);
+        TablePath resultTable = TablePath.of(DEFAULT_DB, resultTableName);
+
+        // create table and write data
+        Map<TableBucket, Long> bucketLogEndOffset = new HashMap<>();
+        long tableId =
+                preparePKTableFullType(
+                        table1, DEFAULT_BUCKET_NUM, isPartitioned, 
bucketLogEndOffset);
+
+        // wait until records has been synced
+        waitUntilBucketSynced(table1, tableId, DEFAULT_BUCKET_NUM, 
isPartitioned);
+
+        // check the status of replica after synced
+        assertReplicaStatus(table1, tableId, DEFAULT_BUCKET_NUM, 
isPartitioned, bucketLogEndOffset);
+
+        // create result table
+        createPkTableFullType(resultTable, DEFAULT_BUCKET_NUM, isPartitioned, 
false);
+        // union read lake data
+        // TODO should add a case, stop job and restorewhen read lake data 
break in lake read
+        StreamTableEnvironment streamTEnv = buildSteamTEnv(null);
+        TableResult insertResult =
+                streamTEnv.executeSql(
+                        "insert into " + resultTableName + " select * from " + 
tableName1);
+
+        // will read paimon snapshot, should only +I since no change log
+        List<Row> expectedRows = new ArrayList<>();
+        if (isPartitioned) {

Review Comment:
   See my comment in 
https://github.com/apache/fluss/pull/1658#discussion_r2332113640
   
   `Coud we just use two columns int, string to make the test simple`



-- 
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...@fluss.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to