import { ParquetQueryFilter } from "../node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/types/index.mjs"; import "../node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/types/node.mjs"; import { CodecCtx, DataSource, ParquetCodec, Row, TableName } from "../storage.mjs"; import { ColumnDef } from "../schema.mjs"; declare function encodeRowsToParquet(table: TableName, rows: readonly Row[]): Uint8Array; interface EncodeFlexOptions { /** Columns defining the output schema + order. */ columns: readonly ColumnDef[]; /** Sort key columns (subset of `columns` by name). Empty = preserve input order. */ sortKey?: readonly string[]; /** Row-group size; smaller groups = more prunable DuckDB stats. Default 25000. */ rowGroupSize?: number; } /** * Schema-free encoder for rollups + auxiliary tables whose column set isn't * in `SCHEMAS`. Caller supplies column definitions; types must be one of * `VARCHAR | DATE | BIGINT | INTEGER | DOUBLE` — same physical mappings as * the canonical encoder so DuckDB `read_parquet(union_by_name = true)` * merges cleanly with fact-table reads. */ declare function encodeRowsToParquetFlex(rows: readonly Row[], opts: EncodeFlexOptions): Uint8Array; interface DecodeParquetOptions { /** First physical row to decode, inclusive. */ rowStart?: number; /** Last physical row to decode, exclusive. */ rowEnd?: number; /** * Row filter pushed down into the parquet reader. hyparquet evaluates this * per row group — pruning groups whose column statistics can't match and * materialising only matching rows — so a filtered decode of a large file * holds at most one row group plus the matches in memory, never the whole * file. Use when a caller needs a sub-slice of a big parquet keyed on a * clustered column (a row group's min/max stats only prune if the predicate * column is the physical sort key — see `sortKey`/`clusterKey`). */ filter?: ParquetQueryFilter; /** * Project a subset of columns. hyparquet only fetches + decodes the named * column chunks, so a read that needs 2 of 14 columns skips the other 12's * pages entirely. Omit to read every column. Names not present in the file * are ignored by the reader. */ columns?: readonly string[]; } declare function decodeParquetToRows(bytes: Uint8Array, opts?: DecodeParquetOptions): Promise; interface HyparquetCodecOptions { /** * Override `readRows`. Useful when reads should be delegated to a faster * engine (e.g. DuckDB-WASM via httpfs) while writes + compaction stay on * hyparquet to avoid WASM linear-memory growth. Defaults to hyparquet. */ readRows?: (ctx: CodecCtx, key: string, dataSource: DataSource) => Promise; /** * Maximum input-file reads held in flight during compaction. Defaults to 8; * lower it for unusually large files to trade latency for peak JS memory. */ compactionReadConcurrency?: number; } declare function createHyparquetCodec(options?: HyparquetCodecOptions): ParquetCodec; export { DecodeParquetOptions, EncodeFlexOptions, HyparquetCodecOptions, createHyparquetCodec, decodeParquetToRows, encodeRowsToParquet, encodeRowsToParquetFlex };