lakeql 0.1.2 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,18 +1,23 @@
1
- import * as hyparquet_src_types_js from 'hyparquet/src/types.js';
2
- import { parquetMetadataAsync, RowGroup } from 'hyparquet';
3
1
  import { ParquetWriteOptions, ColumnSource, BasicType } from 'hyparquet-writer';
2
+ import { parquetMetadataAsync, RowGroup } from 'hyparquet';
4
3
 
5
- declare const ERROR_CODES: readonly ["LAQL_PARSE_ERROR", "LAQL_SQL_UNSUPPORTED", "LAQL_TYPE_ERROR", "LAQL_UNKNOWN_TABLE", "LAQL_UNKNOWN_COLUMN", "LAQL_UNSUPPORTED_PUSHDOWN", "LAQL_BUDGET_EXCEEDED", "LAQL_GROUP_LIMIT_EXCEEDED", "LAQL_OBJECT_NOT_FOUND", "LAQL_CATALOG_ERROR", "LAQL_UNSUPPORTED_ICEBERG_FEATURE", "LAQL_UNSUPPORTED_PARQUET_FEATURE", "LAQL_ICEBERG_COMMIT_CONFLICT", "LAQL_UNSUPPORTED_DELETE_FILES", "LAQL_PARQUET_READ_ERROR", "LAQL_PARQUET_WRITE_ERROR", "LAQL_VALIDATION_ERROR", "LAQL_BOOKMARK_STALE", "LAQL_BOOKMARK_INVALID", "LAQL_ABORTED"];
6
- type LaQLErrorCode = (typeof ERROR_CODES)[number];
7
- type ErrorDetails = Record<string, unknown>;
8
- declare class LaQLError extends Error {
9
- readonly code: LaQLErrorCode;
10
- readonly details: ErrorDetails;
11
- constructor(code: LaQLErrorCode, message: string, details?: ErrorDetails);
12
- }
13
- declare function isLaQLError(value: unknown): value is LaQLError;
4
+ type TimestampUnit = "millis" | "micros" | "nanos";
5
+ declare class TimestampValue {
6
+ readonly epochNanoseconds: bigint;
7
+ readonly unit: TimestampUnit;
8
+ readonly isAdjustedToUTC: boolean;
9
+ constructor(epochNanoseconds: bigint, unit: TimestampUnit, isAdjustedToUTC?: boolean);
10
+ toJSON(): string;
11
+ toString(): string;
12
+ }
13
+ declare function timestampFromEpoch(value: bigint, unit: TimestampUnit, isAdjustedToUTC?: boolean): TimestampValue;
14
+ declare function timestampValueFromIso(value: string): TimestampValue | undefined;
15
+ declare function isTimestampValue(value: unknown): value is TimestampValue;
16
+ declare function timestampToIsoString(value: TimestampValue): string;
17
+ declare function timestampEpochForUnit(value: TimestampValue, unit: TimestampUnit): bigint;
18
+ declare function compareTimestampValues(left: TimestampValue, right: TimestampValue): number;
14
19
 
15
- type Scalar = string | number | boolean | bigint | null;
20
+ type Scalar = string | number | boolean | bigint | TimestampValue | null;
16
21
  type CompareOp = "eq" | "ne" | "lt" | "lte" | "gt" | "gte";
17
22
  interface LiteralExpr {
18
23
  kind: "literal";
@@ -197,32 +202,302 @@ interface QueryStats {
197
202
  cacheMisses: number;
198
203
  }
199
204
 
205
+ type Vector = {
206
+ type: "null";
207
+ length: number;
208
+ } | {
209
+ type: "f64";
210
+ values: Float64Array;
211
+ valid?: Uint8Array;
212
+ } | {
213
+ type: "i64";
214
+ values: BigInt64Array;
215
+ valid?: Uint8Array;
216
+ } | {
217
+ type: "timestamp";
218
+ values: BigInt64Array;
219
+ unit: TimestampUnit;
220
+ isAdjustedToUTC: boolean;
221
+ valid?: Uint8Array;
222
+ } | {
223
+ type: "bool";
224
+ values: Uint8Array;
225
+ valid?: Uint8Array;
226
+ } | {
227
+ type: "utf8";
228
+ values: string[];
229
+ valid?: Uint8Array;
230
+ } | {
231
+ type: "dict";
232
+ indices: Uint32Array;
233
+ dictionary: Vector;
234
+ valid?: Uint8Array;
235
+ } | {
236
+ type: "list";
237
+ offsets: Int32Array;
238
+ child: Vector;
239
+ valid?: Uint8Array;
240
+ } | {
241
+ type: "struct";
242
+ fields: Record<string, Vector>;
243
+ length: number;
244
+ valid?: Uint8Array;
245
+ } | {
246
+ type: "map";
247
+ offsets: Int32Array;
248
+ keys: Vector;
249
+ values: Vector;
250
+ valid?: Uint8Array;
251
+ };
252
+ interface Batch {
253
+ rowCount: number;
254
+ columns: Record<string, Vector>;
255
+ }
256
+ type Selection = Uint8Array;
257
+ type VectorValue = unknown;
258
+ declare function batchFromColumns(columns: Record<string, ArrayLike<VectorValue>>): Batch;
259
+ declare function batchFromVectors(columns: Record<string, Vector>): Batch;
260
+ declare function vectorFromValues(values: ArrayLike<VectorValue>): Vector;
261
+ declare function materializeBatchRows(batch: Batch): Row[];
262
+ declare function materializeSelectedBatchRows(batch: Batch, selection?: Selection): Row[];
263
+ declare function selectedRowCount(rowCount: number, selection?: Selection): number;
264
+ declare function selectedRowIndices(rowCount: number, selection?: Selection): Iterable<number>;
265
+ declare function predicateSelection(batch: Batch, expr: Expr | undefined): Selection;
266
+ declare function tryPredicateSelection(batch: Batch, expr: Expr | undefined): Selection | undefined;
267
+ declare function vectorValue(vector: Vector, index: number): string | number | bigint | boolean | TimestampValue | unknown[] | Record<string, unknown> | null;
268
+ declare function vectorLength(vector: Vector): number;
269
+ interface BatchExprValues {
270
+ rowCount: number;
271
+ vector?: Vector;
272
+ literal?: Scalar;
273
+ valueAt(index: number): Scalar;
274
+ }
275
+ declare function batchExprValues(batch: Batch, expr: Expr): BatchExprValues;
276
+ declare function scalarVectorValue(vector: Vector, index: number): Scalar;
277
+
278
+ declare const ERROR_CODES: readonly ["LAKEQL_PARSE_ERROR", "LAKEQL_SQL_UNSUPPORTED", "LAKEQL_TYPE_ERROR", "LAKEQL_UNKNOWN_TABLE", "LAKEQL_UNKNOWN_COLUMN", "LAKEQL_UNSUPPORTED_PUSHDOWN", "LAKEQL_BUDGET_EXCEEDED", "LAKEQL_GROUP_LIMIT_EXCEEDED", "LAKEQL_OBJECT_NOT_FOUND", "LAKEQL_CATALOG_ERROR", "LAKEQL_UNSUPPORTED_ICEBERG_FEATURE", "LAKEQL_UNSUPPORTED_PARQUET_FEATURE", "LAKEQL_ICEBERG_COMMIT_CONFLICT", "LAKEQL_UNSUPPORTED_DELETE_FILES", "LAKEQL_PARQUET_READ_ERROR", "LAKEQL_PARQUET_WRITE_ERROR", "LAKEQL_VALIDATION_ERROR", "LAKEQL_BOOKMARK_STALE", "LAKEQL_BOOKMARK_INVALID", "LAKEQL_ABORTED", "LAKEQL_GEO_BACKEND_MISSING"];
279
+ type LakeqlErrorCode = (typeof ERROR_CODES)[number];
280
+ type ErrorDetails = Record<string, unknown>;
281
+ declare class LakeqlError extends Error {
282
+ readonly code: LakeqlErrorCode;
283
+ readonly details: ErrorDetails;
284
+ constructor(code: LakeqlErrorCode, message: string, details?: ErrorDetails);
285
+ }
286
+ declare function isLakeqlError(value: unknown): value is LakeqlError;
287
+
200
288
  type SqlBoolean = boolean | null;
289
+ /** External geometry/H3 primitives the evaluator can't compute from bbox math alone. */
290
+ interface GeoBackend {
291
+ booleanContains(a: GeoJsonGeometry, b: GeoJsonGeometry): boolean;
292
+ booleanIntersects(a: GeoJsonGeometry, b: GeoJsonGeometry): boolean;
293
+ cellToParent(cell: string, res: number): string;
294
+ gridDisk(origin: string, k: number): string[];
295
+ isValidCell(cell: string): boolean;
296
+ latLngToCell(lat: number, lon: number, res: number): string;
297
+ }
298
+ /** Install the backend. Called by `./geo-backend.ts` once its libraries load. */
299
+ declare function setGeoBackend(backend: GeoBackend): void;
300
+ declare function requireGeoBackend(): GeoBackend;
301
+ /** Force-load the geo backend (idempotent). Exposed for direct evaluate() callers. */
302
+ declare function loadGeoBackend(): Promise<void>;
303
+ /**
304
+ * Load the geo backend iff any of `exprs` uses a backend-requiring spatial
305
+ * function. Cheap no-op once the backend is installed or when no geo is present,
306
+ * so query execution can call it unconditionally.
307
+ */
308
+ declare function ensureGeoBackendForExprs(exprs: Iterable<Expr | undefined>): Promise<void>;
201
309
  type EvalValue = Scalar;
310
+ interface BBox {
311
+ minx: number;
312
+ miny: number;
313
+ maxx: number;
314
+ maxy: number;
315
+ }
202
316
  declare function evaluate(expr: Expr, row: Row): EvalValue;
203
317
  declare function matches(expr: Expr | undefined, row: Row): boolean;
204
318
  declare function jsonSafeValue(value: unknown): unknown;
205
319
  declare function encodeJsonLine(row: Row): Uint8Array;
320
+ declare function envelopeOf(geometry: GeoJsonGeometry): BBox;
321
+ type GeoJsonGeometry = {
322
+ type: "Point";
323
+ coordinates: [number, number];
324
+ } | {
325
+ type: "LineString";
326
+ coordinates: [number, number][];
327
+ } | {
328
+ type: "Polygon";
329
+ coordinates: [number, number][][];
330
+ };
331
+ declare function toGeometry(parsed: Record<string, unknown>, name: string): GeoJsonGeometry;
332
+ declare function parseGeometry(value: EvalValue, name: string): Record<string, unknown>;
333
+ declare function envelopeFromGeometry(parsed: Record<string, unknown>, name: string): BBox;
334
+ declare function bboxIntersects(left: BBox, right: BBox): boolean;
206
335
 
207
- type JoinType = "inner" | "left" | "semi" | "anti";
208
- type JoinKey = string | string[];
209
- interface BroadcastJoinOptions {
210
- leftKey: JoinKey;
211
- rightKey: JoinKey;
212
- maxRightRows: number;
213
- type?: JoinType;
214
- rightPrefix?: string;
336
+ interface PutOptions {
337
+ contentType?: string;
338
+ metadata?: Record<string, string>;
215
339
  }
216
- interface LookupJoinOptions {
217
- leftKey: JoinKey;
218
- rightKey: JoinKey;
219
- maxRightRows: number;
220
- type?: JoinType;
221
- rightPrefix?: string;
340
+ interface ConditionalPutOptions extends PutOptions {
341
+ /**
342
+ * ETag that must still identify the existing object. Use null to require
343
+ * the object to be absent.
344
+ */
345
+ expectedEtag: string | null;
222
346
  }
223
- type LookupJoinFunction = (key: string | number | boolean | bigint | null | (string | number | boolean | bigint | null)[], leftRow: Row) => AsyncIterable<Row> | Iterable<Row> | Promise<AsyncIterable<Row> | Iterable<Row>>;
224
- declare function broadcastJoin(left: AsyncIterable<Row> | Iterable<Row>, right: AsyncIterable<Row> | Iterable<Row>, options: BroadcastJoinOptions): Promise<Row[]>;
225
- declare function lookupJoin(left: AsyncIterable<Row> | Iterable<Row>, lookup: LookupJoinFunction, options: LookupJoinOptions): Promise<Row[]>;
347
+ interface ListOptions {
348
+ /** Stop listing after this many objects. */
349
+ limit?: number;
350
+ /** List "directories" by stopping at this delimiter. */
351
+ delimiter?: string;
352
+ }
353
+ interface ObjectInfo {
354
+ path: string;
355
+ size: number;
356
+ etag?: string;
357
+ lastModified?: Date;
358
+ }
359
+ interface ObjectHead {
360
+ size: number;
361
+ etag?: string;
362
+ lastModified?: Date;
363
+ contentType?: string;
364
+ }
365
+ /**
366
+ * The single environmental contract for storage. Every runtime driver
367
+ * (R2, S3, HTTP, filesystem) supplies one of these; core never touches
368
+ * a runtime API directly.
369
+ */
370
+ interface ObjectStore {
371
+ get(path: string): Promise<Uint8Array | null>;
372
+ getRange(path: string, range: {
373
+ offset: number;
374
+ length: number;
375
+ }): Promise<Uint8Array>;
376
+ put(path: string, body: Uint8Array | ReadableStream<Uint8Array>, options?: PutOptions): Promise<void>;
377
+ delete(path: string): Promise<void>;
378
+ list(prefix: string, options?: ListOptions): AsyncIterable<ObjectInfo>;
379
+ head(path: string): Promise<ObjectHead | null>;
380
+ }
381
+ interface ConditionalObjectStore extends ObjectStore {
382
+ conditionalPut(path: string, body: Uint8Array | ReadableStream<Uint8Array>, options: ConditionalPutOptions): Promise<boolean>;
383
+ }
384
+ interface ObjectStoreReadControls {
385
+ maxConcurrentReads?: number;
386
+ signal?: AbortSignal;
387
+ maxElapsedMs?: number;
388
+ }
389
+ declare function withObjectStoreReadControls(store: ObjectStore, controls: ObjectStoreReadControls): ObjectStore;
390
+ declare function readControlSignal(controls: ObjectStoreReadControls): AbortSignal | undefined;
391
+ declare function throwIfAborted(signal: AbortSignal | undefined): void;
392
+
393
+ interface TaskManifestTask {
394
+ id: string;
395
+ input: TaskInput;
396
+ outputRole: "rows" | "data-file" | "manifest";
397
+ }
398
+ interface TaskManifest {
399
+ version: 1;
400
+ jobId: string;
401
+ planFingerprint: string;
402
+ snapshot: string;
403
+ tasks: TaskManifestTask[];
404
+ }
405
+ interface OutputManifestEntry {
406
+ taskId: string;
407
+ outputPath: string;
408
+ partitionValues: Record<string, string>;
409
+ rowCount: number;
410
+ byteSize: number;
411
+ contentHash?: string;
412
+ etag?: string;
413
+ iceberg?: {
414
+ recordCount: number;
415
+ fileSizeInBytes: number;
416
+ partitionValues: Record<string, string>;
417
+ };
418
+ }
419
+ interface OutputManifest {
420
+ version: 1;
421
+ jobId: string;
422
+ planFingerprint: string;
423
+ entries: OutputManifestEntry[];
424
+ }
425
+ type TaskState = "planned" | "running" | "output-written" | "manifest-recorded" | "complete";
426
+ interface TaskCheckpoint {
427
+ taskId: string;
428
+ state: TaskState;
429
+ idempotencyKey: string;
430
+ updatedAtMs: number;
431
+ output?: OutputManifestEntry;
432
+ outputs?: OutputManifestEntry[];
433
+ }
434
+ interface CheckpointAdapter {
435
+ get(taskId: string): Promise<TaskCheckpoint | undefined>;
436
+ put(checkpoint: TaskCheckpoint): Promise<void>;
437
+ list(jobId?: string): AsyncIterable<TaskCheckpoint>;
438
+ }
439
+ interface TaskTransitionInput {
440
+ taskId: string;
441
+ nextState: TaskState;
442
+ idempotencyKey: string;
443
+ nowMs: number;
444
+ staleTimeoutMs?: number;
445
+ output?: OutputManifestEntry;
446
+ outputs?: OutputManifestEntry[];
447
+ }
448
+ interface BookmarkPosition {
449
+ fileIndex: number;
450
+ rowGroup: number;
451
+ rowOffset: number;
452
+ taskId?: string;
453
+ outputManifestCursor?: number;
454
+ }
455
+ interface BookmarkInit {
456
+ planFingerprint: string;
457
+ snapshot: string;
458
+ query?: BookmarkQuery;
459
+ position: BookmarkPosition;
460
+ writeState?: Bookmark["writeState"];
461
+ operatorState?: Bookmark["operatorState"];
462
+ }
463
+ declare function createTaskManifest(input: {
464
+ jobId: string;
465
+ snapshot?: string;
466
+ tasks: TaskInput[];
467
+ outputRole?: TaskManifestTask["outputRole"];
468
+ }): TaskManifest;
469
+ declare function createOutputManifest(input: {
470
+ jobId: string;
471
+ planFingerprint: string;
472
+ entries: OutputManifestEntry[];
473
+ }): OutputManifest;
474
+ declare function createOutputManifestFromCheckpoints(input: {
475
+ jobId: string;
476
+ planFingerprint: string;
477
+ checkpoints: CheckpointAdapter;
478
+ }): Promise<OutputManifest>;
479
+ declare function writeOutputManifest(store: ObjectStore, path: string, manifest: OutputManifest): Promise<{
480
+ path: string;
481
+ byteSize: number;
482
+ etag?: string;
483
+ }>;
484
+ declare function readOutputManifest(store: ObjectStore, path: string): Promise<OutputManifest>;
485
+ declare function createBookmark(init: BookmarkInit): Bookmark;
486
+ declare function assertBookmarkMatches(bookmark: Bookmark, planFingerprint: string): void;
487
+ declare function signPaginationToken(bookmark: Bookmark, secret: string | Uint8Array): Promise<string>;
488
+ declare function verifyPaginationToken(token: string, secret: string | Uint8Array): Promise<Bookmark>;
489
+ declare class MemoryCheckpointAdapter implements CheckpointAdapter {
490
+ private readonly checkpoints;
491
+ private readonly taskJobs;
492
+ get(taskId: string): Promise<TaskCheckpoint | undefined>;
493
+ put(checkpoint: TaskCheckpoint): Promise<void>;
494
+ list(jobId?: string): AsyncIterable<TaskCheckpoint>;
495
+ }
496
+ declare function memoryCheckpointAdapter(): MemoryCheckpointAdapter;
497
+ declare function advanceTaskCheckpoint(checkpoints: CheckpointAdapter, input: TaskTransitionInput): Promise<TaskCheckpoint>;
498
+ declare function transitionTaskCheckpoint(existing: TaskCheckpoint | undefined, input: TaskTransitionInput): TaskCheckpoint;
499
+ declare function stableStringify(value: unknown): string;
500
+ declare function fingerprint(value: unknown): string;
226
501
 
227
502
  interface PredicatePlan {
228
503
  partition: Expr[];
@@ -368,63 +643,6 @@ declare function buildBBoxIndex<T extends Record<string, unknown>>(rows: T[], co
368
643
  maxy: string;
369
644
  }): BBoxIndex;
370
645
 
371
- interface PutOptions {
372
- contentType?: string;
373
- metadata?: Record<string, string>;
374
- }
375
- interface ConditionalPutOptions extends PutOptions {
376
- /**
377
- * ETag that must still identify the existing object. Use null to require
378
- * the object to be absent.
379
- */
380
- expectedEtag: string | null;
381
- }
382
- interface ListOptions {
383
- /** Stop listing after this many objects. */
384
- limit?: number;
385
- /** List "directories" by stopping at this delimiter. */
386
- delimiter?: string;
387
- }
388
- interface ObjectInfo {
389
- path: string;
390
- size: number;
391
- etag?: string;
392
- lastModified?: Date;
393
- }
394
- interface ObjectHead {
395
- size: number;
396
- etag?: string;
397
- lastModified?: Date;
398
- contentType?: string;
399
- }
400
- /**
401
- * The single environmental contract for storage. Every runtime driver
402
- * (R2, S3, HTTP, filesystem) supplies one of these; core never touches
403
- * a runtime API directly.
404
- */
405
- interface ObjectStore {
406
- get(path: string): Promise<Uint8Array | null>;
407
- getRange(path: string, range: {
408
- offset: number;
409
- length: number;
410
- }): Promise<Uint8Array>;
411
- put(path: string, body: Uint8Array | ReadableStream<Uint8Array>, options?: PutOptions): Promise<void>;
412
- delete(path: string): Promise<void>;
413
- list(prefix: string, options?: ListOptions): AsyncIterable<ObjectInfo>;
414
- head(path: string): Promise<ObjectHead | null>;
415
- }
416
- interface ConditionalObjectStore extends ObjectStore {
417
- conditionalPut(path: string, body: Uint8Array | ReadableStream<Uint8Array>, options: ConditionalPutOptions): Promise<boolean>;
418
- }
419
- interface ObjectStoreReadControls {
420
- maxConcurrentReads?: number;
421
- signal?: AbortSignal;
422
- maxElapsedMs?: number;
423
- }
424
- declare function withObjectStoreReadControls(store: ObjectStore, controls: ObjectStoreReadControls): ObjectStore;
425
- declare function readControlSignal(controls: ObjectStoreReadControls): AbortSignal | undefined;
426
- declare function throwIfAborted(signal: AbortSignal | undefined): void;
427
-
428
646
  interface QueryBudget {
429
647
  maxFiles?: number;
430
648
  maxBytes?: number;
@@ -455,6 +673,7 @@ interface LakeConfig {
455
673
  store: ObjectStore;
456
674
  scanner: ScanAdapter;
457
675
  sidecarIndex?: SidecarFileIndex[];
676
+ planningCache?: CacheAdapter<ObjectInfo[]>;
458
677
  budget?: QueryBudget;
459
678
  policy?: QueryPolicy;
460
679
  substrate?: RuntimeSubstrate;
@@ -464,6 +683,8 @@ interface LakeConfig {
464
683
  interface ScanOptions {
465
684
  columns?: string[];
466
685
  where?: Expr;
686
+ rowStart?: number;
687
+ rowEnd?: number;
467
688
  batchSize: number;
468
689
  stats: QueryStats;
469
690
  budget: QueryBudget;
@@ -472,18 +693,31 @@ interface ScanOptions {
472
693
  }
473
694
  interface ScanAdapter {
474
695
  scan(path: string, options: ScanOptions): AsyncIterable<Row[]>;
696
+ scanColumns?(path: string, options: ScanOptions): AsyncIterable<Batch>;
697
+ scanVectorBatches?(path: string, options: ScanOptions): AsyncIterable<ScanVectorBatch>;
698
+ scanColumnBatches?(path: string, options: ScanOptions): AsyncIterable<ScanColumnBatch>;
475
699
  planTask?(path: string, options: ScanTaskPlanOptions): Promise<ScanTaskPlan>;
476
700
  }
701
+ interface ScanVectorBatch {
702
+ rowOffset: number;
703
+ batch: Batch;
704
+ }
705
+ interface ScanColumnBatch {
706
+ rowOffset: number;
707
+ batch: Batch;
708
+ }
477
709
  interface ScanTaskPlanOptions {
478
710
  columns?: string[];
479
711
  where?: Expr;
480
712
  partitionValues: Record<string, string>;
713
+ object?: ObjectInfo;
481
714
  }
482
715
  interface ScanTaskPlan {
483
716
  rowGroupRanges: {
484
717
  start: number;
485
718
  end: number;
486
719
  }[];
720
+ rowGroupCount?: number;
487
721
  }
488
722
  interface PathQueryInit {
489
723
  source: string;
@@ -519,11 +753,12 @@ interface CsvStreamOptions {
519
753
  /** Column order for CSV output. Defaults to select columns or first-row keys. */
520
754
  columns?: string[];
521
755
  }
522
- type AggregateOp = "count" | "sum" | "avg" | "min" | "max" | "count_distinct" | "approx_count_distinct" | "first" | "last" | "any";
756
+ type AggregateOp = "count" | "sum" | "avg" | "var_samp" | "var_pop" | "stddev_samp" | "stddev_pop" | "median" | "quantile" | "min" | "max" | "count_distinct" | "approx_count_distinct" | "mode" | "first" | "last" | "any";
523
757
  interface AggregateExpr {
524
758
  op: AggregateOp;
525
759
  column?: string;
526
760
  expr?: Expr;
761
+ quantile?: number;
527
762
  }
528
763
  type AggregateSpec = Record<string, AggregateExpr>;
529
764
  interface AggregateOptions {
@@ -609,12 +844,31 @@ type AggregateStateSnapshot = {
609
844
  op: "avg";
610
845
  sum: number;
611
846
  count: number;
847
+ } | {
848
+ op: "var_samp" | "var_pop" | "stddev_samp" | "stddev_pop";
849
+ count: number;
850
+ mean: number;
851
+ m2: number;
852
+ } | {
853
+ op: "median";
854
+ values: (number | string)[];
855
+ } | {
856
+ op: "quantile";
857
+ quantile: number;
858
+ values: number[];
612
859
  } | {
613
860
  op: "min" | "max";
614
861
  value: AggregateSnapshotValue;
615
862
  } | {
616
863
  op: "count_distinct" | "approx_count_distinct";
617
864
  values: string[];
865
+ } | {
866
+ op: "mode";
867
+ values: {
868
+ key: string;
869
+ value: AggregateSnapshotValue;
870
+ count: number;
871
+ }[];
618
872
  } | {
619
873
  op: "first" | "last" | "any";
620
874
  seen: boolean;
@@ -624,6 +878,7 @@ interface TaskInput {
624
878
  path: string;
625
879
  etag?: string;
626
880
  size?: number;
881
+ rowGroupCount?: number;
627
882
  rowGroupRanges: {
628
883
  start: number;
629
884
  end: number;
@@ -701,6 +956,7 @@ declare class Lake {
701
956
  private readonly queryId;
702
957
  private readonly substrate;
703
958
  private readonly sidecarIndex;
959
+ private readonly planningCache;
704
960
  constructor(config: LakeConfig);
705
961
  path(source: string): QueryBuilder;
706
962
  hive(source: string): QueryBuilder;
@@ -760,6 +1016,7 @@ interface QueryResultConfig extends PathQueryInit {
760
1016
  queryId: string;
761
1017
  metrics?: MetricsHook;
762
1018
  sidecarIndex?: SidecarFileIndex[];
1019
+ planningCache?: CacheAdapter<ObjectInfo[]>;
763
1020
  }
764
1021
  declare class QueryResult {
765
1022
  readonly stats: QueryStats;
@@ -768,6 +1025,8 @@ declare class QueryResult {
768
1025
  rows(): AsyncIterable<Row>;
769
1026
  private matchedRows;
770
1027
  batches(): AsyncIterable<Row[]>;
1028
+ private tryColumnarProjectedBatches;
1029
+ private columnarProjectedBatches;
771
1030
  toArray(): Promise<Row[]>;
772
1031
  topKWithState(options?: TopKOptions): Promise<TopKResult>;
773
1032
  sortWithState(options?: SortOptions): Promise<SortResult>;
@@ -778,8 +1037,15 @@ declare class QueryResult {
778
1037
  slice(options: SliceOptions): Promise<SliceResult>;
779
1038
  resumableBatches(options: ResumableBatchOptions): AsyncIterable<SliceResult>;
780
1039
  aggregate(groupColumns: string[], spec: AggregateSpec, options?: AggregateOptions): Promise<Row[]>;
1040
+ private tryColumnarAggregateRows;
1041
+ private tryLateMaterializedAggregateRows;
1042
+ private aggregateMaterializedRows;
781
1043
  aggregateWithState(groupColumns: string[], spec: AggregateSpec, options?: AggregateOptions): Promise<AggregateResult>;
782
1044
  private orderedBatches;
1045
+ private tryColumnarTopKRows;
1046
+ private tryLateMaterializedTopKRows;
1047
+ private materializeRowRefs;
1048
+ private columnBatches;
783
1049
  private collectOrderedMatches;
784
1050
  private collectSortRuns;
785
1051
  explain(): Promise<ExplainResult>;
@@ -795,117 +1061,61 @@ declare function serializeTopKOperatorState(state: TopKOperatorState): Uint8Arra
795
1061
  declare function serializeSortOperatorState(state: SortOperatorState): Uint8Array;
796
1062
  declare function deserializeTopKOperatorState(bytes: Uint8Array | TopKOperatorState): TopKOperatorState;
797
1063
  declare function deserializeSortOperatorState(bytes: Uint8Array | SortOperatorState): SortOperatorState;
798
- declare function parseJsonQuery(input: unknown): PathQueryInit;
799
- declare function parseHivePartitions(path: string): Record<string, string>;
800
-
801
- interface TaskManifestTask {
802
- id: string;
803
- input: TaskInput;
804
- outputRole: "rows" | "data-file" | "manifest";
805
- }
806
- interface TaskManifest {
807
- version: 1;
808
- jobId: string;
809
- planFingerprint: string;
810
- snapshot: string;
811
- tasks: TaskManifestTask[];
812
- }
813
- interface OutputManifestEntry {
814
- taskId: string;
815
- outputPath: string;
816
- partitionValues: Record<string, string>;
817
- rowCount: number;
818
- byteSize: number;
819
- contentHash?: string;
820
- etag?: string;
821
- iceberg?: {
822
- recordCount: number;
823
- fileSizeInBytes: number;
824
- partitionValues: Record<string, string>;
825
- };
826
- }
827
- interface OutputManifest {
828
- version: 1;
829
- jobId: string;
830
- planFingerprint: string;
831
- entries: OutputManifestEntry[];
832
- }
833
- type TaskState = "planned" | "running" | "output-written" | "manifest-recorded" | "complete";
834
- interface TaskCheckpoint {
835
- taskId: string;
836
- state: TaskState;
837
- idempotencyKey: string;
838
- updatedAtMs: number;
839
- output?: OutputManifestEntry;
840
- outputs?: OutputManifestEntry[];
841
- }
842
- interface CheckpointAdapter {
843
- get(taskId: string): Promise<TaskCheckpoint | undefined>;
844
- put(checkpoint: TaskCheckpoint): Promise<void>;
845
- list(jobId?: string): AsyncIterable<TaskCheckpoint>;
846
- }
847
- interface TaskTransitionInput {
848
- taskId: string;
849
- nextState: TaskState;
850
- idempotencyKey: string;
851
- nowMs: number;
852
- staleTimeoutMs?: number;
853
- output?: OutputManifestEntry;
854
- outputs?: OutputManifestEntry[];
1064
+ declare function parseJsonQuery(input: unknown): PathQueryInit;
1065
+ declare function parseHivePartitions(path: string): Record<string, string>;
1066
+
1067
+ interface InMemoryTableOptions {
1068
+ maxRows?: number;
1069
+ maxBytes?: number;
855
1070
  }
856
- interface BookmarkPosition {
857
- fileIndex: number;
858
- rowGroup: number;
859
- rowOffset: number;
860
- taskId?: string;
861
- outputManifestCursor?: number;
1071
+ interface InMemoryLakeOptions extends Omit<LakeConfig, "store" | "scanner" | "sidecarIndex">, InMemoryTableOptions {
862
1072
  }
863
- interface BookmarkInit {
864
- planFingerprint: string;
865
- snapshot: string;
866
- query?: BookmarkQuery;
867
- position: BookmarkPosition;
868
- writeState?: Bookmark["writeState"];
869
- operatorState?: Bookmark["operatorState"];
1073
+ declare class InMemoryRowsScanner implements ScanAdapter {
1074
+ private readonly tables;
1075
+ constructor(tables: Record<string, readonly Row[]>, options?: InMemoryTableOptions);
1076
+ scan(path: string, options: ScanOptions): AsyncIterable<Row[]>;
1077
+ planTask(path: string): Promise<{
1078
+ rowGroupRanges: {
1079
+ start: number;
1080
+ end: number;
1081
+ }[];
1082
+ }>;
1083
+ tableInfo(path: string): ObjectInfo;
1084
+ listTables(prefix: string, options?: ListOptions): ObjectInfo[];
1085
+ private table;
870
1086
  }
871
- declare function createTaskManifest(input: {
872
- jobId: string;
873
- snapshot?: string;
874
- tasks: TaskInput[];
875
- outputRole?: TaskManifestTask["outputRole"];
876
- }): TaskManifest;
877
- declare function createOutputManifest(input: {
878
- jobId: string;
879
- planFingerprint: string;
880
- entries: OutputManifestEntry[];
881
- }): OutputManifest;
882
- declare function createOutputManifestFromCheckpoints(input: {
883
- jobId: string;
884
- planFingerprint: string;
885
- checkpoints: CheckpointAdapter;
886
- }): Promise<OutputManifest>;
887
- declare function writeOutputManifest(store: ObjectStore, path: string, manifest: OutputManifest): Promise<{
888
- path: string;
889
- byteSize: number;
890
- etag?: string;
891
- }>;
892
- declare function readOutputManifest(store: ObjectStore, path: string): Promise<OutputManifest>;
893
- declare function createBookmark(init: BookmarkInit): Bookmark;
894
- declare function assertBookmarkMatches(bookmark: Bookmark, planFingerprint: string): void;
895
- declare function signPaginationToken(bookmark: Bookmark, secret: string | Uint8Array): Promise<string>;
896
- declare function verifyPaginationToken(token: string, secret: string | Uint8Array): Promise<Bookmark>;
897
- declare class MemoryCheckpointAdapter implements CheckpointAdapter {
898
- private readonly checkpoints;
899
- private readonly taskJobs;
900
- get(taskId: string): Promise<TaskCheckpoint | undefined>;
901
- put(checkpoint: TaskCheckpoint): Promise<void>;
902
- list(jobId?: string): AsyncIterable<TaskCheckpoint>;
1087
+ declare class InMemoryRowsStore implements ObjectStore {
1088
+ private readonly scanner;
1089
+ constructor(scanner: InMemoryRowsScanner);
1090
+ get(path: string): Promise<Uint8Array | null>;
1091
+ getRange(path: string): Promise<Uint8Array>;
1092
+ put(): Promise<void>;
1093
+ delete(): Promise<void>;
1094
+ list(prefix: string, options?: ListOptions): AsyncIterable<ObjectInfo>;
1095
+ head(path: string): Promise<ObjectHead | null>;
903
1096
  }
904
- declare function memoryCheckpointAdapter(): MemoryCheckpointAdapter;
905
- declare function advanceTaskCheckpoint(checkpoints: CheckpointAdapter, input: TaskTransitionInput): Promise<TaskCheckpoint>;
906
- declare function transitionTaskCheckpoint(existing: TaskCheckpoint | undefined, input: TaskTransitionInput): TaskCheckpoint;
907
- declare function stableStringify(value: unknown): string;
908
- declare function fingerprint(value: unknown): string;
1097
+ declare function inMemoryRowsScanner(tables: Record<string, readonly Row[]>, options?: InMemoryTableOptions): InMemoryRowsScanner;
1098
+ declare function createInMemoryLake(tables: Record<string, readonly Row[]>, options?: InMemoryLakeOptions): Lake;
1099
+
1100
+ type JoinType = "inner" | "left" | "semi" | "anti";
1101
+ type JoinKey = string | string[];
1102
+ interface BroadcastJoinOptions {
1103
+ leftKey: JoinKey;
1104
+ rightKey: JoinKey;
1105
+ maxRightRows: number;
1106
+ type?: JoinType;
1107
+ rightPrefix?: string;
1108
+ }
1109
+ interface LookupJoinOptions {
1110
+ leftKey: JoinKey;
1111
+ rightKey: JoinKey;
1112
+ maxRightRows: number;
1113
+ type?: JoinType;
1114
+ rightPrefix?: string;
1115
+ }
1116
+ type LookupJoinFunction = (key: string | number | boolean | bigint | null | (string | number | boolean | bigint | null)[], leftRow: Row) => AsyncIterable<Row> | Iterable<Row> | Promise<AsyncIterable<Row> | Iterable<Row>>;
1117
+ declare function broadcastJoin(left: AsyncIterable<Row> | Iterable<Row>, right: AsyncIterable<Row> | Iterable<Row>, options: BroadcastJoinOptions): Promise<Row[]>;
1118
+ declare function lookupJoin(left: AsyncIterable<Row> | Iterable<Row>, lookup: LookupJoinFunction, options: LookupJoinOptions): Promise<Row[]>;
909
1119
 
910
1120
  /**
911
1121
  * In-memory ObjectStore. The reference implementation of the store
@@ -928,7 +1138,244 @@ declare class MemoryObjectStore implements ObjectStore {
928
1138
  }
929
1139
  declare function memoryStore(): MemoryObjectStore;
930
1140
 
931
- declare const PACKAGE: "@laql/iceberg";
1141
+ interface ObjectStoreCacheOptions {
1142
+ /** Maximum cached object/range bytes retained in memory. Defaults to 64 MiB. */
1143
+ maxBytes?: number;
1144
+ /** Optional time-to-live for cache entries. Entries do not expire by default. */
1145
+ ttlMs?: number;
1146
+ /** How LakeQL should spend the cache budget. Defaults to balanced. */
1147
+ policy?: CachePolicy;
1148
+ }
1149
+ type CachePolicy = "balanced" | "io" | "latency";
1150
+ interface SharedCacheEntry<T> {
1151
+ value: T;
1152
+ bytes: number;
1153
+ }
1154
+ interface SharedCacheSetOptions {
1155
+ priority?: number;
1156
+ }
1157
+ declare class SharedMemoryCache {
1158
+ private readonly maxBytes;
1159
+ private readonly ttlMs;
1160
+ private readonly entries;
1161
+ private cachedBytes;
1162
+ constructor(options?: ObjectStoreCacheOptions);
1163
+ get<T>(key: string): SharedCacheEntry<T> | undefined;
1164
+ set<T>(key: string, value: T, bytes: number, options?: SharedCacheSetOptions): void;
1165
+ delete(key: string): void;
1166
+ deleteWhere(predicate: (value: unknown) => boolean): void;
1167
+ private expiresAt;
1168
+ private evict;
1169
+ private evictKey;
1170
+ }
1171
+ declare function cachedObjectStore(inner: ObjectStore, options?: ObjectStoreCacheOptions, sharedCache?: SharedMemoryCache): ObjectStore;
1172
+
1173
+ type VectorDistinctAggregateState = {
1174
+ op: "count_distinct" | "approx_count_distinct";
1175
+ values: Set<string>;
1176
+ sortedValues?: string[];
1177
+ sortedRuns?: string[][];
1178
+ memoryBytes: number;
1179
+ };
1180
+
1181
+ type VectorAggregateValue = string | number | boolean | bigint | TimestampValue | null;
1182
+ type VectorAggregateState = {
1183
+ op: "count";
1184
+ count: number;
1185
+ } | {
1186
+ op: "sum";
1187
+ sum: number;
1188
+ } | {
1189
+ op: "avg";
1190
+ sum: number;
1191
+ count: number;
1192
+ } | {
1193
+ op: "var_samp" | "var_pop" | "stddev_samp" | "stddev_pop";
1194
+ count: number;
1195
+ mean: number;
1196
+ m2: number;
1197
+ } | {
1198
+ op: "median";
1199
+ values: (number | string)[];
1200
+ memoryBytes: number;
1201
+ } | {
1202
+ op: "quantile";
1203
+ quantile: number;
1204
+ values: number[];
1205
+ memoryBytes: number;
1206
+ } | {
1207
+ op: "min" | "max";
1208
+ value: VectorAggregateValue;
1209
+ } | VectorDistinctAggregateState | {
1210
+ op: "mode";
1211
+ values: Map<string, {
1212
+ value: Exclude<VectorAggregateValue, null>;
1213
+ count: number;
1214
+ }>;
1215
+ memoryBytes: number;
1216
+ } | {
1217
+ op: "first";
1218
+ seen: boolean;
1219
+ value: VectorAggregateValue;
1220
+ } | {
1221
+ op: "last";
1222
+ seen: boolean;
1223
+ value: VectorAggregateValue;
1224
+ } | {
1225
+ op: "any";
1226
+ seen: boolean;
1227
+ value: VectorAggregateValue;
1228
+ };
1229
+ type VectorAggregateStates = Record<string, VectorAggregateState>;
1230
+ type VectorAggregateSnapshotValue = string | number | boolean | null | {
1231
+ type: "bigint";
1232
+ value: string;
1233
+ } | {
1234
+ type: "timestamp";
1235
+ epochNanoseconds: string;
1236
+ unit: TimestampValue["unit"];
1237
+ isAdjustedToUTC: boolean;
1238
+ };
1239
+ type VectorAggregateStateSnapshot = {
1240
+ op: "count";
1241
+ count: number;
1242
+ } | {
1243
+ op: "sum";
1244
+ sum: number;
1245
+ } | {
1246
+ op: "avg";
1247
+ sum: number;
1248
+ count: number;
1249
+ } | {
1250
+ op: "var_samp" | "var_pop" | "stddev_samp" | "stddev_pop";
1251
+ count: number;
1252
+ mean: number;
1253
+ m2: number;
1254
+ } | {
1255
+ op: "median";
1256
+ values: (number | string)[];
1257
+ } | {
1258
+ op: "quantile";
1259
+ quantile: number;
1260
+ values: number[];
1261
+ } | {
1262
+ op: "min" | "max";
1263
+ value: VectorAggregateSnapshotValue;
1264
+ } | {
1265
+ op: "count_distinct" | "approx_count_distinct";
1266
+ values: string[];
1267
+ } | {
1268
+ op: "mode";
1269
+ values: {
1270
+ key: string;
1271
+ value: VectorAggregateSnapshotValue;
1272
+ count: number;
1273
+ }[];
1274
+ } | {
1275
+ op: "first";
1276
+ seen: boolean;
1277
+ value: VectorAggregateSnapshotValue;
1278
+ } | {
1279
+ op: "last";
1280
+ seen: boolean;
1281
+ value: VectorAggregateSnapshotValue;
1282
+ } | {
1283
+ op: "any";
1284
+ seen: boolean;
1285
+ value: VectorAggregateSnapshotValue;
1286
+ };
1287
+ type VectorAggregateStateSnapshots = Record<string, VectorAggregateStateSnapshot>;
1288
+ interface VectorAggregateOptions {
1289
+ budget?: QueryBudget;
1290
+ }
1291
+ declare function createVectorAggregateStates(spec: AggregateSpec, options?: VectorAggregateOptions): VectorAggregateStates;
1292
+ declare function updateVectorAggregateStates(states: VectorAggregateStates, spec: AggregateSpec, batch: Batch, selection?: Selection, options?: VectorAggregateOptions): void;
1293
+ declare function mergeVectorAggregateStates(target: VectorAggregateStates, source: VectorAggregateStates, options?: VectorAggregateOptions): void;
1294
+ declare function mergeVectorAggregateStateSnapshots(target: VectorAggregateStates, snapshots: VectorAggregateStateSnapshots, options?: VectorAggregateOptions): void;
1295
+ declare function finalizeVectorAggregateStates(states: VectorAggregateStates): Record<string, unknown>;
1296
+ declare function snapshotVectorAggregateStates(states: VectorAggregateStates): VectorAggregateStateSnapshots;
1297
+ declare function restoreVectorAggregateStates(snapshots: VectorAggregateStateSnapshots, options?: VectorAggregateOptions): VectorAggregateStates;
1298
+ declare function vectorAggregateBatch(spec: AggregateSpec, batch: Batch, selection?: Selection, options?: VectorAggregateOptions): Record<string, unknown>;
1299
+ declare function updateVectorAggregateStateValue(state: VectorAggregateState, value: VectorAggregateValue, options?: VectorAggregateOptions): void;
1300
+
1301
+ interface VectorGroupByOptions extends VectorAggregateOptions {
1302
+ maxGroups?: number;
1303
+ }
1304
+ interface VectorGroupByState {
1305
+ readonly keys: readonly string[];
1306
+ readonly spec: AggregateSpec;
1307
+ readonly groups: Map<string, VectorGroup>;
1308
+ }
1309
+ interface VectorGroup {
1310
+ keyValues: Scalar[];
1311
+ states: VectorAggregateStates;
1312
+ }
1313
+ type VectorGroupBySnapshotValue = string | number | boolean | null | {
1314
+ type: "bigint";
1315
+ value: string;
1316
+ } | {
1317
+ type: "timestamp";
1318
+ epochNanoseconds: string;
1319
+ unit: TimestampValue["unit"];
1320
+ isAdjustedToUTC: boolean;
1321
+ };
1322
+ interface VectorGroupByGroupSnapshot {
1323
+ keyValues: VectorGroupBySnapshotValue[];
1324
+ states: VectorAggregateStateSnapshots;
1325
+ }
1326
+ interface VectorGroupByStateSnapshot {
1327
+ groups: VectorGroupByGroupSnapshot[];
1328
+ }
1329
+ declare function createVectorGroupByState(keys: readonly string[], spec: AggregateSpec): VectorGroupByState;
1330
+ declare function updateVectorGroupByState(state: VectorGroupByState, batch: Batch, selection?: Selection, options?: VectorGroupByOptions): number;
1331
+ declare function getOrCreateVectorGroup(state: VectorGroupByState, batch: Batch, index: number, options?: VectorGroupByOptions): VectorGroup;
1332
+ declare function updateVectorGroupAggregateValue(group: VectorGroup, alias: string, value: VectorAggregateValue, options?: VectorAggregateOptions): void;
1333
+ declare function enforceVectorGroupByBudget(state: VectorGroupByState, budget?: QueryBudget): void;
1334
+ declare function finalizeVectorGroupByRows(state: VectorGroupByState): Row[];
1335
+ declare function finalizeVectorGroupByBatch(state: VectorGroupByState): Batch;
1336
+ declare function snapshotVectorGroupByState(state: VectorGroupByState): VectorGroupByStateSnapshot;
1337
+ declare function restoreVectorGroupByState(keys: readonly string[], spec: AggregateSpec, snapshot: VectorGroupByStateSnapshot, options?: VectorGroupByOptions): VectorGroupByState;
1338
+ declare function mergeVectorGroupByStates(target: VectorGroupByState, source: VectorGroupByState, options?: VectorGroupByOptions): void;
1339
+ declare function vectorGroupByBatch(keys: readonly string[], spec: AggregateSpec, batch: Batch, selection?: Selection, options?: VectorGroupByOptions): Batch;
1340
+
1341
+ interface VectorHashJoinOptions {
1342
+ leftKey: JoinKey;
1343
+ rightKey: JoinKey;
1344
+ maxRightRows: number;
1345
+ type?: JoinType;
1346
+ rightPrefix?: string;
1347
+ leftSelection?: Selection;
1348
+ rightSelection?: Selection;
1349
+ }
1350
+ declare function vectorHashJoin(left: Batch, right: Batch, options: VectorHashJoinOptions): Batch;
1351
+
1352
+ type VectorProjectionSpec = Record<string, Expr>;
1353
+ declare function vectorProjectBatch(batch: Batch, select?: readonly string[], projections?: VectorProjectionSpec): Batch;
1354
+
1355
+ interface VectorTopKOptions {
1356
+ offset?: number;
1357
+ limit: number;
1358
+ }
1359
+ declare function vectorOrderByBatch(batch: Batch, orderBy: readonly OrderByTerm[], selection?: Selection): Batch;
1360
+ declare function vectorTopKBatch(batch: Batch, orderBy: readonly OrderByTerm[], options: VectorTopKOptions, selection?: Selection): Batch;
1361
+ declare function vectorSortIndices(batch: Batch, orderBy: readonly OrderByTerm[], selection?: Selection): number[];
1362
+ declare function vectorTopKIndices(batch: Batch, orderBy: readonly OrderByTerm[], topK: number, selection?: Selection): number[];
1363
+ declare function gatherBatch(batch: Batch, indices: readonly number[]): Batch;
1364
+ declare function concatBatches(batches: readonly Batch[]): Batch;
1365
+
1366
+ interface WorkUnitFanInOptions<Input, Partial, Accumulator> {
1367
+ inputs: readonly Input[];
1368
+ initial: Accumulator;
1369
+ maxConcurrentTasks?: number;
1370
+ maxBufferedPartials?: number;
1371
+ run(input: Input, index: number): Promise<Partial>;
1372
+ reduce(accumulator: Accumulator, partial: Partial, input: Input, index: number): void | Promise<void>;
1373
+ boundary?(partial: Partial, input: Input, index: number): Partial | Promise<Partial>;
1374
+ }
1375
+ declare function fanInWorkUnits<Input, Partial, Accumulator>(options: WorkUnitFanInOptions<Input, Partial, Accumulator>): Promise<Accumulator>;
1376
+ declare function jsonWorkUnitBoundary<T>(value: T): T;
1377
+
1378
+ declare const PACKAGE: "lakeql-iceberg";
932
1379
  type IcebergReadMode = "strict" | "ignore-deletes" | "ignore-unsupported-deletes";
933
1380
  interface LoadIcebergTableOptions extends ObjectStoreReadControls {
934
1381
  store: ObjectStore;
@@ -1199,6 +1646,20 @@ declare function loadIcebergTableFromRest(options: LoadIcebergTableFromRestOptio
1199
1646
  declare function applyIcebergDeletes(options: ApplyIcebergDeletesOptions): Row[];
1200
1647
  declare function scanPlannedIcebergRows(options: ScanPlannedIcebergRowsOptions): AsyncIterable<Row[]>;
1201
1648
 
1649
+ declare class DecodedColumnCache {
1650
+ private readonly cache;
1651
+ private readonly options;
1652
+ constructor(cache: SharedMemoryCache, options: ObjectStoreCacheOptions);
1653
+ get(key: string): Batch | undefined;
1654
+ set(key: string, batch: Batch): void;
1655
+ getVector(key: string): Vector | undefined;
1656
+ setVector(key: string, vector: Vector): boolean;
1657
+ getValue<T>(key: string): T | undefined;
1658
+ setValue<T>(key: string, value: T, bytes: number): void;
1659
+ private shouldAdmitDecodedVector;
1660
+ private shouldAdmitDecodedWorkProduct;
1661
+ }
1662
+
1202
1663
  interface ReadParquetOptions {
1203
1664
  /** Columns to project; all columns when omitted. */
1204
1665
  columns?: string[];
@@ -1208,14 +1669,33 @@ interface ReadParquetOptions {
1208
1669
  interface ReadParquetBatchOptions extends ReadParquetOptions {
1209
1670
  batchSize?: number;
1210
1671
  where?: Expr;
1672
+ stats?: QueryStats;
1673
+ decodedColumnCache?: DecodedColumnCache;
1674
+ decodedColumnCacheKey?: string;
1211
1675
  }
1212
1676
  interface ParquetRowBatch {
1213
1677
  rowOffset: number;
1214
1678
  rows: Row[];
1215
1679
  }
1216
- interface PlanParquetRowGroupsOptions {
1217
- where?: Expr;
1680
+ interface ParquetColumnBatch {
1681
+ rowOffset: number;
1682
+ batch: Batch;
1683
+ residualPredicateSatisfied?: boolean;
1684
+ }
1685
+ type ParquetMetadata = Awaited<ReturnType<typeof parquetMetadataAsync>>;
1686
+ interface StoreAsyncBuffer {
1687
+ byteLength: number;
1688
+ etag?: string;
1689
+ slice(start: number, end?: number): Promise<ArrayBuffer>;
1690
+ }
1691
+
1692
+ interface RangeCacheOptions {
1693
+ maxBytes: number;
1694
+ maxEntryBytes?: number;
1695
+ sharedCache?: SharedMemoryCache;
1696
+ cacheOptions?: ObjectStoreCacheOptions;
1218
1697
  }
1698
+
1219
1699
  interface PlannedParquetRowGroup {
1220
1700
  index: number;
1221
1701
  rowStart: number;
@@ -1232,6 +1712,88 @@ interface ParquetRowGroupPlan {
1232
1712
  end: number;
1233
1713
  }[];
1234
1714
  }
1715
+ declare function planRowGroupsFromMetadata(metadata: ParquetMetadata, where: Expr | undefined): ParquetRowGroupPlan;
1716
+
1717
+ interface ScanParquetTaskOptions {
1718
+ batchSize?: number;
1719
+ stats?: QueryStats;
1720
+ metadataCache?: CacheAdapter<ParquetMetadata>;
1721
+ }
1722
+ interface PlanParquetTaskWorkUnitsOptions {
1723
+ maxRowGroupsPerTask?: number;
1724
+ maxRowsPerTask?: number;
1725
+ metadataCache?: CacheAdapter<ParquetMetadata>;
1726
+ }
1727
+ interface AggregateParquetTaskOptions extends ScanParquetTaskOptions {
1728
+ budget?: QueryBudget;
1729
+ }
1730
+ interface AggregateParquetTasksOptions extends AggregateParquetTaskOptions {
1731
+ maxConcurrentTasks?: number;
1732
+ maxBufferedPartials?: number;
1733
+ preserveTaskBoundaries?: boolean;
1734
+ partialBoundary?(partial: VectorAggregateStateSnapshots, task: TaskInput, index: number): VectorAggregateStateSnapshots | Promise<VectorAggregateStateSnapshots>;
1735
+ }
1736
+ interface AggregateParquetGroupTaskOptions extends AggregateParquetTaskOptions {
1737
+ maxGroups?: number;
1738
+ }
1739
+ interface AggregateParquetGroupTasksOptions extends AggregateParquetGroupTaskOptions {
1740
+ maxConcurrentTasks?: number;
1741
+ maxBufferedPartials?: number;
1742
+ preserveTaskBoundaries?: boolean;
1743
+ orderBy?: OrderByTerm[];
1744
+ limit?: number;
1745
+ offset?: number;
1746
+ partialBoundary?(partial: VectorGroupByStateSnapshot, task: TaskInput, index: number): VectorGroupByStateSnapshot | Promise<VectorGroupByStateSnapshot>;
1747
+ }
1748
+
1749
+ declare function aggregateParquetTask(store: ObjectStore, task: TaskInput, spec: AggregateSpec, options?: AggregateParquetTaskOptions): Promise<VectorAggregateStateSnapshots>;
1750
+ declare function aggregateParquetTasks(store: ObjectStore, tasks: TaskInput[], spec: AggregateSpec, options?: AggregateParquetTasksOptions): Promise<Record<string, unknown>>;
1751
+ declare function aggregateParquetGroupTask(store: ObjectStore, task: TaskInput, groupColumns: readonly string[], spec: AggregateSpec, options?: AggregateParquetGroupTaskOptions): Promise<VectorGroupByStateSnapshot>;
1752
+ declare function aggregateParquetGroupTasks(store: ObjectStore, tasks: TaskInput[], groupColumns: readonly string[], spec: AggregateSpec, options?: AggregateParquetGroupTasksOptions): Promise<Row[]>;
1753
+ declare function aggregateParquetGroupTasksBatch(store: ObjectStore, tasks: TaskInput[], groupColumns: readonly string[], spec: AggregateSpec, options?: AggregateParquetGroupTasksOptions): Promise<Batch>;
1754
+
1755
+ /** @internal Exposed for pruning tests; not part of the stable public API. */
1756
+ declare function rowGroupMayMatch(rowGroup: RowGroup, expr: Expr | undefined): boolean;
1757
+ /** @internal Exposed for scan/aggregate tests; not part of the stable public API. */
1758
+ declare function rowGroupMustMatch(rowGroup: RowGroup, expr: Expr | undefined): boolean;
1759
+
1760
+ declare class ParquetScanAdapter implements ScanAdapter {
1761
+ private readonly store;
1762
+ private readonly defaultBatchSize;
1763
+ private readonly metadataCache;
1764
+ private readonly decodedColumnCache;
1765
+ private readonly scanRangeCache;
1766
+ constructor(store: ObjectStore, options?: {
1767
+ batchSize?: number;
1768
+ metadataCache?: CacheAdapter<ParquetMetadata>;
1769
+ decodedColumnCache?: DecodedColumnCache;
1770
+ scanRangeCache?: RangeCacheOptions;
1771
+ });
1772
+ scan(path: string, options: ScanOptions): AsyncIterable<Row[]>;
1773
+ scanColumns(path: string, options: ScanOptions): AsyncIterable<Batch>;
1774
+ scanColumnBatches(path: string, options: ScanOptions): AsyncIterable<ScanColumnBatch>;
1775
+ scanVectorBatches(path: string, options: ScanOptions): AsyncIterable<ScanVectorBatch>;
1776
+ planTask(path: string, options: ScanTaskPlanOptions): Promise<ScanTaskPlan>;
1777
+ private metadata;
1778
+ private scanBuffer;
1779
+ }
1780
+
1781
+ declare function rejectUnsupportedParquetSchema(metadata: ParquetMetadata): void;
1782
+
1783
+ /**
1784
+ * Bridge an ObjectStore path to hyparquet's AsyncBuffer (length + ranged slice).
1785
+ */
1786
+ declare function asyncBufferFromStore(store: ObjectStore, path: string, options?: ScanOptions | undefined): Promise<StoreAsyncBuffer>;
1787
+
1788
+ declare function scanParquetTaskBatches(store: ObjectStore, task: TaskInput, options?: ScanParquetTaskOptions): AsyncIterable<Row[]>;
1789
+ declare function scanParquetTaskColumnBatches(store: ObjectStore, task: TaskInput, options?: ScanParquetTaskOptions): AsyncIterable<ParquetColumnBatch>;
1790
+ declare function planParquetTaskWorkUnits(store: ObjectStore, task: TaskInput, options: PlanParquetTaskWorkUnitsOptions): Promise<TaskInput[]>;
1791
+ /** Read Parquet footer metadata (row groups, schema, stats). */
1792
+ declare function readParquetMetadata(store: ObjectStore, path: string, metadataCache?: ScanParquetTaskOptions["metadataCache"]): Promise<ParquetMetadata>;
1793
+
1794
+ interface PlanParquetRowGroupsOptions {
1795
+ where?: Expr;
1796
+ }
1235
1797
  type IcebergParquetDeleteFileContent = "position-delete" | "equality-delete" | "deletion-vector";
1236
1798
  interface IcebergParquetDeleteFile {
1237
1799
  content: IcebergParquetDeleteFileContent;
@@ -1315,26 +1877,13 @@ interface PartitionedParquetOutputEntryOptions {
1315
1877
  }
1316
1878
  interface ParquetLakeConfig extends Omit<LakeConfig, "scanner"> {
1317
1879
  batchSize?: number;
1880
+ cache?: ObjectStoreCacheOptions;
1318
1881
  metadataCache?: CacheAdapter<ParquetMetadata>;
1882
+ scanRangeCache?: RangeCacheOptions;
1319
1883
  }
1320
- type ParquetMetadata = Awaited<ReturnType<typeof parquetMetadataAsync>>;
1321
- interface StoreAsyncBuffer {
1322
- byteLength: number;
1323
- etag?: string;
1324
- slice(start: number, end?: number): Promise<ArrayBuffer>;
1325
- }
1326
- /**
1327
- * Bridge an ObjectStore path to hyparquet's AsyncBuffer (length + ranged slice).
1328
- */
1329
- declare function asyncBufferFromStore(store: ObjectStore, path: string, options?: ScanOptions | undefined): Promise<StoreAsyncBuffer>;
1330
- /**
1331
- * Read rows from a Parquet object. Early scaffold: full planner-driven
1332
- * row-group pruning and batch streaming land in phase 1-2 (see BUILD_PLAN.md).
1333
- */
1334
1884
  declare function readParquetObjects(store: ObjectStore, path: string, options?: ReadParquetOptions): Promise<Record<string, unknown>[]>;
1335
1885
  declare function readParquetObjectBatches(store: ObjectStore, path: string, options?: ReadParquetBatchOptions): AsyncIterable<ParquetRowBatch>;
1336
- /** Read Parquet footer metadata (row groups, schema, stats). */
1337
- declare function readParquetMetadata(store: ObjectStore, path: string): Promise<hyparquet_src_types_js.FileMetaData>;
1886
+ declare function readParquetColumnBatches(store: ObjectStore, path: string, options?: ReadParquetBatchOptions): AsyncIterable<ParquetColumnBatch>;
1338
1887
  declare function planRowGroups(store: ObjectStore, path: string, options?: PlanParquetRowGroupsOptions): Promise<ParquetRowGroupPlan>;
1339
1888
  declare function readIcebergParquetDeletes(store: ObjectStore, deleteFile: IcebergParquetDeleteFile): Promise<DecodedIcebergParquetDeletes>;
1340
1889
  declare function writeParquet(store: ObjectStore, path: string, options: WriteParquetOptions): Promise<{
@@ -1346,27 +1895,12 @@ declare function writePartitionedParquet(store: ObjectStore, prefix: string, opt
1346
1895
  declare function writePartitionedParquetTask(store: ObjectStore, prefix: string, options: WritePartitionedParquetTaskOptions): Promise<WritePartitionedParquetTaskResult>;
1347
1896
  declare function createParquetTableAs(store: ObjectStore, prefix: string, options: CreateParquetTableAsOptions): Promise<CreateParquetTableAsResult>;
1348
1897
  declare function partitionedParquetOutputEntries(result: WritePartitionedParquetResult, options: PartitionedParquetOutputEntryOptions): OutputManifestEntry[];
1349
- declare class ParquetScanAdapter implements ScanAdapter {
1350
- private readonly store;
1351
- private readonly defaultBatchSize;
1352
- private readonly metadataCache;
1353
- constructor(store: ObjectStore, options?: {
1354
- batchSize?: number;
1355
- metadataCache?: CacheAdapter<ParquetMetadata>;
1356
- });
1357
- scan(path: string, options: ScanOptions): AsyncIterable<Row[]>;
1358
- planTask(path: string, options: ScanTaskPlanOptions): Promise<ScanTaskPlan>;
1359
- private metadata;
1360
- }
1361
- declare function planRowGroupsFromMetadata(metadata: ParquetMetadata, where: Expr | undefined): ParquetRowGroupPlan;
1362
- declare function rejectUnsupportedParquetSchema(metadata: ParquetMetadata): void;
1363
1898
  type InsertValue = string | number | boolean | bigint | null;
1364
1899
  type ComparableInsertValue = string | number | bigint;
1365
- /** @internal Exposed for pruning tests; not part of the stable public API. */
1366
- declare function rowGroupMayMatch(rowGroup: RowGroup, expr: Expr | undefined): boolean;
1367
1900
  declare function parquetScanner(store: ObjectStore, options?: {
1368
1901
  batchSize?: number;
1369
1902
  metadataCache?: CacheAdapter<ParquetMetadata>;
1903
+ decodedColumnCache?: DecodedColumnCache;
1370
1904
  }): ScanAdapter;
1371
1905
  declare function createParquetLake(config: ParquetLakeConfig): Lake;
1372
1906
 
@@ -1416,4 +1950,4 @@ declare function planFiles(table: EngineTable, options?: PlanIcebergFilesOptions
1416
1950
  declare function scanBatches(plan: EngineFilePlan, options?: ScanEngineOptions): AsyncIterable<ScanBatch>;
1417
1951
  declare function scanRows(plan: EngineFilePlan, options?: ScanEngineOptions): AsyncIterable<Row>;
1418
1952
 
1419
- export { type AggregateExpr, type AggregateGroupSnapshot, type AggregateOp, type AggregateOperatorState, type AggregateOptions, type AggregateResult, type AggregateSnapshotValue, type AggregateSpec, type AggregateStateSnapshot, AggregationBuilder, type ApplyIcebergDeletesOptions, type ArithmeticExpr, type BBoxIndex, type BetweenExpr, type Bookmark, type BookmarkInit, type BookmarkPosition, type BookmarkQuery, type BroadcastJoinOptions, type CacheAdapter, CacheApiCache, type CacheApiCacheOptions, type CacheEntry, type CallExpr, type CaseExpr, type CaseWhenExpr, type CheckpointAdapter, type CheckpointStore, type Clock, type ColumnExpr, type ColumnInput, type CompareExpr, type CompareOp, type ConditionalObjectStore, type ConditionalPutOptions, type CreateParquetTableAsOptions, type CreateParquetTableAsQuery, type CreateParquetTableAsResult, type CsvStreamOptions, type DecodedIcebergDeletes, type DecodedIcebergParquetDeletes, ERROR_CODES, type EngineFilePlan, type EngineTable, type ErrorDetails, type ExplainJson, type ExplainResult, type Expr, type IcebergAppendFile, type IcebergAppendOptions, type IcebergAppendOutputManifestOptions, type IcebergAppendResult, type IcebergCatalog, type IcebergCommitCatalog, type IcebergCommitInput, type IcebergCommitResult, type IcebergDeleteFile, type IcebergDeletionVector, type IcebergEnginePlan, type IcebergEngineTable, type IcebergEqualityDelete, type IcebergField, type IcebergGlueCatalogOptions, type IcebergNessieCatalogOptions, type IcebergParquetDeleteFile, type IcebergParquetDeleteFileContent, type IcebergPartitionField, type IcebergPartitionSpec, type IcebergPlan, type IcebergPositionDelete, type IcebergReadMode, IcebergRestCatalog, type IcebergRestCatalogOptions, type IcebergRowBatch, type IcebergSortOrder, IcebergTable, type IcebergTableIdentifier, IcebergUnsupportedCatalog, type IdGenerator, type InExpr, type IndexPruneResult, type IndexValue, type InsertValidationRules, type JoinKey, type JoinType, type JsonExpr, type JsonOrderByTerm, type JsonQueryV1, LaQLError, type LaQLErrorCode, Lake, type LakeConfig, type LikeExpr, type ListOptions, type LiteralExpr, type LoadIcebergEngineTableOptions, type LoadIcebergTableFromObjectStoreOptions, type LoadIcebergTableFromRestOptions, type LoadIcebergTableOptions, type LoadParquetEngineTableOptions, type LoadTableOptions, type LockAdapter, type LogHook, type LogicalExpr, type LookupJoinFunction, type LookupJoinOptions, type Manifest, type ManifestDeleteFile, type ManifestFile, MemoryCache, MemoryCheckpointAdapter, MemoryObjectStore, MemorySpillAdapter, type MemorySpillAdapterOptions, type MetadataFile, type MetricsHook, type MinMaxColumnIndex, type NotExpr, type NullCheckExpr, type ObjectHead, type ObjectInfo, type ObjectStore, ObjectStoreIcebergCommitCatalog, type ObjectStoreReadControls, type OperatorSnapshotValue, type OrderByTerm, type OutputManifest, type OutputManifestEntry, PACKAGE, type ParquetEnginePlan, type ParquetEngineTable, type ParquetLakeConfig, type ParquetMetadata, type ParquetRowBatch, type ParquetRowGroupPlan, ParquetScanAdapter, type PartitionedParquetOutputEntryOptions, type PathQueryInit, type PlanIcebergFilesOptions, type PlanParquetRowGroupsOptions, type PlannedIcebergFile, type PlannedParquetRowGroup, type PredicatePlan, type PredicatePlanOptions, type ProjectIcebergRowOptions, type PutOptions, type QueryBudget, QueryBuilder, type QueryPolicy, type QueryPolicyContext, QueryResult, type QueryRunOptions, type QueryStats, type QueueAdapter, type ReadParquetBatchOptions, type ReadParquetOptions, type ResumableBatchOptions, ResumedQuery, type Row, type RuntimeSubstrate, type Scalar, type ScanAdapter, type ScanBatch, type ScanEngineOptions, type ScanOptions, type ScanPlannedIcebergRowsOptions, type ScanTaskPlan, type ScanTaskPlanOptions, type SidecarFileIndex, type SliceOptions, type SliceResult, type Snapshot, type SortOperatorState, type SortOptions, type SortResult, type SortRunState, type SpillAdapter, type SpillRef, type SpillUsage, type SqlBoolean, type TaskCheckpoint, type TaskInput, type TaskManifest, type TaskManifestTask, type TaskState, type TaskTransitionInput, type TopKOperatorState, type TopKOptions, type TopKResult, type ValueInput, type WriteParquetOptions, type WriteParquetRowsOptions, type WritePartitionedParquetFile, type WritePartitionedParquetResult, type WritePartitionedParquetTaskOptions, type WritePartitionedParquetTaskResult, add, advanceTaskCheckpoint, and, applyIcebergDeletes, assertBookmarkMatches, asyncBufferFromStore, bboxMayIntersect, between, broadcastJoin, buildBBoxIndex, buildMinMaxIndex, cacheApiCache, classifyPredicate, col, createBookmark, createParquetLake as createLake, createOutputManifest, createOutputManifestFromCheckpoints, createParquetLake, createParquetTableAs, createTaskManifest, deserializeAggregateOperatorState, deserializeSortOperatorState, deserializeTopKOperatorState, div, encodeJsonLine, eq, evaluate, fingerprint, fn, gt, gte, icebergGlueCatalog, icebergNessieCatalog, icebergRestCatalog, ilike, isIn, isLaQLError, isNotNull, isNull, jsonSafeValue, like, lit, loadIcebergTable, loadIcebergTableFromObjectStore, loadIcebergTableFromRest, loadTable, lookupJoin, lt, lte, matches, memoryCache, memoryCheckpointAdapter, memorySpillAdapter, memoryStore, mod, mul, ne, not, notIn, or, parquetScanner, parseHivePartitions, parseJsonQuery, partitionedParquetOutputEntries, planFiles, planRowGroups, planRowGroupsFromMetadata, pruneFilesWithIndex, readControlSignal, readIcebergParquetDeletes, readOutputManifest, readParquetMetadata, readParquetObjectBatches, readParquetObjects, rejectUnsupportedParquetSchema, rowGroupMayMatch, scanBatches, scanPlannedIcebergRows, scanRows, serializeAggregateOperatorState, serializeSortOperatorState, serializeTopKOperatorState, signPaginationToken, stableStringify, sub, throwIfAborted, transitionTaskCheckpoint, verifyPaginationToken, withObjectStoreReadControls, writeOutputManifest, writeParquet, writePartitionedParquet, writePartitionedParquetTask };
1953
+ export { type AggregateExpr, type AggregateGroupSnapshot, type AggregateOp, type AggregateOperatorState, type AggregateOptions, type AggregateParquetGroupTaskOptions, type AggregateParquetGroupTasksOptions, type AggregateParquetTaskOptions, type AggregateParquetTasksOptions, type AggregateResult, type AggregateSnapshotValue, type AggregateSpec, type AggregateStateSnapshot, AggregationBuilder, type ApplyIcebergDeletesOptions, type ArithmeticExpr, type BBox, type BBoxIndex, type Batch, type BatchExprValues, type BetweenExpr, type Bookmark, type BookmarkInit, type BookmarkPosition, type BookmarkQuery, type BroadcastJoinOptions, type CacheAdapter, CacheApiCache, type CacheApiCacheOptions, type CacheEntry, type CachePolicy, type CallExpr, type CaseExpr, type CaseWhenExpr, type CheckpointAdapter, type CheckpointStore, type Clock, type ColumnExpr, type ColumnInput, type CompareExpr, type CompareOp, type ConditionalObjectStore, type ConditionalPutOptions, type CreateParquetTableAsOptions, type CreateParquetTableAsQuery, type CreateParquetTableAsResult, type CsvStreamOptions, type DecodedIcebergDeletes, type DecodedIcebergParquetDeletes, ERROR_CODES, type EngineFilePlan, type EngineTable, type ErrorDetails, type ExplainJson, type ExplainResult, type Expr, type GeoBackend, type GeoJsonGeometry, type IcebergAppendFile, type IcebergAppendOptions, type IcebergAppendOutputManifestOptions, type IcebergAppendResult, type IcebergCatalog, type IcebergCommitCatalog, type IcebergCommitInput, type IcebergCommitResult, type IcebergDeleteFile, type IcebergDeletionVector, type IcebergEnginePlan, type IcebergEngineTable, type IcebergEqualityDelete, type IcebergField, type IcebergGlueCatalogOptions, type IcebergNessieCatalogOptions, type IcebergParquetDeleteFile, type IcebergParquetDeleteFileContent, type IcebergPartitionField, type IcebergPartitionSpec, type IcebergPlan, type IcebergPositionDelete, type IcebergReadMode, IcebergRestCatalog, type IcebergRestCatalogOptions, type IcebergRowBatch, type IcebergSortOrder, IcebergTable, type IcebergTableIdentifier, IcebergUnsupportedCatalog, type IdGenerator, type InExpr, type InMemoryLakeOptions, InMemoryRowsScanner, InMemoryRowsStore, type InMemoryTableOptions, type IndexPruneResult, type IndexValue, type InsertValidationRules, type JoinKey, type JoinType, type JsonExpr, type JsonOrderByTerm, type JsonQueryV1, Lake, type LakeConfig, LakeqlError, type LakeqlErrorCode, type LikeExpr, type ListOptions, type LiteralExpr, type LoadIcebergEngineTableOptions, type LoadIcebergTableFromObjectStoreOptions, type LoadIcebergTableFromRestOptions, type LoadIcebergTableOptions, type LoadParquetEngineTableOptions, type LoadTableOptions, type LockAdapter, type LogHook, type LogicalExpr, type LookupJoinFunction, type LookupJoinOptions, type Manifest, type ManifestDeleteFile, type ManifestFile, MemoryCache, MemoryCheckpointAdapter, MemoryObjectStore, MemorySpillAdapter, type MemorySpillAdapterOptions, type MetadataFile, type MetricsHook, type MinMaxColumnIndex, type NotExpr, type NullCheckExpr, type ObjectHead, type ObjectInfo, type ObjectStore, type ObjectStoreCacheOptions, ObjectStoreIcebergCommitCatalog, type ObjectStoreReadControls, type OperatorSnapshotValue, type OrderByTerm, type OutputManifest, type OutputManifestEntry, PACKAGE, type ParquetColumnBatch, type ParquetEnginePlan, type ParquetEngineTable, type ParquetLakeConfig, type ParquetMetadata, type ParquetRowBatch, type ParquetRowGroupPlan, ParquetScanAdapter, type PartitionedParquetOutputEntryOptions, type PathQueryInit, type PlanIcebergFilesOptions, type PlanParquetRowGroupsOptions, type PlanParquetTaskWorkUnitsOptions, type PlannedIcebergFile, type PlannedParquetRowGroup, type PredicatePlan, type PredicatePlanOptions, type ProjectIcebergRowOptions, type PutOptions, type QueryBudget, QueryBuilder, type QueryPolicy, type QueryPolicyContext, QueryResult, type QueryRunOptions, type QueryStats, type QueueAdapter, type ReadParquetBatchOptions, type ReadParquetOptions, type ResumableBatchOptions, ResumedQuery, type Row, type RuntimeSubstrate, type Scalar, type ScanAdapter, type ScanBatch, type ScanColumnBatch, type ScanEngineOptions, type ScanOptions, type ScanParquetTaskOptions, type ScanPlannedIcebergRowsOptions, type ScanTaskPlan, type ScanTaskPlanOptions, type ScanVectorBatch, type Selection, type SharedCacheEntry, type SharedCacheSetOptions, SharedMemoryCache, type SidecarFileIndex, type SliceOptions, type SliceResult, type Snapshot, type SortOperatorState, type SortOptions, type SortResult, type SortRunState, type SpillAdapter, type SpillRef, type SpillUsage, type SqlBoolean, type TaskCheckpoint, type TaskInput, type TaskManifest, type TaskManifestTask, type TaskState, type TaskTransitionInput, type TimestampUnit, TimestampValue, type TopKOperatorState, type TopKOptions, type TopKResult, type ValueInput, type Vector, type VectorAggregateOptions, type VectorAggregateSnapshotValue, type VectorAggregateState, type VectorAggregateStateSnapshot, type VectorAggregateStateSnapshots, type VectorAggregateStates, type VectorAggregateValue, type VectorGroup, type VectorGroupByGroupSnapshot, type VectorGroupByOptions, type VectorGroupBySnapshotValue, type VectorGroupByState, type VectorGroupByStateSnapshot, type VectorHashJoinOptions, type VectorProjectionSpec, type VectorTopKOptions, type WorkUnitFanInOptions, type WriteParquetOptions, type WriteParquetRowsOptions, type WritePartitionedParquetFile, type WritePartitionedParquetResult, type WritePartitionedParquetTaskOptions, type WritePartitionedParquetTaskResult, add, advanceTaskCheckpoint, aggregateParquetGroupTask, aggregateParquetGroupTasks, aggregateParquetGroupTasksBatch, aggregateParquetTask, aggregateParquetTasks, and, applyIcebergDeletes, assertBookmarkMatches, asyncBufferFromStore, batchExprValues, batchFromColumns, batchFromVectors, bboxIntersects, bboxMayIntersect, between, broadcastJoin, buildBBoxIndex, buildMinMaxIndex, cacheApiCache, cachedObjectStore, classifyPredicate, col, compareTimestampValues, concatBatches, createBookmark, createInMemoryLake, createParquetLake as createLake, createOutputManifest, createOutputManifestFromCheckpoints, createParquetLake, createParquetTableAs, createTaskManifest, createVectorAggregateStates, createVectorGroupByState, deserializeAggregateOperatorState, deserializeSortOperatorState, deserializeTopKOperatorState, div, encodeJsonLine, enforceVectorGroupByBudget, ensureGeoBackendForExprs, envelopeFromGeometry, envelopeOf, eq, evaluate, fanInWorkUnits, finalizeVectorAggregateStates, finalizeVectorGroupByBatch, finalizeVectorGroupByRows, fingerprint, fn, gatherBatch, getOrCreateVectorGroup, gt, gte, icebergGlueCatalog, icebergNessieCatalog, icebergRestCatalog, ilike, inMemoryRowsScanner, isIn, isLakeqlError, isNotNull, isNull, isTimestampValue, jsonSafeValue, jsonWorkUnitBoundary, like, lit, loadGeoBackend, loadIcebergTable, loadIcebergTableFromObjectStore, loadIcebergTableFromRest, loadTable, lookupJoin, lt, lte, matches, materializeBatchRows, materializeSelectedBatchRows, memoryCache, memoryCheckpointAdapter, memorySpillAdapter, memoryStore, mergeVectorAggregateStateSnapshots, mergeVectorAggregateStates, mergeVectorGroupByStates, mod, mul, ne, not, notIn, or, parquetScanner, parseGeometry, parseHivePartitions, parseJsonQuery, partitionedParquetOutputEntries, planFiles, planParquetTaskWorkUnits, planRowGroups, planRowGroupsFromMetadata, predicateSelection, pruneFilesWithIndex, readControlSignal, readIcebergParquetDeletes, readOutputManifest, readParquetColumnBatches, readParquetMetadata, readParquetObjectBatches, readParquetObjects, rejectUnsupportedParquetSchema, requireGeoBackend, restoreVectorAggregateStates, restoreVectorGroupByState, rowGroupMayMatch, rowGroupMustMatch, scalarVectorValue, scanBatches, scanParquetTaskBatches, scanParquetTaskColumnBatches, scanPlannedIcebergRows, scanRows, selectedRowCount, selectedRowIndices, serializeAggregateOperatorState, serializeSortOperatorState, serializeTopKOperatorState, setGeoBackend, signPaginationToken, snapshotVectorAggregateStates, snapshotVectorGroupByState, stableStringify, sub, throwIfAborted, timestampEpochForUnit, timestampFromEpoch, timestampToIsoString, timestampValueFromIso, toGeometry, transitionTaskCheckpoint, tryPredicateSelection, updateVectorAggregateStateValue, updateVectorAggregateStates, updateVectorGroupAggregateValue, updateVectorGroupByState, vectorAggregateBatch, vectorFromValues, vectorGroupByBatch, vectorHashJoin, vectorLength, vectorOrderByBatch, vectorProjectBatch, vectorSortIndices, vectorTopKBatch, vectorTopKIndices, vectorValue, verifyPaginationToken, withObjectStoreReadControls, writeOutputManifest, writeParquet, writePartitionedParquet, writePartitionedParquetTask };