mikedias commented on code in PR #780:
URL: https://github.com/apache/incubator-xtable/pull/780#discussion_r2659996404


##########
xtable-core/src/test/java/org/apache/xtable/paimon/TestPaimonConversionSource.java:
##########
@@ -165,38 +167,105 @@ void 
testGetCurrentSnapshotThrowsExceptionWhenNoSnapshot() {
   }
 
   @Test
-  void testGetTableChangeForCommitThrowsUnsupportedOperationException() {
+  void testGetCommitsBacklogReturnsCommitsAfterLastSync() {
+    // Insert initial data to create first snapshot
+    testTable.insertRows(5);
+    Snapshot firstSnapshot = paimonTable.snapshotManager().latestSnapshot();
+    assertNotNull(firstSnapshot);
+
+    // Insert more data to create second snapshot
     testTable.insertRows(3);
-    Snapshot snapshot = paimonTable.snapshotManager().latestSnapshot();
+    Snapshot secondSnapshot = paimonTable.snapshotManager().latestSnapshot();
+    assertNotNull(secondSnapshot);
+    assertNotEquals(firstSnapshot.id(), secondSnapshot.id());
 
-    UnsupportedOperationException exception =
-        assertThrows(
-            UnsupportedOperationException.class,
-            () -> conversionSource.getTableChangeForCommit(snapshot));
+    // Get commits backlog from first snapshot time
+    InstantsForIncrementalSync instantsForSync =
+        InstantsForIncrementalSync.builder()
+            .lastSyncInstant(Instant.ofEpochMilli(firstSnapshot.timeMillis()))
+            .build();
+
+    CommitsBacklog<Snapshot> backlog = 
conversionSource.getCommitsBacklog(instantsForSync);
+
+    // Verify we get at least the second snapshot (may get more if insertRows 
creates multiple)

Review Comment:
   Paimon can trigger compaction at different times depending on the settings. 
It wouldn't be the case for this particular test, but it would make it flaky if 
we change things and don't consider this scenario on the 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