segmentio / parquet-go

Go library to read/write Parquet files
https://pkg.go.dev/github.com/segmentio/parquet-go
Apache License 2.0
341 stars 102 forks source link

Fix issue #493 - generic Read index out of range across page boundaries #494

Closed bartleyg closed 1 year ago

bartleyg commented 1 year ago

PR #489 didn't handle the case where a ReadRows happened at the end of the page, but didn't fill up the given slice. The following ReadRows call would read from the beginning of a new page up to the original given slice size, which would overflow the remaining space available in the slice.

This fixes #493. I added test coverage around these various conditions.

Also fix the unhappy path when errors can occur to correctly report the number of rows read.