UNPKG

hyparquet-writer

Version:

Parquet file writer for JavaScript

40 lines 1.48 kB
/** * @import {DecodedArray, Encoding, ParquetType} from 'hyparquet' * @import {ColumnEncoder, Writer} from './types.js' */ /** * Estimate the byte size of a value for page size calculation. * * @param {any} value * @param {ParquetType} type * @param {number} [type_length] * @returns {number} */ export function estimateValueSize(value: any, type: ParquetType, type_length?: number): number; /** * Decide whether to dictionary-encode a column, and if so build the dictionary * and per-row indexes. Returns {} to fall back to plain encoding. * * @param {DecodedArray} values * @param {ParquetType} type * @param {number | undefined} type_length * @param {Encoding | undefined} encoding * @param {number} pageSize * @returns {{ dictionary?: any[], indexes?: number[] }} */ export function useDictionary(values: DecodedArray, type: ParquetType, type_length: number | undefined, encoding: Encoding | undefined, pageSize: number): { dictionary?: any[]; indexes?: number[]; }; /** * @param {Writer} writer * @param {ColumnEncoder} column * @param {DecodedArray} dictionary */ export function writeDictionaryPage(writer: Writer, column: ColumnEncoder, dictionary: DecodedArray): void; import type { ParquetType } from 'hyparquet'; import type { DecodedArray } from 'hyparquet'; import type { Encoding } from 'hyparquet'; import type { Writer } from './types.js'; import type { ColumnEncoder } from './types.js'; //# sourceMappingURL=dictionary.d.ts.map