refactor: merge JsonConvertingReader into SchemaAdapter#7678
Open
xloya wants to merge 1 commit into
Open
Conversation
The merge/update path used a bespoke `JsonConvertingReader` that only converted Arrow JSON columns, duplicating logic already present in `SchemaAdapter`. Replace it with `SchemaAdapter::to_physical_reader` so the sync reader path shares the same logical-to-physical conversion as the write stream path (Arrow JSON -> Lance JSON, view types -> offset types), resolving the TODO left in lance-format#7472. As a result, the update path now also downcasts Utf8View/BinaryView columns to their stored offset form, which previously would have mismatched the physical schema. Extend the JSON extension update test with a Utf8View column to cover this.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Contributor
Author
|
cc @wjones127 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
JsonConvertingReaderin the merge/update path withSchemaAdapter::to_physical_reader, so the synchronous reader path shares the same logical-to-physical conversion as the write stream path. This resolves the TODO left in fix: convert Arrow JSON when updating columns via merge/update path #7472.to_physical_readerfor syncRecordBatchReader,to_physical_streamfor asyncSendableRecordBatchStream) now share a singlephysical_schema()helper and the sameconvert_json_columns+downcast_view_columnslogic.Utf8View/BinaryViewcolumns to their stored offset form (Utf8/Binary). Previously only Arrow JSON was converted, so a view-typed update column would have mismatched the physical schema.Test plan
test_update_columns_with_json_extension_typewith aUtf8Viewcolumn (desc) on both the dataset and the update stream, exercising the new view downcasting alongside the existing Arrow JSON conversion.