hcrosse opened a new issue, #1610:
URL: https://github.com/apache/arrow-go/issues/1610

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   `MakeArrayFromScalar` returns `array from scalar not yet implemented` for 
valid `large_list`, sparse union, dense union and extension scalars at lengths 
above 0. A null union scalar loses its type code, using the union's first code 
instead.
   
   I reproduced this on v18.8.0 and main, with Go 1.26.10 on macOS arm64.
   
   With an `int32` values array `[1, 2]`:
   
   ```go
   sc := scalar.NewLargeListScalar(vals)
   out, err := scalar.MakeArrayFromScalar(sc, 3, memory.DefaultAllocator)
   ```
   
   ```text
   array from scalar not yet implemented for type large_list<item: int32, 
nullable>
   ```
   
   It should return `[[1 2] [1 2] [1 2]]`.
   
   For a union with type codes 5 and 7, a null scalar with code 7 produces type 
codes `[5 5 5]` at length 3, rather than `[7 7 7]`.
   
   `compute.SerializeExpr` returns the same error for `compute.NewLiteral` 
expressions holding `large_list` or `uuid` scalars. iceberg-go works around the 
UUID case by building UUID write defaults as `fixed_size_binary[16]` and 
rewrapping the resulting array as UUID:
   
   
https://github.com/apache/iceberg-go/blob/8d13e317c79f36f38f52a16b2f81f1d966f1fc27/table/arrow_utils.go#L949-L968
   
   
https://github.com/apache/iceberg-go/blob/8d13e317c79f36f38f52a16b2f81f1d966f1fc27/table/arrow_utils.go#L1023-L1035
   
   Arrow C++ supports these scalar types and preserves the union type code:
   
   
https://github.com/apache/arrow/blob/976779b2aac587f51b87c3bd2e6ae4c36f75ab6c/cpp/src/arrow/array/util.cc#L672-L684
   
   
https://github.com/apache/arrow/blob/976779b2aac587f51b87c3bd2e6ae4c36f75ab6c/cpp/src/arrow/array/util.cc#L751-L815
   
   
https://github.com/apache/arrow/blob/976779b2aac587f51b87c3bd2e6ae4c36f75ab6c/cpp/src/arrow/array/util.cc#L830-L844
   
   
https://github.com/apache/arrow/blob/976779b2aac587f51b87c3bd2e6ae4c36f75ab6c/cpp/src/arrow/array/util.cc#L905-L912
   
   
   ### Component(s)
   
   Other
   


-- 
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]

Reply via email to