Skip to content

feat: add free-form metadata map to DataFragment#6920

Open
jackye1995 wants to merge 3 commits into
lance-format:mainfrom
jackye1995:jack/fragment-metadata
Open

feat: add free-form metadata map to DataFragment#6920
jackye1995 wants to merge 3 commits into
lance-format:mainfrom
jackye1995:jack/fragment-metadata

Conversation

@jackye1995
Copy link
Copy Markdown
Contributor

Summary

  • Add map<string, string> metadata field to DataFragment protobuf for lightweight per-fragment key-value metadata (e.g., creation time, process ID).
  • Extend UpdateConfig transaction with fragment_metadata_updates to support updating fragment metadata, using existing UpdateMap semantics (merge or replace mode).
  • Add conflict detection: two UpdateConfig transactions conflict if they modify metadata on the same fragment ID.
  • Update transaction spec doc.

Voting Discussion

This is a spec change. A corresponding [VOTE] discussion will be created separately.

Add a `map<string, string> metadata` field to `DataFragment` for
lightweight key-value metadata (e.g., creation time, process ID).

Extend `UpdateConfig` transaction with `fragment_metadata_updates`
to support updating fragment metadata with the same `UpdateMap`
semantics used for table/schema/field metadata, including conflict
detection for concurrent updates to the same fragment.
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@github-actions github-actions Bot added the enhancement New feature or request label May 23, 2026
- Add fragment_metadata_updates to has_new_fields check in proto
  deserialization to prevent silent data loss
- Add conflict detection for UpdateConfig fragment metadata against
  Overwrite, Restore, Delete, and Update operations
- Update spec doc with new conflict semantics
Old writers that do not understand fragment metadata must not overwrite
a manifest containing it, as they would silently drop the metadata.
Add FLAG_FRAGMENT_METADATA (bit 64) as a writer-only feature flag,
set automatically when any fragment has non-empty metadata.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 23, 2026

Codecov Report

❌ Patch coverage is 87.92271% with 25 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
rust/lance/src/dataset/transaction.rs 80.90% 19 Missing and 2 partials ⚠️
rust/lance/src/io/commit/conflict_resolver.rs 73.33% 2 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant