Skip to content

Add TrackedFile adapter for v2 position delete files #16221

@anoopj

Description

@anoopj

Feature Request / Improvement

Context

TrackedFileAdapters currently provides adapters for:

  • asDataFile -- wraps a DATA TrackedFile as a DataFile
  • asEqualityDeleteFile -- wraps an EQUALITY_DELETES TrackedFile as a DeleteFile
  • asDVDeleteFile -- extracts the DV from a DATA TrackedFile as a DeleteFile

There is no adapter for v2-style position delete files (content type
POSITION_DELETES). Tables upgraded from v2 to v4 may still contain position
delete files that were written before the upgrade, and scan planning needs
to wrap these as DeleteFile instances.

See #16100 (comment)

Proposed change

Add asPositionDeleteFile(TrackedFile, Map<Integer, PartitionSpec>) to
TrackedFileAdapters. This can extend AbstractTrackedContentFile<DeleteFile>
with:

  • content() returning FileContent.POSITION_DELETES
  • firstRowId() returning null (per spec, first_row_id for delete files is always null)
  • equalityFieldIds() returning null

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
    No fields configured for issues without a type.

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions