feat: implement complete Milvus data type support#60
Open
shaoting-huang wants to merge 3 commits intozilliztech:mainfrom
Open
feat: implement complete Milvus data type support#60shaoting-huang wants to merge 3 commits intozilliztech:mainfrom
shaoting-huang wants to merge 3 commits intozilliztech:mainfrom
Conversation
Add comprehensive support for all Milvus data types with full Arrow conversion: Scalar Types: - Add Int8/ByteType support with TinyIntVector handler - Add Timestamptz mapping to LongType - Add Text type mapping to StringType Vector Types: - Implement IEEE 754 Float16/BFloat16 to Float32 conversion - Add Int8Vector byte[] to short[] conversion - Fix BinaryVector type mismatch (ArrayType → BinaryType) Complex Types: - Add JSON Binary to String conversion support - Fix Geometry type mapping to BinaryType - Implement ArrayOfVector schema mapping and conversion Testing: - Add ArrowConverterTest with 15 comprehensive test cases - All scalar, vector, and complex type conversions tested - Tests verify null handling and edge cases Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
Collaborator
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: shaoting-huang The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
## Changes ### 1. Schema-based Type Detection (ArrowConverter.scala) - Add createFieldTypeMap() to build field name → Milvus DataType lookup - Update arrowToInternalRow() to accept Optional[CollectionSchema] - Update arrowValueToSparkValue() and sparkValueToArrowValue() to use schema lookup - Replace heuristic Float16/BFloat16/FloatVector detection with schema-based logic - Maintain backward compatibility with Optional parameter and fallback logic ### 2. Fixed Broken Types - Int8/ByteType: Add TinyIntVector read/write support in ArrowConverter - BinaryVector: Fix mapping from ArrayType(BinaryType) to ArrayType(ByteType) - Add FixedSizeBinary special handling for BinaryVector in ArrowConverter ### 3. Added Missing Type Mappings (DataTypeUtil.scala) - Timestamptz → LongType - Text → StringType ### 4. Updated Call Sites (MilvusLoonPartitionReader.scala) - Pass Some(milvusSchema) to all ArrowConverter calls (3 locations) ## Type Coverage - Complete: 16/18 user-facing types - Fixed critical bugs: Int8, BinaryVector - Accurate Float16/BFloat16/FloatVector detection via schema 🤖 Generated with Claude Code
Signed-off-by: shaoting-huang <shaoting.huang@zilliz.com>
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.
Add comprehensive support for all Milvus data types with full Arrow conversion:
Scalar Types:
Vector Types:
Complex Types:
Testing: