zeroshade commented on code in PR #1385:
URL: https://github.com/apache/arrow-go/pull/1385#discussion_r4327922219


##########
arrow/array/union.go:
##########
@@ -185,7 +185,7 @@ func (a *union) ValidateFull() error {
                }
        }
 
-       if a.unionType.Mode() == arrow.DenseMode {
+       if a.unionType.Mode() == arrow.DenseMode && a.data.length > 0 {

Review Comment:
   This is right: with no rows the offset loop never runs, and an empty dense 
union read back from IPC has no offsets buffer, so `buffers[2].Bytes()` was a 
nil dereference. Could you add a direct test for it in `union_test.go` next to 
the other `ValidateFull` cases (empty `DenseUnion`, nil offsets buffer, 
`ValidateFull()` returns nil)?



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