FANNG1 commented on code in PR #9286:
URL: https://github.com/apache/gravitino/pull/9286#discussion_r2570322944
##########
iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/service/rest/TestIcebergTableOperations.java:
##########
@@ -233,25 +214,11 @@ void
testPlanTableScanWithIncrementalAppendScanValidRange(Namespace namespace) {
Assertions.assertNotNull(snapshots, "Snapshots should not be null");
Assertions.assertTrue(snapshots.size() >= 2, "Should have at least 2
snapshots");
- // Sort by sequence number to get ordered snapshots
- List<Snapshot> sortedSnapshots =
- snapshots.stream()
- .sorted((s1, s2) -> Long.compare(s1.snapshotId(), s2.snapshotId()))
- .collect(java.util.stream.Collectors.toList());
-
- Assertions.assertTrue(
- sortedSnapshots.size() >= 2,
- "Should have at least 2 snapshots for incremental scan test, but got: "
- + sortedSnapshots.size());
-
- // For IncrementalAppendScan, start snapshot must be an ancestor of end
snapshot
- // Use the last snapshot as end, and find its parent from the sorted list
- Snapshot endSnapshot = sortedSnapshots.get(sortedSnapshots.size() - 1);
+ Snapshot endSnapshot = snapshots.get(snapshots.size() - 1);
Long endSnapshotId = endSnapshot.snapshotId();
- Long startSnapshotId = endSnapshot.parentId();
+ Snapshot startSnapshot = snapshots.get(snapshots.size() - 2);
+ Long startSnapshotId = startSnapshot.snapshotId();
Review Comment:
fixed
--
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]