nastra commented on code in PR #8980: URL: https://github.com/apache/iceberg/pull/8980#discussion_r1383492951
########## spark/v3.4/spark/src/test/java/org/apache/iceberg/spark/source/TestStructuredStreamingRead3.java: ########## @@ -497,6 +500,67 @@ public void testReadStreamWithSnapshotTypeOverwriteErrorsOut() throws Exception .hasMessageStartingWith("Cannot process overwrite snapshot"); } + @Test + public void testReadStreamWithSnapshotTypeRewriteDataFilesIgnoresReplace() throws Exception { + // fill table with some data + List<List<SimpleRecord>> expected = TEST_DATA_MULTIPLE_SNAPSHOTS; + appendDataAsMultipleSnapshots(expected); + + makeRewriteDataFiles(); + + Iterable<Snapshot> snapshots = table.snapshots(); + for (Snapshot s : snapshots) { + System.out.println(s.snapshotId()); + } + + Assert.assertEquals( + 6, + microBatchCount( + ImmutableMap.of(SparkReadOptions.STREAMING_MAX_FILES_PER_MICRO_BATCH, "1"))); + } + + @Test + public void testReadStreamWithSnapshotType2RewriteDataFilesIgnoresReplace() throws Exception { + // fill table with some data + List<List<SimpleRecord>> expected = TEST_DATA_MULTIPLE_SNAPSHOTS; + appendDataAsMultipleSnapshots(expected); + + makeRewriteDataFiles(); + makeRewriteDataFiles(); + + Iterable<Snapshot> snapshots = table.snapshots(); + for (Snapshot s : snapshots) { + System.out.println(s.snapshotId()); + } + + Assert.assertEquals( + 6, + microBatchCount( + ImmutableMap.of(SparkReadOptions.STREAMING_MAX_FILES_PER_MICRO_BATCH, "1"))); + } + + @Test + public void testReadStreamWithSnapshotTypeRewriteDataFilesIgnoresReplaceFollowedByAppend() + throws Exception { + // fill table with some data + List<List<SimpleRecord>> expected = TEST_DATA_MULTIPLE_SNAPSHOTS; + appendDataAsMultipleSnapshots(expected); + + makeRewriteDataFiles(); + + appendDataAsMultipleSnapshots(expected); + + Iterable<Snapshot> snapshots = table.snapshots(); + for (Snapshot s : snapshots) { + System.out.println(s.snapshotId()); + } + + Assert.assertEquals( Review Comment: please use AssertJ-style assertions for newly written test code: https://iceberg.apache.org/contribute/#assertj -- 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...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org