Skip to content

fix!: derive merge_columns field ids from the dataset manifest - #9547

Merged
zhangyue19921010 merged 4 commits into
lance-format:mainfrom
zhangyue19921010:fix/merge-columns-max-field-id
Sep 29, 2026
Merged

zhangyue19921010 merged 4 commits into
lance-format:mainfrom
zhangyue19921010:fix/merge-columns-max-field-id

Conversation

@zhangyue19921010

@zhangyue19921010 zhangyue19921010 commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

FileFragment::merge_columns assigned new schema field ids from the caller-supplied max_field_id, while the Updater assigned data file field ids from the dataset manifest. When the two differed, the Merge commit succeeded but the new columns read back as null (or, with dropped columns, could alias stale data).

Remove the max_field_id parameter and always use the manifest's max_field_id(), the same source the Updater uses. Every in-tree caller already passed that value, so the Python LanceFragment.merge and Java Fragment.mergeColumns APIs are unchanged.

BREAKING CHANGE: FileFragment::merge_columns no longer takes a max_field_id argument.

@github-actions github-actions Bot added the bug Something isn't working label Sep 24, 2026
`FileFragment::merge_columns` assigned new schema field ids from the
caller-supplied `max_field_id`, while the `Updater` assigned data file
field ids from the dataset manifest. When the two differed, the `Merge`
commit succeeded but the new columns read back as `null` (or, with
dropped columns, could alias stale data).

Remove the `max_field_id` parameter and always use the manifest's
`max_field_id()`, the same source the `Updater` uses. Every in-tree
caller already passed that value, so the Python `LanceFragment.merge`
and Java `Fragment.mergeColumns` APIs are unchanged.

BREAKING CHANGE: `FileFragment::merge_columns` no longer takes a
`max_field_id` argument.
@zhangyue19921010
zhangyue19921010 force-pushed the fix/merge-columns-max-field-id branch from f7b1e71 to 9608b86 Compare September 24, 2026 07:49
@github-actions github-actions Bot added A-python Python bindings A-java Java bindings + JNI labels Sep 24, 2026
@zhangyue19921010 zhangyue19921010 changed the title fix: reject mismatched max_field_id in FileFragment::merge_columns fix!: derive merge_columns field ids from the dataset manifest Sep 24, 2026

@lance-gatekeeper lance-gatekeeper Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Gate recommendation: approve.

Using the fragment's manifest as the ID source makes the returned schema agree with the updater's data file after dropped columns. This removes the mismatch without maintaining a caller-supplied ID.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Sep 24, 2026

@yanghua yanghua left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM. Left one non-blocked comment.

Comment thread rust/lance/src/dataset/fragment.rs Resolved
@lance-gatekeeper lance-gatekeeper Bot removed the K-approved Latest Gatekeeper recommendation permits acceptance. label Sep 28, 2026
@zhangyue19921010

zhangyue19921010 commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator Author

LGTM. Left one non-blocked comment.

CI Passed. Thanks a lot for your review teacher yang @yanghua :P

@zhangyue19921010
zhangyue19921010 merged commit 08d0440 into lance-format:main Sep 29, 2026
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-java Java bindings + JNI A-python Python bindings breaking-change bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants