Skip to content

fix: don't drop field metadata on merge insert path#5936

Merged
jackye1995 merged 4 commits intorelease/v2.0from
backport/pr-5927-to-release-v2.0
Feb 12, 2026
Merged

fix: don't drop field metadata on merge insert path#5936
jackye1995 merged 4 commits intorelease/v2.0from
backport/pr-5927-to-release-v2.0

Conversation

@lance-community
Copy link
Copy Markdown
Contributor

Backport of #5927

This PR backports the changes from the original PR to the release/v2.0 branch.

There are various ways to write data and several of them are failing for
JSON data at the moment because it requires a conversion from logical to
physical representation. I'd like to rework this more generally but I
want to get the current implementation working first. This fixes one of
the merge_insert paths which is currently failing because the field
metadata is lost as part of the operation (and so the data appears to be
a normal string column and is not converted)
@github-actions github-actions Bot added bug Something isn't working python labels Feb 11, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Code Review

Summary: This backport correctly fixes a bug where field metadata (needed for JSON extension types) was being lost during merge_insert operations.

The Fix

The one-line Rust change is correct:

// Before: Dropped field metadata
Arc::new(arrow_schema::Field::new(field.name(), field.data_type().clone(), field.is_nullable()))

// After: Preserves all field attributes including metadata
Arc::new(field.clone())

Using field.clone() instead of constructing a new Field ensures that Arrow extension type metadata (like arrow.json) is preserved through the merge_insert pipeline.

Test Coverage

Good test coverage added for:

  • JSON with compaction
  • JSON append
  • JSON merge_insert (directly tests the fix)

No issues identified. Clean backport of the original fix.

westonpace and others added 3 commits February 11, 2026 12:23
This will ensure JSON columns are properly converted in paths like
add_columns
Cherry-pick from main to fix CI recursion limit error.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Link: https://github.com/lance-format/lance/actions/runs/21917803271

Summary of failure:
- build-no-lock failed because rustc 1.90.0 is too old for updated
aws-smithy dependencies (requires 1.91).

Fixes applied:
- Bumped the pinned Rust toolchain to 1.91.0 to satisfy dependency MSRV
in no-lock builds.

---------

Co-authored-by: Jack Ye <yezhaoqin@gmail.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 12, 2026

Codecov Report

❌ Patch coverage is 74.26901% with 44 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
rust/lance/src/index.rs 73.24% 29 Missing and 13 partials ⚠️
rust/lance/src/dataset/updater.rs 87.50% 0 Missing and 1 partial ⚠️
rust/lance/src/dataset/utils.rs 80.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@jackye1995 jackye1995 merged commit 5320135 into release/v2.0 Feb 12, 2026
29 checks passed
@jackye1995 jackye1995 deleted the backport/pr-5927-to-release-v2.0 branch February 12, 2026 01:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants