feat: Support int32 to uint64 in reverseTransformArray#728
feat: Support int32 to uint64 in reverseTransformArray#728kodiakhq[bot] merged 2 commits intomainfrom
Conversation
Add reverseTransformFromInt32 to handle int32 to uint64 widening, mirroring the existing uint32 to uint64 support.
There was a problem hiding this comment.
Pull request overview
Adds support for widening int32 arrays to uint64 during Parquet reads, aligning reverse-transformation behavior with existing uint32→uint64 handling in the Arrow conversion layer.
Changes:
- Add
reverseTransformFromInt32to convert*array.Int32touint64arrays. - Add
*array.Int32handling inreverseTransformArraydispatch. - Add unit tests covering scalar, empty, and list-of conversions for
int32→uint64.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
parquet/read.go |
Adds a new reverse-transform path for *array.Int32 to support uint64 schema expectations. |
parquet/read_test.go |
Adds test coverage for int32→uint64 conversions including list arrays. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| builder := array.NewUint64Builder(memory.DefaultAllocator) | ||
| for i := 0; i < arr.Len(); i++ { | ||
| if arr.IsNull(i) { | ||
| builder.AppendNull() | ||
| continue | ||
| } | ||
| v := arr.Value(i) | ||
| if v < 0 { | ||
| panic(fmt.Errorf("negative int32 value %d at index %d cannot be converted to uint64", v, i)) |
There was a problem hiding this comment.
reverseTransformFromInt32 allocates a Uint64Builder but never releases it. In Arrow Go, builders are reference-counted and should be Release()d to avoid leaking allocator-backed memory; you can defer builder.Release() (safe because builder.NewArray() returns a separate array) or release after creating the array.
🤖 I have created a release *beep* *boop* --- ## [4.7.0](v4.6.16...v4.7.0) (2026-03-23) ### Features * Support int32 to uint64 in reverseTransformArray ([#728](#728)) ([5ed6ca8](5ed6ca8)) ### Bug Fixes * **deps:** Update module github.com/cloudquery/plugin-sdk/v4 to v4.94.7 ([#726](#726)) ([ccf6a31](ccf6a31)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Summary
reverseTransformFromInt32to handle int32 to uint64 array widening in parquet readsreverseTransformArrayswitch for*array.Int32reverseTransformFromUint32implementationTest plan
TestReverseTransformArray_Int32ToUint64— basic values (0, 42, null, max int32)TestReverseTransformArray_Int32ToUint64_Empty— empty arrayTestReverseTransformArray_Int32ToUint64_ListOf— list of int32 → list of uint64