[lake/lance] Add NestedRow type support for Lance#2578
Open
XuQianJin-Stars wants to merge 1 commit intoapache:mainfrom
Open
[lake/lance] Add NestedRow type support for Lance#2578XuQianJin-Stars wants to merge 1 commit intoapache:mainfrom
XuQianJin-Stars wants to merge 1 commit intoapache:mainfrom
Conversation
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.
Purpose
Linked issue: close #2404
This PR adds NestedRow (Struct) type support for Lance lake storage, extending the existing Array type support implementation.
Brief change log
LanceArrowUtils.java:
toArrowField()to handleRowTypeby recursively creating child fields for nested struct typestoArrowType()to map FlussRowTypeto ArrowStruct.INSTANCEArrowDataConverter.java:
copyStructVectorData()method to recursively copy data from shadedStructVectorto non-shadedStructVectorcopyVectorData()to detect and delegate to struct-specific copy logicShadedArrowBatchWriter.java:
initFieldVector()to properly allocate and initializeStructVectorand its child vectorsFlinkLanceTieringTestBase.java:
createLogTableWithNestedRowType()helper method for creating tables with nested Row columnscreateLogTableWithArrayOfRowType()helper method for creating tables with Array columnsTests
Unit Tests (LanceArrowUtilsTest.java):
testToArrowSchemaWithNestedRowType: Verifies simple nested Row type conversion to Arrow StructtestToArrowSchemaWithDeeplyNestedRowType: Verifies deeply nested Row type conversiontestToArrowSchemaWithArrayOfRowType: Verifies Array type conversiontestToArrowSchemaWithRowContainingArray: Verifies Row containing Array fieldUnit Tests (LanceTieringTest.java):
testTieringWriteTableWithNestedRowType: Verifies writing and reading tables with nested Row typeIntegration Tests (LanceTieringITCase.java):
testTieringWithNestedRowType: End-to-end test for tiering with nested Row typetestTieringWithArrayOfRowType: End-to-end test for tiering with Array typeAPI and Format
No API changes. This change extends the internal Lance lake storage format to support Struct types, which is backward compatible.
Documentation
No documentation changes needed. This is an internal enhancement to support additional data types in Lance lake storage.