zeroshade commented on code in PR #43616:
URL: https://github.com/apache/arrow/pull/43616#discussion_r1711566655
##########
go/parquet/internal/utils/bit_packing_avx2_amd64.go:
##########
@@ -45,6 +45,10 @@ func unpack32Avx2(in io.Reader, out []uint32, nbits int) int
{
buffer.Grow(n)
io.CopyN(buffer, in, int64(n))
+ if buffer.Len() == 0 {
+ return 0
+ }
Review Comment:
Because we're dealing with integer division, that doesn't cover all cases.
To cover all cases you'd need something like `if batch * nbits < 8` since
integer division would result in `n == 0` for any scenario where `batch *
nbits` is less than 8 (since that would result in 0 when we divide by 8). So it
might just be better to just check if `n == 0` rather than try to find all the
cases
--
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]