hyparquet-writer
Version:
Parquet file writer for JavaScript
36 lines • 1.59 kB
TypeScript
/**
* Encode an array of arbitrary JS values into variant binary format.
* Each row becomes { metadata, value } (or null for missing values).
* When shredding is provided, produces { metadata, value, typed_value } per row.
*
* @import {BasicType, ShredType} from '../src/types.js'
* @param {any[]} values
* @param {ShredType | undefined} shredding
* @param {{ name: string, required: boolean }} [column]
* @returns {Array<Record<string, any> | null>}
*/
export function encodeVariantColumn(values: any[], shredding: ShredType | undefined, column?: {
name: string;
required: boolean;
}): Array<Record<string, any> | null>;
/**
* Auto-detect a shredding config by recursively analyzing values for consistent
* structure. Detects scalar fields, nested objects, and arrays. Only structured
* top-level values (objects/arrays) are shredded; a column of bare scalars is
* left unshredded. Descent is bounded (see MAX_SHRED_DEPTH/MAX_SHRED_LEAVES) to
* avoid exploding deeply nested variants into a column per leaf.
*
* @param {any[]} values
* @returns {ShredType | undefined}
*/
export function autoDetectShredding(values: any[]): ShredType | undefined;
/**
* Recursively strip field names reserved by the shredded variant wrapper layout
* (`value`, `typed_value`). Returns undefined when an object level empties out.
*
* @param {ShredType} shredding
* @returns {ShredType | undefined}
*/
export function normalizeShreddingConfig(shredding: ShredType): ShredType | undefined;
import type { ShredType } from '../src/types.js';
//# sourceMappingURL=variant.d.ts.map