import type { StreamIO } from '../data'; import type { Aggregation, PrimitiveType } from '../east'; import type { EastFunction } from '../east/functions'; import type { ArrayType, BlobType, BooleanType, DictType, EastType, FloatType, SetType, StringType, StructType } from '../east/types'; import { Geo } from '../layout/Geo'; import type { Assertion } from '../task'; import type { ModulePath } from '../template'; /** @internal */ export type JoinType = "Inner" | "Left" | "Right" | "Full"; /** @internal */ export type InputOp = { operation_type: "input"; name: string; }; /** @internal */ export type AssertOp = { operation_type: "assert"; assertion: Assertion; }; /** @internal */ export type LetOp = { operation_type: "let"; name: string; }; /** @internal */ export type TransformOp = { operation_type: "transform"; output_type: EastType; expression: EastFunction; }; /** @internal */ export type FilterOp = { operation_type: "filter"; output_type: DictType; predicate: EastFunction; }; /** @internal */ export interface SelectOp { operation_type: "select"; output_type: DictType; selections: Record; output_key: EastFunction; } /** @internal */ export interface AggregateOp { operation_type: "aggregate"; output_type: DictType | StructType; group_name?: string | undefined; group_value?: EastFunction | undefined; aggregations: Record; } /** @internal */ export interface ConcatenateOp { operation_type: "concatenate"; output_type: DictType; discriminator_name?: string | undefined; discriminator?: string | undefined; inputs: { input: string; discriminator?: string | undefined; }[]; } /** @internal */ export interface DisaggregateOp { operation_type: "disaggregate"; output_type: DictType; collection: EastFunction; selections: Record; output_key: EastFunction; } /** @internal */ export interface OffsetOp { operation_type: "offset"; output_type: DictType; group_key: EastFunction; sort_key: EastFunction; offset: number; offset_selections: Record; } /** @internal */ export interface HistogramOp { operation_type: "histogram"; output_type: DictType; group?: EastFunction | undefined; cumulative: boolean; density: boolean; normalization: 'count' | 'percentage' | 'probability'; samples: EastFunction; minimum?: number | undefined; n_bins?: number | undefined; step?: number | undefined; } /** @internal */ export interface JoinOp { operation_type: "join"; output_type: DictType; source_table: string; source_key: EastFunction; target_key: EastFunction; source_selections: Record; target_selections: Record; output_key: EastFunction; join_type: JoinType; } export interface FromCsvOp { operation_type: "fromCsv"; output_type: DictType; skip_n?: bigint | undefined; delimiter?: string | undefined; newline?: string | undefined; null_str?: string | undefined; output_key: EastFunction; } /** @internal */ export interface FromJsonLinesOp { operation_type: "fromJsonLines"; output_type: DictType; output_key: EastFunction; } /** @internal */ export interface FromXlsxOp { operation_type: "fromXlsx"; output_type: DictType; sheet: string; null_str?: string | undefined; output_key: EastFunction; } /** @internal */ export interface FromJsonOp { operation_type: "fromJson"; output_type: EastType; } /** @internal */ export interface FromGeoJsonOp { operation_type: "fromGeoJson"; output_type: typeof Geo; } export interface ToCsvOp { operation_type: "toCsv"; output_type: BlobType; skip_n?: bigint | undefined; delimiter?: string | undefined; newline?: string | undefined; null_str?: string | undefined; selections: Record>; } /** @internal */ export interface ToJsonLinesOp { operation_type: "toJsonLines"; output_type: BlobType; selections: Record>; } /** @internal */ export interface ToXlsxOp { operation_type: "toXlsx"; output_type: BlobType; sheet: string; null_str?: string | undefined; selections: Record>; } /** @internal */ export interface ToJsonOp { operation_type: "toJson"; output_type: BlobType; value: EastFunction; } /** @internal */ export type Op = FromGeoJsonOp | InputOp | AssertOp | LetOp | TransformOp | FilterOp | SelectOp | ConcatenateOp | AggregateOp | DisaggregateOp | OffsetOp | HistogramOp | JoinOp | FromCsvOp | FromJsonLinesOp | FromXlsxOp | FromJsonOp | ToCsvOp | ToJsonLinesOp | ToXlsxOp | ToJsonOp; /** @internal */ export type PipelineTaskDescription = { task_type: 'pipeline'; module: ModulePath; name: string; inputs: Record; outputs: { output: StreamIO; }; operations: Op[]; random_seed: string; };