feat(go): support [N]uint types array serializers#3201
Merged
chaokunyang merged 12 commits intoapache:mainfrom Jan 27, 2026
Merged
feat(go): support [N]uint types array serializers#3201chaokunyang merged 12 commits intoapache:mainfrom
chaokunyang merged 12 commits intoapache:mainfrom
Conversation
Contributor
Author
|
Hey @chaokunyang
|
Collaborator
|
Hi @ayush00git , here is some of my comments:
|
Contributor
Author
Okk, i'll remove the |
Contributor
Author
|
Hey @chaokunyang |
Closed
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.
Referenced issue - #3015
Go Array Serialization Support
I have implemented optimized array serialization for
uint16,uint32, anduint64types in Go. These types now map to standard Fory type IDs (UINT16_ARRAY, UINT32_ARRAY, UINT64_ARRAY) instead of falling back to generic list serialization, ensuring better performance and cross-language compatibility.Changes
Serialization Logic -
I updated
array_primitive.goto include dedicated serializers:These serializers support both fast-path (direct memory copy on little-endian systems) and standard path serialization.
Registered the typeIds and serializers to the
type_resolver.goUpdated
slice.go-readSliceRefAndTypeto return the Type ID (uint32) it reads from the buffer. Previously, it only returned a boolean flag.Before
After
Updated
slice_primitive.go- all primitive slice serializers (likeint64SliceSerializer,float32SliceSerializer, etc.).Added a validation check: verifying that the returned typeId matches the expected wire type for that slice (e.g., []int64 now explicitly checks for INT64_ARRAY).
If the ID doesn't match, it now returns a "slice type mismatch" error instead of silently proceeding with potentially corrupt data.
Updated
slice_dyn.go- Updated the genericsliceDynSerializerto validate that the incoming wire type is LIST (since dynamic slices always use the LIST protocol).Related issues
Closes #3015
Does this PR introduce any user-facing change?
Benchmark
N/A