Skip to content

feat(manifest): Extent manifest to support iceberg v3 format - #560

Merged
zeroshade merged 3 commits into
apache:mainfrom
dttung2905:iceberg-v3-support
Sep 17, 2025
Merged

zeroshade merged 3 commits into
apache:mainfrom
dttung2905:iceberg-v3-support

Conversation

@dttung2905

Copy link
Copy Markdown
Contributor

Hi team,
This is the first of the many PR to support for Iceberg v3. In this PR, I try to outline some structural changes to the interface without making it too big and hard to review. More PR to come as we implement manifest list writer for v3

@dttung2905
dttung2905 marked this pull request as ready for review September 16, 2025 18:49
Comment thread manifest.go Outdated
func (v3writerImpl) content() ManifestContent { return ManifestContentData }
func (v3writerImpl) prepareEntry(entry *manifestEntry, snapshotID int64) (ManifestEntry, error) {
// TODO : implement this for v3
return entry, nil

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return a not-implemented-error for now

Comment thread manifest.go Outdated

func NewManifestListWriterV3() (*ManifestListWriter, error) {
// TODO: Implement v3 writer
return nil, errors.New("not implemented manifest list writer for v3 yet")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use fmt.Errorf("%w: manifest list writer for v3", iceberg.ErrNotImplemented)

Comment thread manifest.go Outdated
Comment on lines +1362 to +1379
// Ref: https://github.com/apache/iceberg/blob/ea2071568dc66148b483a82eefedcd2992b435f7/core/src/main/java/org/apache/iceberg/V3Metadata.java#L98-L122
if wrapped.SeqNumber == -1 {
if m.commitSnapshotID != wrapped.AddedSnapshotID {
return fmt.Errorf("found unassigned sequence number for a manifest from snapshot %d != %d",
m.commitSnapshotID, wrapped.AddedSnapshotID)
}
wrapped.SeqNumber = m.sequenceNumber
}

if wrapped.MinSeqNumber == -1 {
if m.commitSnapshotID != wrapped.AddedSnapshotID {
return fmt.Errorf("found unassigned sequence number for a manifest from snapshot: %d", wrapped.AddedSnapshotID)
}
wrapped.MinSeqNumber = m.sequenceNumber
}
if err := m.writer.Encode(wrapped); err != nil {
return err
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since this logic is identical between v2 and v3, is there any way we can consolidate the logic and reduce the duplication?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initially, I want it to be separated from version 2 to avoid changing the existing logic as much as possible. But yes you are right, the only different is from the first row id for lineage tracking. I have combined both logic

Comment thread manifest.go Outdated
Comment on lines +1407 to +1408
// TODO
writer, err = NewManifestListWriterV3()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return a not-implemented-error for now

Signed-off-by: dttung2905 <[email protected]>
@zeroshade
zeroshade merged commit 498d83f into apache:main Sep 17, 2025
@laskoviymishka laskoviymishka mentioned this pull request May 5, 2026
48 of 58 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants