lakeql 0.1.2 → 0.1.8

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,309 @@ 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
+ interface ObjectStoreUriAuthority {
390
+ scheme: string;
391
+ authority: string;
392
+ prefix?: string;
393
+ }
394
+ declare function uriObjectStore(store: ConditionalObjectStore, authorities: ObjectStoreUriAuthority | readonly ObjectStoreUriAuthority[]): ConditionalObjectStore;
395
+ declare function uriObjectStore(store: ObjectStore, authorities: ObjectStoreUriAuthority | readonly ObjectStoreUriAuthority[]): ObjectStore;
396
+ declare function withObjectStoreReadControls(store: ObjectStore, controls: ObjectStoreReadControls): ObjectStore;
397
+ declare function readControlSignal(controls: ObjectStoreReadControls): AbortSignal | undefined;
398
+ declare function throwIfAborted(signal: AbortSignal | undefined): void;
399
+
400
+ interface TaskManifestTask {
401
+ id: string;
402
+ input: TaskInput;
403
+ outputRole: "rows" | "data-file" | "manifest";
404
+ }
405
+ interface TaskManifest {
406
+ version: 1;
407
+ jobId: string;
408
+ planFingerprint: string;
409
+ snapshot: string;
410
+ tasks: TaskManifestTask[];
411
+ }
412
+ interface OutputManifestEntry {
413
+ taskId: string;
414
+ outputPath: string;
415
+ partitionValues: Record<string, string>;
416
+ rowCount: number;
417
+ byteSize: number;
418
+ contentHash?: string;
419
+ etag?: string;
420
+ iceberg?: {
421
+ recordCount: number;
422
+ fileSizeInBytes: number;
423
+ partitionValues: Record<string, string>;
424
+ };
425
+ }
426
+ interface OutputManifest {
427
+ version: 1;
428
+ jobId: string;
429
+ planFingerprint: string;
430
+ entries: OutputManifestEntry[];
431
+ }
432
+ type TaskState = "planned" | "running" | "output-written" | "manifest-recorded" | "complete";
433
+ interface TaskCheckpoint {
434
+ taskId: string;
435
+ state: TaskState;
436
+ idempotencyKey: string;
437
+ updatedAtMs: number;
438
+ output?: OutputManifestEntry;
439
+ outputs?: OutputManifestEntry[];
440
+ }
441
+ interface CheckpointAdapter {
442
+ get(taskId: string): Promise<TaskCheckpoint | undefined>;
443
+ put(checkpoint: TaskCheckpoint): Promise<void>;
444
+ list(jobId?: string): AsyncIterable<TaskCheckpoint>;
445
+ }
446
+ interface TaskTransitionInput {
447
+ taskId: string;
448
+ nextState: TaskState;
449
+ idempotencyKey: string;
450
+ nowMs: number;
451
+ staleTimeoutMs?: number;
452
+ output?: OutputManifestEntry;
453
+ outputs?: OutputManifestEntry[];
454
+ }
455
+ interface BookmarkPosition {
456
+ fileIndex: number;
457
+ rowGroup: number;
458
+ rowOffset: number;
459
+ taskId?: string;
460
+ outputManifestCursor?: number;
461
+ }
462
+ interface BookmarkInit {
463
+ planFingerprint: string;
464
+ snapshot: string;
465
+ query?: BookmarkQuery;
466
+ position: BookmarkPosition;
467
+ writeState?: Bookmark["writeState"];
468
+ operatorState?: Bookmark["operatorState"];
469
+ }
470
+ declare function createTaskManifest(input: {
471
+ jobId: string;
472
+ snapshot?: string;
473
+ tasks: TaskInput[];
474
+ outputRole?: TaskManifestTask["outputRole"];
475
+ }): TaskManifest;
476
+ declare function createOutputManifest(input: {
477
+ jobId: string;
478
+ planFingerprint: string;
479
+ entries: OutputManifestEntry[];
480
+ }): OutputManifest;
481
+ declare function createOutputManifestFromCheckpoints(input: {
482
+ jobId: string;
483
+ planFingerprint: string;
484
+ checkpoints: CheckpointAdapter;
485
+ }): Promise<OutputManifest>;
486
+ declare function writeOutputManifest(store: ObjectStore, path: string, manifest: OutputManifest): Promise<{
487
+ path: string;
488
+ byteSize: number;
489
+ etag?: string;
490
+ }>;
491
+ declare function readOutputManifest(store: ObjectStore, path: string): Promise<OutputManifest>;
492
+ declare function createBookmark(init: BookmarkInit): Bookmark;
493
+ declare function assertBookmarkMatches(bookmark: Bookmark, planFingerprint: string): void;
494
+ declare function signPaginationToken(bookmark: Bookmark, secret: string | Uint8Array): Promise<string>;
495
+ declare function verifyPaginationToken(token: string, secret: string | Uint8Array): Promise<Bookmark>;
496
+ declare class MemoryCheckpointAdapter implements CheckpointAdapter {
497
+ private readonly checkpoints;
498
+ private readonly taskJobs;
499
+ get(taskId: string): Promise<TaskCheckpoint | undefined>;
500
+ put(checkpoint: TaskCheckpoint): Promise<void>;
501
+ list(jobId?: string): AsyncIterable<TaskCheckpoint>;
502
+ }
503
+ declare function memoryCheckpointAdapter(): MemoryCheckpointAdapter;
504
+ declare function advanceTaskCheckpoint(checkpoints: CheckpointAdapter, input: TaskTransitionInput): Promise<TaskCheckpoint>;
505
+ declare function transitionTaskCheckpoint(existing: TaskCheckpoint | undefined, input: TaskTransitionInput): TaskCheckpoint;
506
+ declare function stableStringify(value: unknown): string;
507
+ declare function fingerprint(value: unknown): string;
226
508
 
227
509
  interface PredicatePlan {
228
510
  partition: Expr[];
@@ -368,63 +650,6 @@ declare function buildBBoxIndex<T extends Record<string, unknown>>(rows: T[], co
368
650
  maxy: string;
369
651
  }): BBoxIndex;
370
652
 
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
653
  interface QueryBudget {
429
654
  maxFiles?: number;
430
655
  maxBytes?: number;
@@ -455,6 +680,7 @@ interface LakeConfig {
455
680
  store: ObjectStore;
456
681
  scanner: ScanAdapter;
457
682
  sidecarIndex?: SidecarFileIndex[];
683
+ planningCache?: CacheAdapter<ObjectInfo[]>;
458
684
  budget?: QueryBudget;
459
685
  policy?: QueryPolicy;
460
686
  substrate?: RuntimeSubstrate;
@@ -464,6 +690,9 @@ interface LakeConfig {
464
690
  interface ScanOptions {
465
691
  columns?: string[];
466
692
  where?: Expr;
693
+ rowStart?: number;
694
+ rowEnd?: number;
695
+ canStopEarly?: boolean;
467
696
  batchSize: number;
468
697
  stats: QueryStats;
469
698
  budget: QueryBudget;
@@ -472,18 +701,31 @@ interface ScanOptions {
472
701
  }
473
702
  interface ScanAdapter {
474
703
  scan(path: string, options: ScanOptions): AsyncIterable<Row[]>;
704
+ scanColumns?(path: string, options: ScanOptions): AsyncIterable<Batch>;
705
+ scanVectorBatches?(path: string, options: ScanOptions): AsyncIterable<ScanVectorBatch>;
706
+ scanColumnBatches?(path: string, options: ScanOptions): AsyncIterable<ScanColumnBatch>;
475
707
  planTask?(path: string, options: ScanTaskPlanOptions): Promise<ScanTaskPlan>;
476
708
  }
709
+ interface ScanVectorBatch {
710
+ rowOffset: number;
711
+ batch: Batch;
712
+ }
713
+ interface ScanColumnBatch {
714
+ rowOffset: number;
715
+ batch: Batch;
716
+ }
477
717
  interface ScanTaskPlanOptions {
478
718
  columns?: string[];
479
719
  where?: Expr;
480
720
  partitionValues: Record<string, string>;
721
+ object?: ObjectInfo;
481
722
  }
482
723
  interface ScanTaskPlan {
483
724
  rowGroupRanges: {
484
725
  start: number;
485
726
  end: number;
486
727
  }[];
728
+ rowGroupCount?: number;
487
729
  }
488
730
  interface PathQueryInit {
489
731
  source: string;
@@ -519,11 +761,12 @@ interface CsvStreamOptions {
519
761
  /** Column order for CSV output. Defaults to select columns or first-row keys. */
520
762
  columns?: string[];
521
763
  }
522
- type AggregateOp = "count" | "sum" | "avg" | "min" | "max" | "count_distinct" | "approx_count_distinct" | "first" | "last" | "any";
764
+ 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
765
  interface AggregateExpr {
524
766
  op: AggregateOp;
525
767
  column?: string;
526
768
  expr?: Expr;
769
+ quantile?: number;
527
770
  }
528
771
  type AggregateSpec = Record<string, AggregateExpr>;
529
772
  interface AggregateOptions {
@@ -609,12 +852,31 @@ type AggregateStateSnapshot = {
609
852
  op: "avg";
610
853
  sum: number;
611
854
  count: number;
855
+ } | {
856
+ op: "var_samp" | "var_pop" | "stddev_samp" | "stddev_pop";
857
+ count: number;
858
+ mean: number;
859
+ m2: number;
860
+ } | {
861
+ op: "median";
862
+ values: (number | string)[];
863
+ } | {
864
+ op: "quantile";
865
+ quantile: number;
866
+ values: number[];
612
867
  } | {
613
868
  op: "min" | "max";
614
869
  value: AggregateSnapshotValue;
615
870
  } | {
616
871
  op: "count_distinct" | "approx_count_distinct";
617
872
  values: string[];
873
+ } | {
874
+ op: "mode";
875
+ values: {
876
+ key: string;
877
+ value: AggregateSnapshotValue;
878
+ count: number;
879
+ }[];
618
880
  } | {
619
881
  op: "first" | "last" | "any";
620
882
  seen: boolean;
@@ -624,6 +886,7 @@ interface TaskInput {
624
886
  path: string;
625
887
  etag?: string;
626
888
  size?: number;
889
+ rowGroupCount?: number;
627
890
  rowGroupRanges: {
628
891
  start: number;
629
892
  end: number;
@@ -701,6 +964,7 @@ declare class Lake {
701
964
  private readonly queryId;
702
965
  private readonly substrate;
703
966
  private readonly sidecarIndex;
967
+ private readonly planningCache;
704
968
  constructor(config: LakeConfig);
705
969
  path(source: string): QueryBuilder;
706
970
  hive(source: string): QueryBuilder;
@@ -760,6 +1024,7 @@ interface QueryResultConfig extends PathQueryInit {
760
1024
  queryId: string;
761
1025
  metrics?: MetricsHook;
762
1026
  sidecarIndex?: SidecarFileIndex[];
1027
+ planningCache?: CacheAdapter<ObjectInfo[]>;
763
1028
  }
764
1029
  declare class QueryResult {
765
1030
  readonly stats: QueryStats;
@@ -768,6 +1033,9 @@ declare class QueryResult {
768
1033
  rows(): AsyncIterable<Row>;
769
1034
  private matchedRows;
770
1035
  batches(): AsyncIterable<Row[]>;
1036
+ private tryColumnarProjectedBatches;
1037
+ private columnarProjectedBatches;
1038
+ private lateMaterializedLimitRows;
771
1039
  toArray(): Promise<Row[]>;
772
1040
  topKWithState(options?: TopKOptions): Promise<TopKResult>;
773
1041
  sortWithState(options?: SortOptions): Promise<SortResult>;
@@ -778,8 +1046,15 @@ declare class QueryResult {
778
1046
  slice(options: SliceOptions): Promise<SliceResult>;
779
1047
  resumableBatches(options: ResumableBatchOptions): AsyncIterable<SliceResult>;
780
1048
  aggregate(groupColumns: string[], spec: AggregateSpec, options?: AggregateOptions): Promise<Row[]>;
1049
+ private tryColumnarAggregateRows;
1050
+ private tryLateMaterializedAggregateRows;
1051
+ private aggregateMaterializedRows;
781
1052
  aggregateWithState(groupColumns: string[], spec: AggregateSpec, options?: AggregateOptions): Promise<AggregateResult>;
782
1053
  private orderedBatches;
1054
+ private tryColumnarTopKRows;
1055
+ private tryLateMaterializedTopKRows;
1056
+ private materializeRowRefs;
1057
+ private columnBatches;
783
1058
  private collectOrderedMatches;
784
1059
  private collectSortRuns;
785
1060
  explain(): Promise<ExplainResult>;
@@ -798,114 +1073,58 @@ declare function deserializeSortOperatorState(bytes: Uint8Array | SortOperatorSt
798
1073
  declare function parseJsonQuery(input: unknown): PathQueryInit;
799
1074
  declare function parseHivePartitions(path: string): Record<string, string>;
800
1075
 
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[];
1076
+ interface InMemoryTableOptions {
1077
+ maxRows?: number;
1078
+ maxBytes?: number;
855
1079
  }
856
- interface BookmarkPosition {
857
- fileIndex: number;
858
- rowGroup: number;
859
- rowOffset: number;
860
- taskId?: string;
861
- outputManifestCursor?: number;
1080
+ interface InMemoryLakeOptions extends Omit<LakeConfig, "store" | "scanner" | "sidecarIndex">, InMemoryTableOptions {
862
1081
  }
863
- interface BookmarkInit {
864
- planFingerprint: string;
865
- snapshot: string;
866
- query?: BookmarkQuery;
867
- position: BookmarkPosition;
868
- writeState?: Bookmark["writeState"];
869
- operatorState?: Bookmark["operatorState"];
1082
+ declare class InMemoryRowsScanner implements ScanAdapter {
1083
+ private readonly tables;
1084
+ constructor(tables: Record<string, readonly Row[]>, options?: InMemoryTableOptions);
1085
+ scan(path: string, options: ScanOptions): AsyncIterable<Row[]>;
1086
+ planTask(path: string): Promise<{
1087
+ rowGroupRanges: {
1088
+ start: number;
1089
+ end: number;
1090
+ }[];
1091
+ }>;
1092
+ tableInfo(path: string): ObjectInfo;
1093
+ listTables(prefix: string, options?: ListOptions): ObjectInfo[];
1094
+ private table;
870
1095
  }
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>;
1096
+ declare class InMemoryRowsStore implements ObjectStore {
1097
+ private readonly scanner;
1098
+ constructor(scanner: InMemoryRowsScanner);
1099
+ get(path: string): Promise<Uint8Array | null>;
1100
+ getRange(path: string): Promise<Uint8Array>;
1101
+ put(): Promise<void>;
1102
+ delete(): Promise<void>;
1103
+ list(prefix: string, options?: ListOptions): AsyncIterable<ObjectInfo>;
1104
+ head(path: string): Promise<ObjectHead | null>;
903
1105
  }
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;
1106
+ declare function inMemoryRowsScanner(tables: Record<string, readonly Row[]>, options?: InMemoryTableOptions): InMemoryRowsScanner;
1107
+ declare function createInMemoryLake(tables: Record<string, readonly Row[]>, options?: InMemoryLakeOptions): Lake;
1108
+
1109
+ type JoinType = "inner" | "left" | "semi" | "anti";
1110
+ type JoinKey = string | string[];
1111
+ interface BroadcastJoinOptions {
1112
+ leftKey: JoinKey;
1113
+ rightKey: JoinKey;
1114
+ maxRightRows: number;
1115
+ type?: JoinType;
1116
+ rightPrefix?: string;
1117
+ }
1118
+ interface LookupJoinOptions {
1119
+ leftKey: JoinKey;
1120
+ rightKey: JoinKey;
1121
+ maxRightRows: number;
1122
+ type?: JoinType;
1123
+ rightPrefix?: string;
1124
+ }
1125
+ type LookupJoinFunction = (key: string | number | boolean | bigint | null | (string | number | boolean | bigint | null)[], leftRow: Row) => AsyncIterable<Row> | Iterable<Row> | Promise<AsyncIterable<Row> | Iterable<Row>>;
1126
+ declare function broadcastJoin(left: AsyncIterable<Row> | Iterable<Row>, right: AsyncIterable<Row> | Iterable<Row>, options: BroadcastJoinOptions): Promise<Row[]>;
1127
+ declare function lookupJoin(left: AsyncIterable<Row> | Iterable<Row>, lookup: LookupJoinFunction, options: LookupJoinOptions): Promise<Row[]>;
909
1128
 
910
1129
  /**
911
1130
  * In-memory ObjectStore. The reference implementation of the store
@@ -928,21 +1147,281 @@ declare class MemoryObjectStore implements ObjectStore {
928
1147
  }
929
1148
  declare function memoryStore(): MemoryObjectStore;
930
1149
 
931
- declare const PACKAGE: "@laql/iceberg";
1150
+ interface ObjectStoreCacheOptions {
1151
+ /** Maximum cached object/range bytes retained in memory. Defaults to 64 MiB. */
1152
+ maxBytes?: number;
1153
+ /** Optional time-to-live for cache entries. Entries do not expire by default. */
1154
+ ttlMs?: number;
1155
+ /** How LakeQL should spend the cache budget. Defaults to balanced. */
1156
+ policy?: CachePolicy;
1157
+ }
1158
+ type CachePolicy = "balanced" | "io" | "latency";
1159
+ interface SharedCacheEntry<T> {
1160
+ value: T;
1161
+ bytes: number;
1162
+ }
1163
+ interface SharedCacheSetOptions {
1164
+ priority?: number;
1165
+ }
1166
+ declare class SharedMemoryCache {
1167
+ private readonly maxBytes;
1168
+ private readonly ttlMs;
1169
+ private readonly entries;
1170
+ private cachedBytes;
1171
+ constructor(options?: ObjectStoreCacheOptions);
1172
+ get<T>(key: string): SharedCacheEntry<T> | undefined;
1173
+ set<T>(key: string, value: T, bytes: number, options?: SharedCacheSetOptions): void;
1174
+ delete(key: string): void;
1175
+ deleteWhere(predicate: (value: unknown) => boolean): void;
1176
+ private expiresAt;
1177
+ private evict;
1178
+ private evictKey;
1179
+ }
1180
+ declare function cachedObjectStore(inner: ObjectStore, options?: ObjectStoreCacheOptions, sharedCache?: SharedMemoryCache): ObjectStore;
1181
+
1182
+ interface ObjectStoreJsonCacheOptions {
1183
+ store: ObjectStore;
1184
+ prefix: string;
1185
+ ttlMs?: number;
1186
+ now?: () => number;
1187
+ }
1188
+ declare class ObjectStoreJsonCache<T> implements CacheAdapter<T> {
1189
+ private readonly store;
1190
+ private readonly prefix;
1191
+ private readonly ttlMs;
1192
+ private readonly now;
1193
+ constructor(options: ObjectStoreJsonCacheOptions);
1194
+ get(key: string): Promise<CacheEntry<T> | undefined>;
1195
+ set(key: string, entry: CacheEntry<T>): Promise<void>;
1196
+ delete(key: string): Promise<void>;
1197
+ private pathFor;
1198
+ }
1199
+ declare function objectStoreJsonCache<T>(options: ObjectStoreJsonCacheOptions): CacheAdapter<T>;
1200
+
1201
+ type VectorDistinctAggregateState = {
1202
+ op: "count_distinct" | "approx_count_distinct";
1203
+ values: Set<string>;
1204
+ sortedValues?: string[];
1205
+ sortedRuns?: string[][];
1206
+ memoryBytes: number;
1207
+ };
1208
+
1209
+ type VectorAggregateValue = string | number | boolean | bigint | TimestampValue | null;
1210
+ type VectorAggregateState = {
1211
+ op: "count";
1212
+ count: number;
1213
+ } | {
1214
+ op: "sum";
1215
+ sum: number;
1216
+ } | {
1217
+ op: "avg";
1218
+ sum: number;
1219
+ count: number;
1220
+ } | {
1221
+ op: "var_samp" | "var_pop" | "stddev_samp" | "stddev_pop";
1222
+ count: number;
1223
+ mean: number;
1224
+ m2: number;
1225
+ } | {
1226
+ op: "median";
1227
+ values: (number | string)[];
1228
+ memoryBytes: number;
1229
+ } | {
1230
+ op: "quantile";
1231
+ quantile: number;
1232
+ values: number[];
1233
+ memoryBytes: number;
1234
+ } | {
1235
+ op: "min" | "max";
1236
+ value: VectorAggregateValue;
1237
+ } | VectorDistinctAggregateState | {
1238
+ op: "mode";
1239
+ values: Map<string, {
1240
+ value: Exclude<VectorAggregateValue, null>;
1241
+ count: number;
1242
+ }>;
1243
+ memoryBytes: number;
1244
+ } | {
1245
+ op: "first";
1246
+ seen: boolean;
1247
+ value: VectorAggregateValue;
1248
+ } | {
1249
+ op: "last";
1250
+ seen: boolean;
1251
+ value: VectorAggregateValue;
1252
+ } | {
1253
+ op: "any";
1254
+ seen: boolean;
1255
+ value: VectorAggregateValue;
1256
+ };
1257
+ type VectorAggregateStates = Record<string, VectorAggregateState>;
1258
+ type VectorAggregateSnapshotValue = string | number | boolean | null | {
1259
+ type: "bigint";
1260
+ value: string;
1261
+ } | {
1262
+ type: "timestamp";
1263
+ epochNanoseconds: string;
1264
+ unit: TimestampValue["unit"];
1265
+ isAdjustedToUTC: boolean;
1266
+ };
1267
+ type VectorAggregateStateSnapshot = {
1268
+ op: "count";
1269
+ count: number;
1270
+ } | {
1271
+ op: "sum";
1272
+ sum: number;
1273
+ } | {
1274
+ op: "avg";
1275
+ sum: number;
1276
+ count: number;
1277
+ } | {
1278
+ op: "var_samp" | "var_pop" | "stddev_samp" | "stddev_pop";
1279
+ count: number;
1280
+ mean: number;
1281
+ m2: number;
1282
+ } | {
1283
+ op: "median";
1284
+ values: (number | string)[];
1285
+ } | {
1286
+ op: "quantile";
1287
+ quantile: number;
1288
+ values: number[];
1289
+ } | {
1290
+ op: "min" | "max";
1291
+ value: VectorAggregateSnapshotValue;
1292
+ } | {
1293
+ op: "count_distinct" | "approx_count_distinct";
1294
+ values: string[];
1295
+ } | {
1296
+ op: "mode";
1297
+ values: {
1298
+ key: string;
1299
+ value: VectorAggregateSnapshotValue;
1300
+ count: number;
1301
+ }[];
1302
+ } | {
1303
+ op: "first";
1304
+ seen: boolean;
1305
+ value: VectorAggregateSnapshotValue;
1306
+ } | {
1307
+ op: "last";
1308
+ seen: boolean;
1309
+ value: VectorAggregateSnapshotValue;
1310
+ } | {
1311
+ op: "any";
1312
+ seen: boolean;
1313
+ value: VectorAggregateSnapshotValue;
1314
+ };
1315
+ type VectorAggregateStateSnapshots = Record<string, VectorAggregateStateSnapshot>;
1316
+ interface VectorAggregateOptions {
1317
+ budget?: QueryBudget;
1318
+ }
1319
+ declare function createVectorAggregateStates(spec: AggregateSpec, options?: VectorAggregateOptions): VectorAggregateStates;
1320
+ declare function updateVectorAggregateStates(states: VectorAggregateStates, spec: AggregateSpec, batch: Batch, selection?: Selection, options?: VectorAggregateOptions): void;
1321
+ declare function mergeVectorAggregateStates(target: VectorAggregateStates, source: VectorAggregateStates, options?: VectorAggregateOptions): void;
1322
+ declare function mergeVectorAggregateStateSnapshots(target: VectorAggregateStates, snapshots: VectorAggregateStateSnapshots, options?: VectorAggregateOptions): void;
1323
+ declare function finalizeVectorAggregateStates(states: VectorAggregateStates): Record<string, unknown>;
1324
+ declare function snapshotVectorAggregateStates(states: VectorAggregateStates): VectorAggregateStateSnapshots;
1325
+ declare function restoreVectorAggregateStates(snapshots: VectorAggregateStateSnapshots, options?: VectorAggregateOptions): VectorAggregateStates;
1326
+ declare function vectorAggregateBatch(spec: AggregateSpec, batch: Batch, selection?: Selection, options?: VectorAggregateOptions): Record<string, unknown>;
1327
+ declare function updateVectorAggregateStateValue(state: VectorAggregateState, value: VectorAggregateValue, options?: VectorAggregateOptions): void;
1328
+
1329
+ interface VectorGroupByOptions extends VectorAggregateOptions {
1330
+ maxGroups?: number;
1331
+ }
1332
+ interface VectorGroupByState {
1333
+ readonly keys: readonly string[];
1334
+ readonly spec: AggregateSpec;
1335
+ readonly groups: Map<string, VectorGroup>;
1336
+ }
1337
+ interface VectorGroup {
1338
+ keyValues: Scalar[];
1339
+ states: VectorAggregateStates;
1340
+ }
1341
+ type VectorGroupBySnapshotValue = string | number | boolean | null | {
1342
+ type: "bigint";
1343
+ value: string;
1344
+ } | {
1345
+ type: "timestamp";
1346
+ epochNanoseconds: string;
1347
+ unit: TimestampValue["unit"];
1348
+ isAdjustedToUTC: boolean;
1349
+ };
1350
+ interface VectorGroupByGroupSnapshot {
1351
+ keyValues: VectorGroupBySnapshotValue[];
1352
+ states: VectorAggregateStateSnapshots;
1353
+ }
1354
+ interface VectorGroupByStateSnapshot {
1355
+ groups: VectorGroupByGroupSnapshot[];
1356
+ }
1357
+ declare function createVectorGroupByState(keys: readonly string[], spec: AggregateSpec): VectorGroupByState;
1358
+ declare function updateVectorGroupByState(state: VectorGroupByState, batch: Batch, selection?: Selection, options?: VectorGroupByOptions): number;
1359
+ declare function getOrCreateVectorGroup(state: VectorGroupByState, batch: Batch, index: number, options?: VectorGroupByOptions): VectorGroup;
1360
+ declare function updateVectorGroupAggregateValue(group: VectorGroup, alias: string, value: VectorAggregateValue, options?: VectorAggregateOptions): void;
1361
+ declare function enforceVectorGroupByBudget(state: VectorGroupByState, budget?: QueryBudget): void;
1362
+ declare function finalizeVectorGroupByRows(state: VectorGroupByState): Row[];
1363
+ declare function finalizeVectorGroupByBatch(state: VectorGroupByState): Batch;
1364
+ declare function snapshotVectorGroupByState(state: VectorGroupByState): VectorGroupByStateSnapshot;
1365
+ declare function restoreVectorGroupByState(keys: readonly string[], spec: AggregateSpec, snapshot: VectorGroupByStateSnapshot, options?: VectorGroupByOptions): VectorGroupByState;
1366
+ declare function mergeVectorGroupByStates(target: VectorGroupByState, source: VectorGroupByState, options?: VectorGroupByOptions): void;
1367
+ declare function vectorGroupByBatch(keys: readonly string[], spec: AggregateSpec, batch: Batch, selection?: Selection, options?: VectorGroupByOptions): Batch;
1368
+
1369
+ interface VectorHashJoinOptions {
1370
+ leftKey: JoinKey;
1371
+ rightKey: JoinKey;
1372
+ maxRightRows: number;
1373
+ type?: JoinType;
1374
+ rightPrefix?: string;
1375
+ leftSelection?: Selection;
1376
+ rightSelection?: Selection;
1377
+ }
1378
+ declare function vectorHashJoin(left: Batch, right: Batch, options: VectorHashJoinOptions): Batch;
1379
+
1380
+ type VectorProjectionSpec = Record<string, Expr>;
1381
+ declare function vectorProjectBatch(batch: Batch, select?: readonly string[], projections?: VectorProjectionSpec): Batch;
1382
+
1383
+ interface VectorTopKOptions {
1384
+ offset?: number;
1385
+ limit: number;
1386
+ }
1387
+ declare function vectorOrderByBatch(batch: Batch, orderBy: readonly OrderByTerm[], selection?: Selection): Batch;
1388
+ declare function vectorTopKBatch(batch: Batch, orderBy: readonly OrderByTerm[], options: VectorTopKOptions, selection?: Selection): Batch;
1389
+ declare function vectorSortIndices(batch: Batch, orderBy: readonly OrderByTerm[], selection?: Selection): number[];
1390
+ declare function vectorTopKIndices(batch: Batch, orderBy: readonly OrderByTerm[], topK: number, selection?: Selection): number[];
1391
+ declare function gatherBatch(batch: Batch, indices: readonly number[]): Batch;
1392
+ declare function concatBatches(batches: readonly Batch[]): Batch;
1393
+
1394
+ interface WorkUnitFanInOptions<Input, Partial, Accumulator> {
1395
+ inputs: readonly Input[];
1396
+ initial: Accumulator;
1397
+ maxConcurrentTasks?: number;
1398
+ maxBufferedPartials?: number;
1399
+ run(input: Input, index: number): Promise<Partial>;
1400
+ reduce(accumulator: Accumulator, partial: Partial, input: Input, index: number): void | Promise<void>;
1401
+ boundary?(partial: Partial, input: Input, index: number): Partial | Promise<Partial>;
1402
+ }
1403
+ declare function fanInWorkUnits<Input, Partial, Accumulator>(options: WorkUnitFanInOptions<Input, Partial, Accumulator>): Promise<Accumulator>;
1404
+ declare function jsonWorkUnitBoundary<T>(value: T): T;
1405
+
1406
+ declare const PACKAGE: "lakeql-iceberg";
932
1407
  type IcebergReadMode = "strict" | "ignore-deletes" | "ignore-unsupported-deletes";
933
1408
  interface LoadIcebergTableOptions extends ObjectStoreReadControls {
934
1409
  store: ObjectStore;
935
1410
  metadataPath: string;
1411
+ cache?: CacheAdapter<unknown>;
936
1412
  }
937
1413
  interface LoadIcebergTableFromObjectStoreOptions extends ObjectStoreReadControls {
938
1414
  store: ObjectStore;
939
1415
  tableLocation: string;
1416
+ cache?: CacheAdapter<unknown>;
940
1417
  }
941
1418
  interface IcebergRestCatalogOptions {
942
1419
  url: string;
943
1420
  namespace: string | string[];
944
1421
  table: string;
1422
+ warehouse?: string;
945
1423
  prefix?: string;
1424
+ accessDelegation?: readonly IcebergRestAccessDelegation[];
946
1425
  token?: string;
947
1426
  fetch?: typeof fetch;
948
1427
  }
@@ -960,7 +1439,34 @@ interface IcebergNessieCatalogOptions {
960
1439
  token?: string;
961
1440
  }
962
1441
  interface LoadIcebergTableFromRestOptions extends IcebergRestCatalogOptions, ObjectStoreReadControls {
963
- store: ObjectStore;
1442
+ store?: ObjectStore;
1443
+ storeFactory?: (context: IcebergRestLoadContext) => ObjectStore | Promise<ObjectStore>;
1444
+ cache?: CacheAdapter<unknown>;
1445
+ }
1446
+ type IcebergRestAccessDelegation = "vended-credentials" | "remote-signing" | (string & {});
1447
+ interface IcebergRestStorageCredential {
1448
+ prefix: string;
1449
+ config: Record<string, string>;
1450
+ }
1451
+ interface IcebergRestLoadTableOptions {
1452
+ ifNoneMatch?: string;
1453
+ snapshots?: "all" | "refs";
1454
+ }
1455
+ interface IcebergRestLoadTableResult {
1456
+ "metadata-location": string;
1457
+ metadata: MetadataFile;
1458
+ config: Record<string, string>;
1459
+ "storage-credentials": IcebergRestStorageCredential[];
1460
+ etag: string | null;
1461
+ }
1462
+ interface IcebergRestCatalogConfig {
1463
+ defaults: Record<string, string>;
1464
+ overrides: Record<string, string>;
1465
+ endpoints?: string[];
1466
+ "idempotency-key-lifetime"?: string;
1467
+ }
1468
+ interface IcebergRestLoadContext extends IcebergRestLoadTableResult {
1469
+ catalog: IcebergRestCatalog;
964
1470
  }
965
1471
  interface PlanIcebergFilesOptions {
966
1472
  snapshotId?: number;
@@ -996,9 +1502,12 @@ interface IcebergCommitCatalog {
996
1502
  commitAppend(input: IcebergCommitInput): Promise<boolean | IcebergCommitResult>;
997
1503
  }
998
1504
  interface IcebergCatalog extends IcebergCommitCatalog {
999
- loadTable(store: ObjectStore): Promise<IcebergTable>;
1505
+ loadTable(store: ObjectStore, options?: IcebergLoadTableOptions): Promise<IcebergTable>;
1000
1506
  listTables(): Promise<IcebergTableIdentifier[]>;
1001
1507
  }
1508
+ interface IcebergLoadTableOptions extends ObjectStoreReadControls {
1509
+ cache?: CacheAdapter<unknown>;
1510
+ }
1002
1511
  interface IcebergTableIdentifier {
1003
1512
  namespace: string[];
1004
1513
  name: string;
@@ -1167,18 +1676,28 @@ declare class IcebergRestCatalog implements IcebergCatalog {
1167
1676
  private readonly url;
1168
1677
  private readonly namespace;
1169
1678
  private readonly table;
1170
- private readonly prefix;
1679
+ private readonly explicitPrefix;
1680
+ private readonly warehouse;
1681
+ private readonly accessDelegation;
1171
1682
  private readonly token;
1172
1683
  private readonly fetchFn;
1684
+ private configPromise;
1685
+ private prefixPromise;
1173
1686
  constructor(options: IcebergRestCatalogOptions);
1174
- loadTable(store: ObjectStore): Promise<IcebergTable>;
1687
+ loadTable(store: ObjectStore, options?: IcebergLoadTableOptions): Promise<IcebergTable>;
1688
+ loadTableResult(options?: IcebergRestLoadTableOptions): Promise<IcebergRestLoadTableResult>;
1689
+ loadConfig(): Promise<IcebergRestCatalogConfig>;
1175
1690
  listTables(): Promise<IcebergTableIdentifier[]>;
1176
1691
  commitAppend(input: IcebergCommitInput): Promise<IcebergCommitResult>;
1177
1692
  private requestJson;
1693
+ private requestJsonResponse;
1178
1694
  private headers;
1179
1695
  private tableUrl;
1180
1696
  private namespaceTablesUrl;
1181
1697
  private namespaceTableSegments;
1698
+ private prefixParts;
1699
+ private computePrefixParts;
1700
+ private configUrl;
1182
1701
  }
1183
1702
  declare function icebergRestCatalog(options: IcebergRestCatalogOptions): IcebergRestCatalog;
1184
1703
  declare class IcebergUnsupportedCatalog implements IcebergCatalog {
@@ -1186,7 +1705,7 @@ declare class IcebergUnsupportedCatalog implements IcebergCatalog {
1186
1705
  private readonly namespace;
1187
1706
  private readonly table;
1188
1707
  constructor(catalog: string, namespace: string | string[], table: string);
1189
- loadTable(_store: ObjectStore): Promise<IcebergTable>;
1708
+ loadTable(_store: ObjectStore, _options?: IcebergLoadTableOptions): Promise<IcebergTable>;
1190
1709
  listTables(): Promise<IcebergTableIdentifier[]>;
1191
1710
  commitAppend(_input: IcebergCommitInput): Promise<IcebergCommitResult>;
1192
1711
  private unsupported;
@@ -1199,6 +1718,20 @@ declare function loadIcebergTableFromRest(options: LoadIcebergTableFromRestOptio
1199
1718
  declare function applyIcebergDeletes(options: ApplyIcebergDeletesOptions): Row[];
1200
1719
  declare function scanPlannedIcebergRows(options: ScanPlannedIcebergRowsOptions): AsyncIterable<Row[]>;
1201
1720
 
1721
+ declare class DecodedColumnCache {
1722
+ private readonly cache;
1723
+ private readonly options;
1724
+ constructor(cache: SharedMemoryCache, options: ObjectStoreCacheOptions);
1725
+ get(key: string): Batch | undefined;
1726
+ set(key: string, batch: Batch): void;
1727
+ getVector(key: string): Vector | undefined;
1728
+ setVector(key: string, vector: Vector): boolean;
1729
+ getValue<T>(key: string): T | undefined;
1730
+ setValue<T>(key: string, value: T, bytes: number): void;
1731
+ private shouldAdmitDecodedVector;
1732
+ private shouldAdmitDecodedWorkProduct;
1733
+ }
1734
+
1202
1735
  interface ReadParquetOptions {
1203
1736
  /** Columns to project; all columns when omitted. */
1204
1737
  columns?: string[];
@@ -1208,14 +1741,34 @@ interface ReadParquetOptions {
1208
1741
  interface ReadParquetBatchOptions extends ReadParquetOptions {
1209
1742
  batchSize?: number;
1210
1743
  where?: Expr;
1744
+ canStopEarly?: boolean;
1745
+ stats?: QueryStats;
1746
+ decodedColumnCache?: DecodedColumnCache;
1747
+ decodedColumnCacheKey?: string;
1211
1748
  }
1212
1749
  interface ParquetRowBatch {
1213
1750
  rowOffset: number;
1214
1751
  rows: Row[];
1215
1752
  }
1216
- interface PlanParquetRowGroupsOptions {
1217
- where?: Expr;
1753
+ interface ParquetColumnBatch {
1754
+ rowOffset: number;
1755
+ batch: Batch;
1756
+ residualPredicateSatisfied?: boolean;
1757
+ }
1758
+ type ParquetMetadata = Awaited<ReturnType<typeof parquetMetadataAsync>>;
1759
+ interface StoreAsyncBuffer {
1760
+ byteLength: number;
1761
+ etag?: string;
1762
+ slice(start: number, end?: number): Promise<ArrayBuffer>;
1763
+ }
1764
+
1765
+ interface RangeCacheOptions {
1766
+ maxBytes: number;
1767
+ maxEntryBytes?: number;
1768
+ sharedCache?: SharedMemoryCache;
1769
+ cacheOptions?: ObjectStoreCacheOptions;
1218
1770
  }
1771
+
1219
1772
  interface PlannedParquetRowGroup {
1220
1773
  index: number;
1221
1774
  rowStart: number;
@@ -1232,6 +1785,91 @@ interface ParquetRowGroupPlan {
1232
1785
  end: number;
1233
1786
  }[];
1234
1787
  }
1788
+ declare function planRowGroupsFromMetadata(metadata: ParquetMetadata, where: Expr | undefined): ParquetRowGroupPlan;
1789
+
1790
+ interface ScanParquetTaskOptions {
1791
+ batchSize?: number;
1792
+ stats?: QueryStats;
1793
+ metadataCache?: CacheAdapter<ParquetMetadata>;
1794
+ }
1795
+ interface PlanParquetTaskWorkUnitsOptions {
1796
+ maxRowGroupsPerTask?: number;
1797
+ maxRowsPerTask?: number;
1798
+ metadataCache?: CacheAdapter<ParquetMetadata>;
1799
+ }
1800
+ interface AggregateParquetTaskOptions extends ScanParquetTaskOptions {
1801
+ budget?: QueryBudget;
1802
+ }
1803
+ interface AggregateParquetTasksOptions extends AggregateParquetTaskOptions {
1804
+ maxConcurrentTasks?: number;
1805
+ maxBufferedPartials?: number;
1806
+ preserveTaskBoundaries?: boolean;
1807
+ partialBoundary?(partial: VectorAggregateStateSnapshots, task: TaskInput, index: number): VectorAggregateStateSnapshots | Promise<VectorAggregateStateSnapshots>;
1808
+ }
1809
+ interface AggregateParquetGroupTaskOptions extends AggregateParquetTaskOptions {
1810
+ maxGroups?: number;
1811
+ }
1812
+ interface AggregateParquetGroupTasksOptions extends AggregateParquetGroupTaskOptions {
1813
+ maxConcurrentTasks?: number;
1814
+ maxBufferedPartials?: number;
1815
+ preserveTaskBoundaries?: boolean;
1816
+ orderBy?: OrderByTerm[];
1817
+ limit?: number;
1818
+ offset?: number;
1819
+ partialBoundary?(partial: VectorGroupByStateSnapshot, task: TaskInput, index: number): VectorGroupByStateSnapshot | Promise<VectorGroupByStateSnapshot>;
1820
+ }
1821
+
1822
+ declare function aggregateParquetTask(store: ObjectStore, task: TaskInput, spec: AggregateSpec, options?: AggregateParquetTaskOptions): Promise<VectorAggregateStateSnapshots>;
1823
+ declare function aggregateParquetTasks(store: ObjectStore, tasks: TaskInput[], spec: AggregateSpec, options?: AggregateParquetTasksOptions): Promise<Record<string, unknown>>;
1824
+ declare function aggregateParquetGroupTask(store: ObjectStore, task: TaskInput, groupColumns: readonly string[], spec: AggregateSpec, options?: AggregateParquetGroupTaskOptions): Promise<VectorGroupByStateSnapshot>;
1825
+ declare function aggregateParquetGroupTasks(store: ObjectStore, tasks: TaskInput[], groupColumns: readonly string[], spec: AggregateSpec, options?: AggregateParquetGroupTasksOptions): Promise<Row[]>;
1826
+ declare function aggregateParquetGroupTasksBatch(store: ObjectStore, tasks: TaskInput[], groupColumns: readonly string[], spec: AggregateSpec, options?: AggregateParquetGroupTasksOptions): Promise<Batch>;
1827
+
1828
+ /** @internal Exposed for pruning tests; not part of the stable public API. */
1829
+ declare function rowGroupMayMatch(rowGroup: RowGroup, expr: Expr | undefined): boolean;
1830
+ /** @internal Exposed for scan/aggregate tests; not part of the stable public API. */
1831
+ declare function rowGroupMustMatch(rowGroup: RowGroup, expr: Expr | undefined): boolean;
1832
+
1833
+ declare class ParquetScanAdapter implements ScanAdapter {
1834
+ private readonly store;
1835
+ private readonly defaultBatchSize;
1836
+ private readonly metadataCache;
1837
+ private readonly decodedColumnCache;
1838
+ private readonly scanRangeCache;
1839
+ constructor(store: ObjectStore, options?: {
1840
+ batchSize?: number;
1841
+ metadataCache?: CacheAdapter<ParquetMetadata>;
1842
+ decodedColumnCache?: DecodedColumnCache;
1843
+ scanRangeCache?: RangeCacheOptions;
1844
+ });
1845
+ scan(path: string, options: ScanOptions): AsyncIterable<Row[]>;
1846
+ scanColumns(path: string, options: ScanOptions): AsyncIterable<Batch>;
1847
+ scanColumnBatches(path: string, options: ScanOptions): AsyncIterable<ScanColumnBatch>;
1848
+ scanVectorBatches(path: string, options: ScanOptions): AsyncIterable<ScanVectorBatch>;
1849
+ planTask(path: string, options: ScanTaskPlanOptions): Promise<ScanTaskPlan>;
1850
+ private metadata;
1851
+ private scanBuffer;
1852
+ }
1853
+
1854
+ interface RejectUnsupportedParquetSchemaOptions {
1855
+ columns?: readonly string[] | undefined;
1856
+ }
1857
+ declare function rejectUnsupportedParquetSchema(metadata: ParquetMetadata, options?: RejectUnsupportedParquetSchemaOptions): void;
1858
+
1859
+ /**
1860
+ * Bridge an ObjectStore path to hyparquet's AsyncBuffer (length + ranged slice).
1861
+ */
1862
+ declare function asyncBufferFromStore(store: ObjectStore, path: string, options?: ScanOptions | undefined): Promise<StoreAsyncBuffer>;
1863
+
1864
+ declare function scanParquetTaskBatches(store: ObjectStore, task: TaskInput, options?: ScanParquetTaskOptions): AsyncIterable<Row[]>;
1865
+ declare function scanParquetTaskColumnBatches(store: ObjectStore, task: TaskInput, options?: ScanParquetTaskOptions): AsyncIterable<ParquetColumnBatch>;
1866
+ declare function planParquetTaskWorkUnits(store: ObjectStore, task: TaskInput, options: PlanParquetTaskWorkUnitsOptions): Promise<TaskInput[]>;
1867
+ /** Read Parquet footer metadata (row groups, schema, stats). */
1868
+ declare function readParquetMetadata(store: ObjectStore, path: string, metadataCache?: ScanParquetTaskOptions["metadataCache"]): Promise<ParquetMetadata>;
1869
+
1870
+ interface PlanParquetRowGroupsOptions {
1871
+ where?: Expr;
1872
+ }
1235
1873
  type IcebergParquetDeleteFileContent = "position-delete" | "equality-delete" | "deletion-vector";
1236
1874
  interface IcebergParquetDeleteFile {
1237
1875
  content: IcebergParquetDeleteFileContent;
@@ -1315,26 +1953,13 @@ interface PartitionedParquetOutputEntryOptions {
1315
1953
  }
1316
1954
  interface ParquetLakeConfig extends Omit<LakeConfig, "scanner"> {
1317
1955
  batchSize?: number;
1956
+ cache?: ObjectStoreCacheOptions;
1318
1957
  metadataCache?: CacheAdapter<ParquetMetadata>;
1958
+ scanRangeCache?: RangeCacheOptions;
1319
1959
  }
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
1960
  declare function readParquetObjects(store: ObjectStore, path: string, options?: ReadParquetOptions): Promise<Record<string, unknown>[]>;
1335
1961
  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>;
1962
+ declare function readParquetColumnBatches(store: ObjectStore, path: string, options?: ReadParquetBatchOptions): AsyncIterable<ParquetColumnBatch>;
1338
1963
  declare function planRowGroups(store: ObjectStore, path: string, options?: PlanParquetRowGroupsOptions): Promise<ParquetRowGroupPlan>;
1339
1964
  declare function readIcebergParquetDeletes(store: ObjectStore, deleteFile: IcebergParquetDeleteFile): Promise<DecodedIcebergParquetDeletes>;
1340
1965
  declare function writeParquet(store: ObjectStore, path: string, options: WriteParquetOptions): Promise<{
@@ -1346,27 +1971,12 @@ declare function writePartitionedParquet(store: ObjectStore, prefix: string, opt
1346
1971
  declare function writePartitionedParquetTask(store: ObjectStore, prefix: string, options: WritePartitionedParquetTaskOptions): Promise<WritePartitionedParquetTaskResult>;
1347
1972
  declare function createParquetTableAs(store: ObjectStore, prefix: string, options: CreateParquetTableAsOptions): Promise<CreateParquetTableAsResult>;
1348
1973
  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
1974
  type InsertValue = string | number | boolean | bigint | null;
1364
1975
  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
1976
  declare function parquetScanner(store: ObjectStore, options?: {
1368
1977
  batchSize?: number;
1369
1978
  metadataCache?: CacheAdapter<ParquetMetadata>;
1979
+ decodedColumnCache?: DecodedColumnCache;
1370
1980
  }): ScanAdapter;
1371
1981
  declare function createParquetLake(config: ParquetLakeConfig): Lake;
1372
1982
 
@@ -1416,4 +2026,4 @@ declare function planFiles(table: EngineTable, options?: PlanIcebergFilesOptions
1416
2026
  declare function scanBatches(plan: EngineFilePlan, options?: ScanEngineOptions): AsyncIterable<ScanBatch>;
1417
2027
  declare function scanRows(plan: EngineFilePlan, options?: ScanEngineOptions): AsyncIterable<Row>;
1418
2028
 
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 };
2029
+ 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 IcebergLoadTableOptions, type IcebergNessieCatalogOptions, type IcebergParquetDeleteFile, type IcebergParquetDeleteFileContent, type IcebergPartitionField, type IcebergPartitionSpec, type IcebergPlan, type IcebergPositionDelete, type IcebergReadMode, type IcebergRestAccessDelegation, IcebergRestCatalog, type IcebergRestCatalogConfig, type IcebergRestCatalogOptions, type IcebergRestLoadContext, type IcebergRestLoadTableOptions, type IcebergRestLoadTableResult, type IcebergRestStorageCredential, 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, ObjectStoreJsonCache, type ObjectStoreJsonCacheOptions, type ObjectStoreReadControls, type ObjectStoreUriAuthority, 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, objectStoreJsonCache, 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, uriObjectStore, vectorAggregateBatch, vectorFromValues, vectorGroupByBatch, vectorHashJoin, vectorLength, vectorOrderByBatch, vectorProjectBatch, vectorSortIndices, vectorTopKBatch, vectorTopKIndices, vectorValue, verifyPaginationToken, withObjectStoreReadControls, writeOutputManifest, writeParquet, writePartitionedParquet, writePartitionedParquetTask };