ajantha-bhat commented on code in PR #6091:
URL: https://github.com/apache/iceberg/pull/6091#discussion_r1129900195
##########
spark/v3.3/spark-extensions/src/test/java/org/apache/iceberg/spark/extensions/TestExpireSnapshotsProcedure.java:
##########
@@ -384,10 +402,105 @@ public void
testExpireSnapshotsProcedureWorksWithSqlComments() {
+ " table => '%s',"
+ " retain_last => 1)";
List<Object[]> output = sql(callStatement, catalogName, currentTimestamp,
tableIdent);
- assertEquals("Procedure output must match", ImmutableList.of(row(0L, 0L,
0L, 0L, 1L)), output);
+ assertEquals(
+ "Procedure output must match", ImmutableList.of(row(0L, 0L, 0L, 0L,
1L, 0L)), output);
table.refresh();
Assert.assertEquals("Should be 1 snapshot remaining", 1,
Iterables.size(table.snapshots()));
}
+
+ @Test
+ public void testExpireSnapshotsWithStatisticFiles() throws Exception {
+ sql(
+ "CREATE TABLE %s USING iceberg "
+ + "TBLPROPERTIES('format-version'='2') "
+ + "AS SELECT 10 int, 'abc' data",
+ tableName);
+ Table table = Spark3Util.loadIcebergTable(spark, tableName);
+ String statsFileLocation1 = statsFileLocation(table.location());
+ StatisticsFile statisticsFile1 =
+ writeStatsFile(
+ table.currentSnapshot().snapshotId(),
+ table.currentSnapshot().sequenceNumber(),
+ statsFileLocation1,
+ table.io());
+ table.updateStatistics().setStatistics(statisticsFile1.snapshotId(),
statisticsFile1).commit();
+
+ sql("INSERT INTO %s SELECT 20, 'def'", tableName);
+ table = Spark3Util.loadIcebergTable(spark, tableName);
Review Comment:
followed other testcase (there was one testcase using it) in the file. fixed
it too now.
--
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]