nastra commented on issue #15307:
URL: https://github.com/apache/iceberg/issues/15307#issuecomment-3895470603
I slightly modified Russells test but I'm not able to reproduce this on
latest main with Spark 4.1:
```
{
sql(
"CREATE TABLE %s (id bigint, data string) USING iceberg
TBLPROPERTIES"
+ "('format-version'='%s')",
tableName, formatVersion);
// Perform 110 commits by changing table properties
for (int i = 0; i < 110; i++) {
sql("ALTER TABLE %s SET TBLPROPERTIES('test.property.%d' '%d')",
tableName, i, i);
}
Table table = Spark3Util.loadIcebergTable(spark, tableName);
table.refresh();
TableMetadata tableMetadata = ((HasTableOperations)
table).operations().current();
// Verify that previousFiles (metadata log) has at most 100 entries
// The metadata log tracks up to write.metadata.previous-versions-max
previous metadata files
assertThat(tableMetadata.previousFiles())
.as("Metadata log should be limited to 100 entries by
write.metadata.previous-versions-max")
.hasSizeLessThanOrEqualTo(100);
sql(
"ALTER TABLE %s SET
TBLPROPERTIES('write.metadata.delete-after-commit.enabled' = 'false', "
+ "'write.metadata.previous-versions-max'='10')",
tableName);
table = Spark3Util.loadIcebergTable(spark, tableName);
table.refresh();
tableMetadata = ((HasTableOperations) table).operations().current();
assertThat(tableMetadata.previousFiles()).hasSize(10);
}
````
Out of curiosity, what catalog are you using?
--
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]