alberttwong opened a new pull request, #1600: URL: https://github.com/apache/arrow-go/pull/1600
### Rationale for this change Exporting a sliced STRUCT preserves the parent's offset but exports `Field(i)`, which has already applied that offset. Consumers apply it again, shifting/truncating values. The original two-row reproduction expects `[202, 303]` and gets `[303]`. ### What changes are included in this PR? Export arrays built from the original child data, releasing the temporary Go array after the C export retains it. This preserves each child's own offset and lets the consumer apply the parent offset once. Adds 12 round-trip cases covering primitive/nested STRUCT children, child offsets, parent slices (including empty slices), parent/child NULLs, structural validation and checked allocator balance. ### Are these changes tested? The new regression fails against upstream main before the fix. After the fix, both full C Data package runs pass on macOS arm64 with Go 1.27.3: - `go test -count=1 -p 1 -race -gcflags=all=-d=checkptr=2 -tags assert,test ./arrow/cdata` - `go test -count=1 -p 1 -tags assert,test,noasm ./arrow/cdata` These are C Data package checks, not a claim of a complete repository or cross-language/sanitizer matrix. ### Are there any user-facing changes? C Data export/import preserves sliced STRUCT values and child lengths. No public API change. Closes #1598. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
