/** * Column statistics — the min, the max and the NULL count of a column chunk. * * This is what lets a reader SKIP a whole row group: asked for `price > 500`, * it consults the chunk's max and moves on without decoding a byte. Cheap for * us (we already hold every value) and a large win for whoever queries the * file. * * The danger is the reverse of most features: WRONG statistics are worse than * none at all. A max that is too low makes a reader skip a group that really * did contain matching rows, and the query silently returns fewer results — no * error, no warning. So the comparisons here follow Parquet's declared sort * orders exactly rather than JavaScript's defaults: * * - BYTE_ARRAY (strings) compare as UNSIGNED BYTES of their UTF-8 encoding. * JavaScript's `<` compares UTF-16 code units, which agrees only for * ASCII — "я" vs "ё" would come out wrong, and this project generates * Russian data. * - DOUBLE skips NaN entirely: NaN compares false against everything, so * letting one in would poison the bound. * - Everything else is numeric on its stored representation, which for * DECIMAL means the unscaled integer and for DATE the day number. * * We write `min_value`/`max_value` (fields 5/6) and not the deprecated * `min`/`max` (1/2): the old pair had ambiguous signedness that readers * disagreed about, and writing a field readers may misread is the same trap as * writing a wrong bound. * Spec: docs/specs/2026-07-19-parquet-statistics-and-encodings.md */ import type { ColumnType } from '../column-type.js'; import type { TypedValue } from './convert.js'; export interface ColumnStatistics { /** PLAIN-encoded single value; absent when the chunk has no non-NULL value. */ readonly minValue?: Uint8Array; readonly maxValue?: Uint8Array; readonly nullCount: number; } /** Unsigned byte-wise comparison — Parquet's sort order for BYTE_ARRAY. */ export declare function compareBytes(a: Uint8Array, b: Uint8Array): number; /** * Min, max and NULL count for one column chunk. * * `present` holds the non-NULL values in row order; `nullCount` is supplied by * the caller because for a list column the NULLs live in the definition levels * rather than in the value array. */ export declare function computeStatistics(type: ColumnType, present: readonly TypedValue[], nullCount: number): ColumnStatistics; //# sourceMappingURL=statistics.d.ts.map