import { type PathBuilderLike } from "path-ts"; import type { DuckDBLimits } from "#parquet/duckdb"; import type { CanonicalRow } from "#types"; import type { SplitRetention } from "#utils/retention"; import { type CountryHoldout, type SplitName } from "#utils/split"; import { type EvaluationGroupPolicy } from "#utils/validation-groups"; /** * The fields {@linkcode holdoutComponents} reads, with the span triple optional * so the absent-triple refusal is reachable from a test rather than only from a corrupt file. */ export interface SpannedRow { raw: string; source_id: string; span_starts?: readonly number[]; span_ends?: readonly number[]; span_tags?: readonly string[]; } /** * Read the components a holdout decision needs back out of one labeled row. * * Raises on an absent or non-parallel span triple, because treating an unreadable row * as one with no held-out component would put it in the train split. */ export declare function holdoutComponents(row: SpannedRow, index: number, input: string): CanonicalRow["components"]; export interface SplitSliceOptions { /** * The parquet to route. * Its rows are read once, and the file is left unchanged. */ input: PathBuilderLike; /** * Where the attribute file is written. */ outputDir: PathBuilderLike; /** * @defaultValue `defaultHoldouts()`, which is the policy the base build applies. */ holdouts?: Record; /** * The retention table applied to every row, when one was registered (HOLDOUT_AND_EVALUATION section 5.1). * Covered by the policy hash. */ retention?: SplitRetention; /** * The frozen and validation group lists. * * A caller that passes them selects the evaluation-group policy * (HOLDOUT_AND_EVALUATION section 4.6): the frozen groups' rows go to test, * the validation groups' rows go to val, and every other row trains. * Both lists' identities and the quota join the policy hash. */ evaluationGroups?: EvaluationGroupPolicy; /** * The DuckDB instance's threads and memory, for a caller that splits several files at once. * @defaultValue the shares `openDuckDB` gives an instance whose caller names none. */ limits?: DuckDBLimits; } export interface SplitSliceResult { input: string; rows: number; counts: Record; /** * The attribute file written, `.split..json`. */ attribute: string; policyHash: string; } /** * Decide the split of every row of one overlay parquet by the policy the base build applies, * and write the decision as an attribute file keyed by the policy's hash. * * @throws When one `source_id` appears on two rows that the policy sends to different splits, * since an attribute keyed by `source_id` could state only one of them. */ export declare function splitOverlaySlice(options: SplitSliceOptions): Promise; //# sourceMappingURL=overlay.d.ts.map