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

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   `Struct.String` panics when the struct has a run-end encoded child and the 
struct's validity bitmap differs from the child's, for example after appending 
a null struct:
   
   ```go
   reeT := arrow.RunEndEncodedOf(arrow.PrimitiveTypes.Int32, 
arrow.BinaryTypes.String)
   b := array.NewStructBuilder(memory.DefaultAllocator, 
arrow.StructOf(arrow.Field{Name: "r", Type: reeT, Nullable: true}))
   b.AppendNull()
   arr := b.NewArray()
   fmt.Println(arr) // panic: runtime error: index out of range [0] with length 0
   ```
   
   The array passes `array.ValidateFull`, so only printing fails.
   
   `String` combines each child's validity bitmap with the parent's in 
`newStructFieldWithParentValidityMask`, which replaces buffer 0 of the child's 
data. Run-end encoded arrays have no buffers at all, so indexing buffer 0 
panics. Union children have no validity bitmap either and are already printed 
as they are; run-end encoded children (including extension types over run-end 
encoded storage) need the same treatment.
   
   Reproduced on main (`34e0018f`), macOS arm64.
   
   ### 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