From 6e7d041fccfef7e845f899fc5a6f740163443b4b Mon Sep 17 00:00:00 2001 From: Matthew Nibecker Date: Wed, 11 Dec 2024 11:01:55 -0800 Subject: [PATCH] parquet: Fix issue with incorrect null length (#5525) Closes #5515 --- zio/parquetio/vectorreader.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/zio/parquetio/vectorreader.go b/zio/parquetio/vectorreader.go index 848705e99f..c64438ef67 100644 --- a/zio/parquetio/vectorreader.go +++ b/zio/parquetio/vectorreader.go @@ -319,14 +319,15 @@ func makeNulls(a arrow.Array) *vector.Bool { if len(bytes) == 0 { return nil } - bits := make([]uint64, (len(bytes)+7)/8) + n := a.Len() + bits := make([]uint64, (n+63)/64) bitsAsBytes := reinterpretSlice[byte](bits) copy(bitsAsBytes, bytes) for i := range bits { // Flip bits bits[i] ^= ^uint64(0) } - return vector.NewBool(bits, uint32(a.Len()), nil) + return vector.NewBool(bits, uint32(n), nil) } func convertSlice[Out, In uint8 | uint16 | uint32 | uint64 | int8 | int16 | int32 | int64 | float32 | float64](in []In) []Out {