Skip to content

Clean expired metadata doesn't work when there is no snapshot #13294

Closed
@lirui-apache

Description

@lirui-apache

Feature Request / Improvement

ExpireSnapshots is NOP when there is no snapshot. But I think it's more intuitive to clean expired metadata in that case, if we're told to do so. For example, I would expect this test to pass

  @TestTemplate
  public void test() throws Exception {
    table.updateSchema().addColumn("extra_col1", Types.StringType.get()).commit();
    table.updateSchema().addColumn("extra_col2", Types.StringType.get()).commit();

    removeSnapshots(table)
        .expireOlderThan(System.currentTimeMillis())
        .cleanExpiredMetadata(true)
        .commit();

    assertThat(table.schemas()).hasSize(1);
  }

Query engine

None

Willingness to contribute

  • I can contribute this improvement/feature independently
  • I would be willing to contribute this improvement/feature with guidance from the Iceberg community
  • I cannot contribute this improvement/feature at this time

Metadata

Metadata

Assignees

No one assigned

    Labels

    improvementPR that improves existing functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions