hcrosse opened a new pull request, #1737: URL: https://github.com/apache/arrow-go/pull/1737
### Rationale for this change In `parquet/metadata`, `UpdateFromArrow` on numeric and fixed-length byte-array statistics does not skip null slots, reads past the end of sliced numeric arrays, and mutates counts before validating inputs. Numeric statistics also accept mismatched fixed-width or dictionary types and panic on non-fixed-width arrays, while fixed-length byte-array statistics compare raw little-endian Arrow decimal bytes directly instead of big-endian Parquet bytes. These defects can produce wrong min/max bounds and make statistics-based pruning unsafe. ### What changes are included in this PR? - Validate the Arrow array type, byte width, and buffer bounds before updating counts or extrema, and restrict numeric statistics to matching physical Arrow types. - Bound sliced numeric and fixed-length byte-array buffers by array length and skip null slots using the validity bitmap. - Convert Arrow `Decimal128` and `Decimal256` values to big-endian two's-complement bytes in `FixedLenByteArrayStatistics.UpdateFromArrow`, rejecting non-null values that overflow the column byte length before mutating statistics. - Remove the unused package-level `coalesce` helper and regenerate `statistics_types.gen.go`. ### Are these changes tested? Yes. I added unit tests for null skipping, sliced arrays, byte-crossing bitmap offsets, signed and unsigned ordering, float NaN and signed-zero handling, decimal endianness and overflow checks, invalid type errors, and end-to-end sliced dictionary Parquet writes. ### Are there any user-facing changes? `UpdateFromArrow` now returns `arrow.ErrInvalid` without mutating counts for mismatched types, invalid widths, or overflowing decimals, and produces accurate min/max statistics for nullable, sliced, and decimal Arrow arrays. -- 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]
