lakeql 0.1.7 → 0.1.9
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/README.md +18 -5
- package/dist/bin.js +816 -23
- package/dist/{chunk-BFLGC6Y5.js → chunk-2XZJK7EF.js} +398 -71
- package/dist/{chunk-TFD5RFKB.js → chunk-4VJQ56HF.js} +424 -4
- package/dist/{chunk-RZL45ZSN.js → chunk-6XXXYVXT.js} +4048 -3341
- package/dist/chunk-ZVHJD6R3.js +1175 -0
- package/dist/cloudflare.d.ts +20 -3
- package/dist/cloudflare.js +105 -5
- package/dist/{geo-backend-TSQJWAAB.js → geo-backend-MY6MET3L.js} +1 -1
- package/dist/index.d.ts +502 -226
- package/dist/index.js +4 -3
- package/dist/node.d.ts +28 -5
- package/dist/node.js +220 -25
- package/dist/window-backend-DIMZN7EZ.js +905 -0
- package/package.json +10 -8
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export { IcebergRestCatalog, IcebergTable, IcebergUnsupportedCatalog, InMemoryRowsScanner, InMemoryRowsStore, ObjectStoreIcebergCommitCatalog, PACKAGE, applyIcebergDeletes, createInMemoryLake, icebergGlueCatalog, icebergNessieCatalog, icebergRestCatalog, inMemoryRowsScanner, loadIcebergTable, loadIcebergTableFromObjectStore, loadIcebergTableFromRest, loadTable, planFiles, scanBatches, scanPlannedIcebergRows, scanRows, vectorHashJoin } from './chunk-
|
|
2
|
-
export { AggregationBuilder, CacheApiCache, Lake, MemoryCache,
|
|
3
|
-
export {
|
|
1
|
+
export { IcebergRestCatalog, IcebergTable, IcebergUnsupportedCatalog, InMemoryRowsScanner, InMemoryRowsStore, ObjectStoreIcebergCommitCatalog, ObjectStoreJsonCache, PACKAGE, applyIcebergDeletes, createInMemoryLake, icebergGlueCatalog, icebergNessieCatalog, icebergRestCatalog, inMemoryRowsScanner, loadIcebergTable, loadIcebergTableFromObjectStore, loadIcebergTableFromRest, loadTable, objectStoreJsonCache, planFiles, scanBatches, scanPlannedIcebergRows, scanRows, vectorHashJoin } from './chunk-2XZJK7EF.js';
|
|
2
|
+
export { AggregationBuilder, CacheApiCache, Lake, MemoryCache, MemoryObjectStore, MemorySpillAdapter, ParquetScanAdapter, QueryBuilder, QueryResult, ResumedQuery, SharedMemoryCache, add, aggregateParquetGroupTask, aggregateParquetGroupTasks, aggregateParquetGroupTasksBatch, aggregateParquetTask, aggregateParquetTasks, and, asyncBufferFromStore, batchExprValues, batchFromColumns, batchFromVectors, bboxMayIntersect, between, broadcastJoin, buildBBoxIndex, buildMinMaxIndex, cacheApiCache, cachedObjectStore, classifyPredicate, col, concatBatches, createParquetLake as createLake, createParquetLake, createParquetTableAs, createVectorAggregateStates, createVectorGroupByState, deserializeAggregateOperatorState, deserializeSortOperatorState, deserializeTopKOperatorState, deserializeWindowOperatorState, div, enforceVectorGroupByBudget, eq, evaluateWindowWorkUnitPartials, fanInWorkUnits, finalizeVectorAggregateStates, finalizeVectorGroupByBatch, finalizeVectorGroupByRows, fn, gatherBatch, getOrCreateVectorGroup, gt, gte, ilike, isIn, isNotNull, isNull, jsonWorkUnitBoundary, like, lit, lookupJoin, lt, lte, materializeBatchRow, materializeBatchRows, materializeSelectedBatchRows, memoryCache, memorySpillAdapter, memoryStore, mergeVectorAggregateStateSnapshots, mergeVectorAggregateStates, mergeVectorGroupByStates, mod, mul, ne, not, notIn, or, parquetScanner, parseHivePartitions, parseJsonQuery, partitionWindowWorkUnitRows, partitionedParquetOutputEntries, planParquetTaskWorkUnits, planRowGroups, planRowGroupsFromMetadata, predicateSelection, pruneFilesWithIndex, readControlSignal, readIcebergParquetDeletes, readParquetColumnBatches, readParquetMetadata, readParquetObjectBatches, readParquetObjects, rejectUnsupportedParquetSchema, restoreVectorAggregateStates, restoreVectorGroupByState, rowGroupMayMatch, rowGroupMustMatch, scalarVectorValue, scanParquetTaskBatches, scanParquetTaskColumnBatches, selectedRowCount, selectedRowIndices, serializeAggregateOperatorState, serializeSortOperatorState, serializeTopKOperatorState, serializeWindowOperatorState, snapshotVectorAggregateStates, snapshotVectorGroupByState, sub, throwIfAborted, tryPredicateSelection, updateVectorAggregateStateValue, updateVectorAggregateStates, updateVectorGroupAggregateValue, updateVectorGroupByState, uriObjectStore, vectorAggregateBatch, vectorFromValues, vectorGroupByBatch, vectorLength, vectorOrderByBatch, vectorProjectBatch, vectorSortIndices, vectorTopKBatch, vectorTopKIndices, vectorValue, windowOperatorState, windowOperatorStateFromRuns, windowParquetTask, windowParquetTasks, windowPartitionBucket, windowRowsFromState, withObjectStoreReadControls, writeParquet, writePartitionedParquet, writePartitionedParquetTask } from './chunk-6XXXYVXT.js';
|
|
3
|
+
export { MemoryCheckpointAdapter, advanceTaskCheckpoint, assertBookmarkMatches, collectExprColumns, collectWindowColumns, compatibleWindowSortGroups, createBookmark, createOutputManifest, createOutputManifestFromCheckpoints, createTaskManifest, fingerprint, isPrototypeMutationKey, memoryCheckpointAdapter, readOutputManifest, signPaginationToken, stableStringify, transitionTaskCheckpoint, verifyPaginationToken, windowExpressions, windowReadColumns, windowSortGroupCount, windowSortSpecsCompatible, windowTaskPlanForWindows, writeOutputManifest } from './chunk-ZVHJD6R3.js';
|
|
4
|
+
export { ERROR_CODES, LakeqlError, TimestampValue, applyIntervalToTimestamp, bboxDistance, bboxIntersects, compareTimestampValues, encodeJsonLine, ensureGeoBackendForExprs, envelopeFromGeometry, envelopeOf, evaluate, geometryDistance, intervalToString, intervalValue, isIntervalValue, isLakeqlError, isNonNegativeInterval, isTimestampValue, jsonSafeValue, loadGeoBackend, matches, parseGeometry, requireGeoBackend, setGeoBackend, timestampEpochForUnit, timestampFromEpoch, timestampToIsoString, timestampValueFromIso, toGeometry } from './chunk-4VJQ56HF.js';
|
package/dist/node.d.ts
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
|
-
import { ObjectInfo, ObjectStore, ConditionalObjectStore } from './index.js';
|
|
2
|
-
export { AggregateExpr, AggregateGroupSnapshot, AggregateOp, AggregateOperatorState, AggregateOptions, AggregateParquetGroupTaskOptions, AggregateParquetGroupTasksOptions, AggregateParquetTaskOptions, AggregateParquetTasksOptions, AggregateResult, AggregateSnapshotValue, AggregateSpec, AggregateStateSnapshot, AggregationBuilder, ApplyIcebergDeletesOptions, ArithmeticExpr, BBox, BBoxIndex, Batch, BatchExprValues, BetweenExpr, Bookmark, BookmarkInit, BookmarkPosition, BookmarkQuery, BroadcastJoinOptions,
|
|
1
|
+
import { CacheAdapter, ObjectInfo, ObjectStore, ConditionalObjectStore } from './index.js';
|
|
2
|
+
export { AggregateExpr, AggregateGroupSnapshot, AggregateOp, AggregateOperatorState, AggregateOptions, AggregateParquetGroupTaskOptions, AggregateParquetGroupTasksOptions, AggregateParquetTaskOptions, AggregateParquetTasksOptions, AggregateResult, AggregateSnapshotValue, AggregateSpec, AggregateStateSnapshot, AggregationBuilder, ApplyIcebergDeletesOptions, ArithmeticExpr, BBox, BBoxIndex, Batch, BatchExprValues, BetweenExpr, Bookmark, BookmarkInit, BookmarkPosition, BookmarkQuery, BroadcastJoinOptions, CacheApiCache, CacheApiCacheOptions, CacheEntry, CachePolicy, CallExpr, CaseExpr, CaseWhenExpr, CheckpointAdapter, CheckpointStore, Clock, ColumnExpr, ColumnInput, CompareExpr, CompareOp, CompatibleWindowSortGroup, CompatibleWindowSortItem, ConditionalPutOptions, CreateParquetTableAsOptions, CreateParquetTableAsQuery, CreateParquetTableAsResult, CsvStreamOptions, DecodedIcebergDeletes, DecodedIcebergParquetDeletes, ERROR_CODES, EngineFilePlan, EngineTable, ErrorDetails, ExplainJson, ExplainResult, Expr, GeoBackend, GeoJsonGeometry, IcebergAppendFile, IcebergAppendOptions, IcebergAppendOutputManifestOptions, IcebergAppendResult, IcebergCatalog, IcebergCommitCatalog, IcebergCommitInput, IcebergCommitResult, IcebergDeleteFile, IcebergDeletionVector, IcebergEnginePlan, IcebergEngineTable, IcebergEqualityDelete, IcebergField, IcebergGlueCatalogOptions, IcebergLoadTableOptions, IcebergNessieCatalogOptions, IcebergParquetDeleteFile, IcebergParquetDeleteFileContent, IcebergPartitionField, IcebergPartitionSpec, IcebergPlan, IcebergPositionDelete, IcebergReadMode, IcebergRestAccessDelegation, IcebergRestCatalog, IcebergRestCatalogConfig, IcebergRestCatalogOptions, IcebergRestLoadContext, IcebergRestLoadTableOptions, IcebergRestLoadTableResult, IcebergRestStorageCredential, IcebergRowBatch, IcebergSortOrder, IcebergTable, IcebergTableIdentifier, IcebergUnsupportedCatalog, IdGenerator, InExpr, InMemoryLakeOptions, InMemoryRowsScanner, InMemoryRowsStore, InMemoryTableOptions, IndexPruneResult, IndexValue, InsertValidationRules, IntervalValue, JoinKey, JoinType, JsonExpr, JsonOrderByTerm, JsonQueryV1, Lake, LakeConfig, LakeqlError, LakeqlErrorCode, LikeExpr, ListOptions, LiteralExpr, LoadIcebergEngineTableOptions, LoadIcebergTableFromObjectStoreOptions, LoadIcebergTableFromRestOptions, LoadIcebergTableOptions, LoadParquetEngineTableOptions, LoadTableOptions, LockAdapter, LogHook, LogicalExpr, LookupJoinFunction, LookupJoinOptions, Manifest, ManifestDeleteFile, ManifestFile, MemoryCache, MemoryCheckpointAdapter, MemoryObjectStore, MemorySpillAdapter, MemorySpillAdapterOptions, MetadataFile, MetricsHook, MinMaxColumnIndex, NotExpr, NullCheckExpr, ObjectHead, ObjectStoreCacheOptions, ObjectStoreIcebergCommitCatalog, ObjectStoreJsonCache, ObjectStoreJsonCacheOptions, ObjectStoreReadControls, ObjectStoreUriAuthority, OperatorSnapshotValue, OrderByTerm, OutputManifest, OutputManifestEntry, PACKAGE, ParquetColumnBatch, ParquetEnginePlan, ParquetEngineTable, ParquetLakeConfig, ParquetMetadata, ParquetRowBatch, ParquetRowGroupPlan, ParquetScanAdapter, PartitionedParquetOutputEntryOptions, PathQueryInit, PlanIcebergFilesOptions, PlanParquetRowGroupsOptions, PlanParquetTaskWorkUnitsOptions, PlannedIcebergFile, PlannedParquetRowGroup, PredicatePlan, PredicatePlanOptions, ProjectIcebergRowOptions, PutOptions, QueryBudget, QueryBuilder, QueryPolicy, QueryPolicyContext, QueryResult, QueryRunOptions, QueryStats, QueueAdapter, ReadParquetBatchOptions, ReadParquetOptions, ResumableBatchOptions, ResumedQuery, Row, RuntimeSubstrate, Scalar, ScanAdapter, ScanBatch, ScanColumnBatch, ScanEngineOptions, ScanOptions, ScanParquetTaskOptions, ScanPlannedIcebergRowsOptions, ScanTaskPlan, ScanTaskPlanOptions, ScanVectorBatch, Selection, SharedCacheEntry, SharedCacheSetOptions, SharedMemoryCache, SidecarFileIndex, SliceOptions, SliceResult, Snapshot, SortOperatorState, SortOptions, SortResult, SortRunState, SpillAdapter, SpillRef, SpillUsage, SqlBoolean, TaskCheckpoint, TaskInput, TaskManifest, TaskManifestTask, TaskState, TaskTransitionInput, TimestampUnit, TimestampValue, TopKOperatorState, TopKOptions, TopKResult, ValueInput, Vector, VectorAggregateOptions, VectorAggregateSnapshotValue, VectorAggregateState, VectorAggregateStateSnapshot, VectorAggregateStateSnapshots, VectorAggregateStates, VectorAggregateValue, VectorGroup, VectorGroupByGroupSnapshot, VectorGroupByOptions, VectorGroupBySnapshotValue, VectorGroupByState, VectorGroupByStateSnapshot, VectorHashJoinOptions, VectorProjectionSpec, VectorTopKOptions, WindowExecutionMode, WindowExplainPlan, WindowExpr, WindowFn, WindowFrame, WindowFrameBound, WindowOperatorState, WindowOptions, WindowOrderTerm, WindowParquetTasksOptions, WindowRankingFn, WindowReadColumnInput, WindowResult, WindowRunState, WindowSnapshotValue, WindowSpec, WindowTaskExecutionOptions, WindowTaskPlan, WindowValueFn, WindowWorkUnitBucket, WindowWorkUnitEvaluationOptions, WindowWorkUnitOrdinal, WindowWorkUnitPartial, WindowWorkUnitRow, WorkUnitFanInOptions, WriteParquetOptions, WriteParquetRowsOptions, WritePartitionedParquetFile, WritePartitionedParquetResult, WritePartitionedParquetTaskOptions, WritePartitionedParquetTaskResult, add, advanceTaskCheckpoint, aggregateParquetGroupTask, aggregateParquetGroupTasks, aggregateParquetGroupTasksBatch, aggregateParquetTask, aggregateParquetTasks, and, applyIcebergDeletes, applyIntervalToTimestamp, assertBookmarkMatches, asyncBufferFromStore, batchExprValues, batchFromColumns, batchFromVectors, bboxDistance, bboxIntersects, bboxMayIntersect, between, broadcastJoin, buildBBoxIndex, buildMinMaxIndex, cacheApiCache, cachedObjectStore, classifyPredicate, col, collectExprColumns, collectWindowColumns, compareTimestampValues, compatibleWindowSortGroups, concatBatches, createBookmark, createInMemoryLake, createLake, createOutputManifest, createOutputManifestFromCheckpoints, createLake as createParquetLake, createParquetTableAs, createTaskManifest, createVectorAggregateStates, createVectorGroupByState, deserializeAggregateOperatorState, deserializeSortOperatorState, deserializeTopKOperatorState, deserializeWindowOperatorState, div, encodeJsonLine, enforceVectorGroupByBudget, ensureGeoBackendForExprs, envelopeFromGeometry, envelopeOf, eq, evaluate, evaluateWindowWorkUnitPartials, fanInWorkUnits, finalizeVectorAggregateStates, finalizeVectorGroupByBatch, finalizeVectorGroupByRows, fingerprint, fn, gatherBatch, geometryDistance, getOrCreateVectorGroup, gt, gte, icebergGlueCatalog, icebergNessieCatalog, icebergRestCatalog, ilike, inMemoryRowsScanner, intervalToString, intervalValue, isIn, isIntervalValue, isLakeqlError, isNonNegativeInterval, isNotNull, isNull, isPrototypeMutationKey, isTimestampValue, jsonSafeValue, jsonWorkUnitBoundary, like, lit, loadGeoBackend, loadIcebergTable, loadIcebergTableFromObjectStore, loadIcebergTableFromRest, loadTable, lookupJoin, lt, lte, matches, materializeBatchRow, materializeBatchRows, materializeSelectedBatchRows, memoryCache, memoryCheckpointAdapter, memorySpillAdapter, memoryStore, mergeVectorAggregateStateSnapshots, mergeVectorAggregateStates, mergeVectorGroupByStates, mod, mul, ne, not, notIn, objectStoreJsonCache, or, parquetScanner, parseGeometry, parseHivePartitions, parseJsonQuery, partitionWindowWorkUnitRows, 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, serializeWindowOperatorState, 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, windowExpressions, windowOperatorState, windowOperatorStateFromRuns, windowParquetTask, windowParquetTasks, windowPartitionBucket, windowReadColumns, windowRowsFromState, windowSortGroupCount, windowSortSpecsCompatible, windowTaskPlanForWindows, withObjectStoreReadControls, writeOutputManifest, writeParquet, writePartitionedParquet, writePartitionedParquetTask } from './index.js';
|
|
3
3
|
import 'hyparquet-writer';
|
|
4
4
|
import 'hyparquet';
|
|
5
5
|
|
|
6
|
+
interface FsJsonCacheOptions {
|
|
7
|
+
root: string;
|
|
8
|
+
prefix?: string;
|
|
9
|
+
ttlMs?: number;
|
|
10
|
+
now?: () => number;
|
|
11
|
+
space?: number;
|
|
12
|
+
}
|
|
13
|
+
declare function fsJsonCache<T = unknown>(options: FsJsonCacheOptions): CacheAdapter<T>;
|
|
14
|
+
|
|
6
15
|
interface HttpStoreOptions {
|
|
7
16
|
baseUrl: string;
|
|
8
17
|
fetch?: typeof fetch;
|
|
@@ -11,16 +20,30 @@ interface HttpStoreOptions {
|
|
|
11
20
|
}
|
|
12
21
|
declare function httpStore(options: HttpStoreOptions): ObjectStore;
|
|
13
22
|
|
|
23
|
+
interface S3Credentials {
|
|
24
|
+
accessKeyId: string;
|
|
25
|
+
secretAccessKey: string;
|
|
26
|
+
sessionToken?: string;
|
|
27
|
+
expiresAt?: Date;
|
|
28
|
+
}
|
|
29
|
+
type S3CredentialsProvider = () => S3Credentials | Promise<S3Credentials>;
|
|
14
30
|
interface S3StoreOptions {
|
|
15
31
|
endpoint: string;
|
|
16
32
|
bucket: string;
|
|
17
33
|
region: string;
|
|
18
|
-
accessKeyId
|
|
19
|
-
secretAccessKey
|
|
34
|
+
accessKeyId?: string;
|
|
35
|
+
secretAccessKey?: string;
|
|
20
36
|
sessionToken?: string;
|
|
37
|
+
credentials?: S3CredentialsProvider;
|
|
38
|
+
credentialRefreshWindowMs?: number;
|
|
21
39
|
fetch?: typeof fetch;
|
|
22
40
|
now?: () => Date;
|
|
23
41
|
}
|
|
42
|
+
interface S3JsonCacheOptions extends S3StoreOptions {
|
|
43
|
+
prefix: string;
|
|
44
|
+
ttlMs?: number;
|
|
45
|
+
}
|
|
24
46
|
declare function s3Store(options: S3StoreOptions): ConditionalObjectStore;
|
|
47
|
+
declare function s3JsonCache<T = unknown>(options: S3JsonCacheOptions): CacheAdapter<T>;
|
|
25
48
|
|
|
26
|
-
export { ConditionalObjectStore, ObjectInfo, ObjectStore, httpStore, s3Store };
|
|
49
|
+
export { CacheAdapter, ConditionalObjectStore, ObjectInfo, ObjectStore, fsJsonCache, httpStore, s3JsonCache, s3Store };
|
package/dist/node.js
CHANGED
|
@@ -1,10 +1,111 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
export {
|
|
1
|
+
import { objectStoreJsonCache } from './chunk-2XZJK7EF.js';
|
|
2
|
+
export { IcebergRestCatalog, IcebergTable, IcebergUnsupportedCatalog, InMemoryRowsScanner, InMemoryRowsStore, ObjectStoreIcebergCommitCatalog, ObjectStoreJsonCache, PACKAGE, applyIcebergDeletes, createInMemoryLake, icebergGlueCatalog, icebergNessieCatalog, icebergRestCatalog, inMemoryRowsScanner, loadIcebergTable, loadIcebergTableFromObjectStore, loadIcebergTableFromRest, loadTable, objectStoreJsonCache, planFiles, scanBatches, scanPlannedIcebergRows, scanRows, vectorHashJoin } from './chunk-2XZJK7EF.js';
|
|
3
|
+
export { AggregationBuilder, CacheApiCache, Lake, MemoryCache, MemoryObjectStore, MemorySpillAdapter, ParquetScanAdapter, QueryBuilder, QueryResult, ResumedQuery, SharedMemoryCache, add, aggregateParquetGroupTask, aggregateParquetGroupTasks, aggregateParquetGroupTasksBatch, aggregateParquetTask, aggregateParquetTasks, and, asyncBufferFromStore, batchExprValues, batchFromColumns, batchFromVectors, bboxMayIntersect, between, broadcastJoin, buildBBoxIndex, buildMinMaxIndex, cacheApiCache, cachedObjectStore, classifyPredicate, col, concatBatches, createParquetLake as createLake, createParquetLake, createParquetTableAs, createVectorAggregateStates, createVectorGroupByState, deserializeAggregateOperatorState, deserializeSortOperatorState, deserializeTopKOperatorState, deserializeWindowOperatorState, div, enforceVectorGroupByBudget, eq, evaluateWindowWorkUnitPartials, fanInWorkUnits, finalizeVectorAggregateStates, finalizeVectorGroupByBatch, finalizeVectorGroupByRows, fn, gatherBatch, getOrCreateVectorGroup, gt, gte, ilike, isIn, isNotNull, isNull, jsonWorkUnitBoundary, like, lit, lookupJoin, lt, lte, materializeBatchRow, materializeBatchRows, materializeSelectedBatchRows, memoryCache, memorySpillAdapter, memoryStore, mergeVectorAggregateStateSnapshots, mergeVectorAggregateStates, mergeVectorGroupByStates, mod, mul, ne, not, notIn, or, parquetScanner, parseHivePartitions, parseJsonQuery, partitionWindowWorkUnitRows, partitionedParquetOutputEntries, planParquetTaskWorkUnits, planRowGroups, planRowGroupsFromMetadata, predicateSelection, pruneFilesWithIndex, readControlSignal, readIcebergParquetDeletes, readParquetColumnBatches, readParquetMetadata, readParquetObjectBatches, readParquetObjects, rejectUnsupportedParquetSchema, restoreVectorAggregateStates, restoreVectorGroupByState, rowGroupMayMatch, rowGroupMustMatch, scalarVectorValue, scanParquetTaskBatches, scanParquetTaskColumnBatches, selectedRowCount, selectedRowIndices, serializeAggregateOperatorState, serializeSortOperatorState, serializeTopKOperatorState, serializeWindowOperatorState, snapshotVectorAggregateStates, snapshotVectorGroupByState, sub, throwIfAborted, tryPredicateSelection, updateVectorAggregateStateValue, updateVectorAggregateStates, updateVectorGroupAggregateValue, updateVectorGroupByState, uriObjectStore, vectorAggregateBatch, vectorFromValues, vectorGroupByBatch, vectorLength, vectorOrderByBatch, vectorProjectBatch, vectorSortIndices, vectorTopKBatch, vectorTopKIndices, vectorValue, windowOperatorState, windowOperatorStateFromRuns, windowParquetTask, windowParquetTasks, windowPartitionBucket, windowRowsFromState, withObjectStoreReadControls, writeParquet, writePartitionedParquet, writePartitionedParquetTask } from './chunk-6XXXYVXT.js';
|
|
4
|
+
export { MemoryCheckpointAdapter, advanceTaskCheckpoint, assertBookmarkMatches, collectExprColumns, collectWindowColumns, compatibleWindowSortGroups, createBookmark, createOutputManifest, createOutputManifestFromCheckpoints, createTaskManifest, fingerprint, isPrototypeMutationKey, memoryCheckpointAdapter, readOutputManifest, signPaginationToken, stableStringify, transitionTaskCheckpoint, verifyPaginationToken, windowExpressions, windowReadColumns, windowSortGroupCount, windowSortSpecsCompatible, windowTaskPlanForWindows, writeOutputManifest } from './chunk-ZVHJD6R3.js';
|
|
5
|
+
import { LakeqlError } from './chunk-4VJQ56HF.js';
|
|
6
|
+
export { ERROR_CODES, LakeqlError, TimestampValue, applyIntervalToTimestamp, bboxDistance, bboxIntersects, compareTimestampValues, encodeJsonLine, ensureGeoBackendForExprs, envelopeFromGeometry, envelopeOf, evaluate, geometryDistance, intervalToString, intervalValue, isIntervalValue, isLakeqlError, isNonNegativeInterval, isTimestampValue, jsonSafeValue, loadGeoBackend, matches, parseGeometry, requireGeoBackend, setGeoBackend, timestampEpochForUnit, timestampFromEpoch, timestampToIsoString, timestampValueFromIso, toGeometry } from './chunk-4VJQ56HF.js';
|
|
7
|
+
import { readFile, mkdir, writeFile, rm } from 'fs/promises';
|
|
8
|
+
import { join } from 'path';
|
|
5
9
|
import { AwsClient } from 'aws4fetch';
|
|
6
10
|
import { XMLParser } from 'fast-xml-parser';
|
|
7
11
|
|
|
12
|
+
function fsJsonCache(options) {
|
|
13
|
+
return new FsJsonCache(options);
|
|
14
|
+
}
|
|
15
|
+
var FsJsonCache = class {
|
|
16
|
+
root;
|
|
17
|
+
prefix;
|
|
18
|
+
ttlMs;
|
|
19
|
+
now;
|
|
20
|
+
space;
|
|
21
|
+
constructor(options) {
|
|
22
|
+
this.root = options.root;
|
|
23
|
+
this.prefix = normalizedPrefix(options.prefix ?? "lakeql");
|
|
24
|
+
this.ttlMs = options.ttlMs;
|
|
25
|
+
this.now = options.now ?? Date.now;
|
|
26
|
+
this.space = options.space;
|
|
27
|
+
}
|
|
28
|
+
async get(key) {
|
|
29
|
+
const path = this.pathFor(key);
|
|
30
|
+
let bytes;
|
|
31
|
+
try {
|
|
32
|
+
bytes = await readFile(path);
|
|
33
|
+
} catch (cause) {
|
|
34
|
+
if (isNodeError(cause) && cause.code === "ENOENT")
|
|
35
|
+
return void 0;
|
|
36
|
+
throw cause;
|
|
37
|
+
}
|
|
38
|
+
const parsed = JSON.parse(bytes.toString("utf8"));
|
|
39
|
+
if (!isStoredFsJsonCacheEntry(parsed)) {
|
|
40
|
+
throw new LakeqlError("LAKEQL_CATALOG_ERROR", `Invalid filesystem cache entry at ${path}`, {
|
|
41
|
+
path
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
if (parsed.expiresAt !== void 0 && parsed.expiresAt <= this.now()) {
|
|
45
|
+
await this.delete(key);
|
|
46
|
+
return void 0;
|
|
47
|
+
}
|
|
48
|
+
const entry = { value: parsed.value };
|
|
49
|
+
if (parsed.expiresAt !== void 0)
|
|
50
|
+
entry.expiresAt = parsed.expiresAt;
|
|
51
|
+
return entry;
|
|
52
|
+
}
|
|
53
|
+
async set(key, entry) {
|
|
54
|
+
const path = this.pathFor(key);
|
|
55
|
+
await mkdir(join(this.root, this.prefix), { recursive: true });
|
|
56
|
+
const stored = { value: entry.value };
|
|
57
|
+
if (entry.expiresAt !== void 0) {
|
|
58
|
+
stored.expiresAt = entry.expiresAt;
|
|
59
|
+
} else if (this.ttlMs !== void 0) {
|
|
60
|
+
stored.expiresAt = this.now() + this.ttlMs;
|
|
61
|
+
}
|
|
62
|
+
await writeFile(path, jsonCacheValue(stored, key, this.space));
|
|
63
|
+
}
|
|
64
|
+
async delete(key) {
|
|
65
|
+
await rm(this.pathFor(key), { force: true });
|
|
66
|
+
}
|
|
67
|
+
pathFor(key) {
|
|
68
|
+
if (key.length === 0) {
|
|
69
|
+
throw new LakeqlError("LAKEQL_VALIDATION_ERROR", "filesystem cache key must not be empty");
|
|
70
|
+
}
|
|
71
|
+
return join(this.root, this.prefix, `${encodeURIComponent(key)}.json`);
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
function normalizedPrefix(prefix) {
|
|
75
|
+
const parts = prefix.split("/").filter((part) => part.length > 0);
|
|
76
|
+
if (parts.length === 0 || parts.some((part) => part === "." || part === "..")) {
|
|
77
|
+
throw new LakeqlError("LAKEQL_VALIDATION_ERROR", "filesystem cache prefix must be relative", {
|
|
78
|
+
prefix
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
return parts.join("/");
|
|
82
|
+
}
|
|
83
|
+
function isStoredFsJsonCacheEntry(value) {
|
|
84
|
+
return typeof value === "object" && value !== null && "value" in value;
|
|
85
|
+
}
|
|
86
|
+
function jsonCacheValue(value, key, space) {
|
|
87
|
+
if (value.value === void 0) {
|
|
88
|
+
throw new LakeqlError("LAKEQL_TYPE_ERROR", "filesystem JSON cache value is not JSON serializable", { key });
|
|
89
|
+
}
|
|
90
|
+
try {
|
|
91
|
+
const json = JSON.stringify(value, void 0, space);
|
|
92
|
+
if (json === void 0) {
|
|
93
|
+
throw new LakeqlError("LAKEQL_TYPE_ERROR", "filesystem JSON cache value is not JSON serializable", { key });
|
|
94
|
+
}
|
|
95
|
+
return json;
|
|
96
|
+
} catch (cause) {
|
|
97
|
+
if (cause instanceof LakeqlError)
|
|
98
|
+
throw cause;
|
|
99
|
+
throw new LakeqlError("LAKEQL_TYPE_ERROR", "filesystem JSON cache value is not JSON serializable", {
|
|
100
|
+
key,
|
|
101
|
+
cause
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
function isNodeError(value) {
|
|
106
|
+
return value instanceof Error && "code" in value;
|
|
107
|
+
}
|
|
108
|
+
|
|
8
109
|
// ../http/dist/index.js
|
|
9
110
|
function httpStore(options) {
|
|
10
111
|
return new HttpObjectStore(options);
|
|
@@ -14,6 +115,7 @@ var HttpObjectStore = class {
|
|
|
14
115
|
fetchImpl;
|
|
15
116
|
headers;
|
|
16
117
|
objects;
|
|
118
|
+
fullObjectCache = /* @__PURE__ */ new Map();
|
|
17
119
|
constructor(options) {
|
|
18
120
|
this.baseUrl = options.baseUrl.endsWith("/") ? options.baseUrl : `${options.baseUrl}/`;
|
|
19
121
|
this.fetchImpl = options.fetch ?? fetch.bind(globalThis);
|
|
@@ -25,7 +127,9 @@ var HttpObjectStore = class {
|
|
|
25
127
|
if (response.status === 404)
|
|
26
128
|
return null;
|
|
27
129
|
assertOk(response, path);
|
|
28
|
-
|
|
130
|
+
const bytes = new Uint8Array(await response.arrayBuffer());
|
|
131
|
+
this.fullObjectCache.set(path, bytes);
|
|
132
|
+
return bytes;
|
|
29
133
|
}
|
|
30
134
|
async getRange(path, range) {
|
|
31
135
|
if (range.offset < 0 || range.length < 0) {
|
|
@@ -34,13 +138,21 @@ var HttpObjectStore = class {
|
|
|
34
138
|
range
|
|
35
139
|
});
|
|
36
140
|
}
|
|
141
|
+
const cached = this.fullObjectCache.get(path);
|
|
142
|
+
if (cached !== void 0)
|
|
143
|
+
return cached.subarray(range.offset, range.offset + range.length);
|
|
37
144
|
const response = await this.fetchPath(path, {
|
|
38
145
|
method: "GET",
|
|
39
146
|
headers: { Range: `bytes=${range.offset}-${range.offset + range.length - 1}` }
|
|
40
147
|
});
|
|
148
|
+
if (response.status === 416) {
|
|
149
|
+
const full = await this.fetchFullObject(path);
|
|
150
|
+
return full.subarray(range.offset, range.offset + range.length);
|
|
151
|
+
}
|
|
41
152
|
assertOk(response, path);
|
|
42
153
|
const bytes = new Uint8Array(await response.arrayBuffer());
|
|
43
154
|
if (response.status !== 206 && bytes.length > range.length) {
|
|
155
|
+
this.fullObjectCache.set(path, bytes);
|
|
44
156
|
return bytes.subarray(range.offset, range.offset + range.length);
|
|
45
157
|
}
|
|
46
158
|
return bytes;
|
|
@@ -73,15 +185,21 @@ var HttpObjectStore = class {
|
|
|
73
185
|
async head(path) {
|
|
74
186
|
const response = await this.fetchPath(path, {
|
|
75
187
|
method: "GET",
|
|
76
|
-
headers: { Range: "bytes=0-
|
|
188
|
+
headers: { Range: "bytes=0-1" }
|
|
77
189
|
});
|
|
78
190
|
if (response.status === 404)
|
|
79
191
|
return null;
|
|
80
192
|
assertOk(response, path);
|
|
81
|
-
await response.arrayBuffer().catch(() =>
|
|
193
|
+
const probe = new Uint8Array(await response.arrayBuffer().catch(() => new ArrayBuffer(0)));
|
|
82
194
|
const total = parseContentRangeTotal(response.headers.get("content-range"));
|
|
83
195
|
const contentLength = response.headers.get("content-length");
|
|
84
|
-
|
|
196
|
+
let size = total ?? (contentLength ? Number(contentLength) : Number.NaN);
|
|
197
|
+
if (response.status === 206 && isCompressedRangeProbe(probe, response.headers)) {
|
|
198
|
+
size = (await this.fetchFullObject(path)).byteLength;
|
|
199
|
+
} else if (response.status !== 206 && probe.byteLength > 0) {
|
|
200
|
+
this.fullObjectCache.set(path, probe);
|
|
201
|
+
size = probe.byteLength;
|
|
202
|
+
}
|
|
85
203
|
if (!Number.isFinite(size)) {
|
|
86
204
|
throw new LakeqlError("LAKEQL_OBJECT_NOT_FOUND", `Missing size for ${path}`, { path });
|
|
87
205
|
}
|
|
@@ -105,6 +223,16 @@ var HttpObjectStore = class {
|
|
|
105
223
|
}
|
|
106
224
|
return this.fetchImpl(this.urlForPath(path), { ...init, headers });
|
|
107
225
|
}
|
|
226
|
+
async fetchFullObject(path) {
|
|
227
|
+
const cached = this.fullObjectCache.get(path);
|
|
228
|
+
if (cached !== void 0)
|
|
229
|
+
return cached;
|
|
230
|
+
const response = await this.fetchPath(path, { method: "GET" });
|
|
231
|
+
assertOk(response, path);
|
|
232
|
+
const bytes = new Uint8Array(await response.arrayBuffer());
|
|
233
|
+
this.fullObjectCache.set(path, bytes);
|
|
234
|
+
return bytes;
|
|
235
|
+
}
|
|
108
236
|
urlForPath(path) {
|
|
109
237
|
const base = new URL(this.baseUrl);
|
|
110
238
|
const url = new URL(encodeObjectPath(path), base);
|
|
@@ -117,6 +245,17 @@ var HttpObjectStore = class {
|
|
|
117
245
|
return url;
|
|
118
246
|
}
|
|
119
247
|
};
|
|
248
|
+
function isCompressedRangeProbe(bytes, headers) {
|
|
249
|
+
const encoding = headers.get("content-encoding")?.toLowerCase();
|
|
250
|
+
if (encoding && encoding !== "identity")
|
|
251
|
+
return true;
|
|
252
|
+
const vary = headers.get("vary")?.toLowerCase();
|
|
253
|
+
if (vary?.split(",").some((value) => value.trim() === "accept-encoding"))
|
|
254
|
+
return true;
|
|
255
|
+
if (bytes[0] === 31 && bytes[1] === 139)
|
|
256
|
+
return true;
|
|
257
|
+
return false;
|
|
258
|
+
}
|
|
120
259
|
function encodeObjectPath(path) {
|
|
121
260
|
if (/^(?:[a-z][a-z0-9+.-]*:)?\/\//iu.test(path) || path.startsWith("/")) {
|
|
122
261
|
throw new LakeqlError("LAKEQL_VALIDATION_ERROR", `Object path must be relative: ${path}`, {
|
|
@@ -173,25 +312,26 @@ function bodyInit(body) {
|
|
|
173
312
|
function s3Store(options) {
|
|
174
313
|
return new S3ObjectStore(options);
|
|
175
314
|
}
|
|
315
|
+
function s3JsonCache(options) {
|
|
316
|
+
return objectStoreJsonCache({
|
|
317
|
+
store: s3Store(options),
|
|
318
|
+
prefix: options.prefix,
|
|
319
|
+
...options.ttlMs !== void 0 ? { ttlMs: options.ttlMs } : {}
|
|
320
|
+
});
|
|
321
|
+
}
|
|
176
322
|
var S3ObjectStore = class {
|
|
177
323
|
options;
|
|
178
324
|
fetchImpl;
|
|
179
325
|
now;
|
|
180
|
-
|
|
326
|
+
credentialsSnapshot;
|
|
327
|
+
credentialsPromise;
|
|
181
328
|
constructor(options) {
|
|
182
329
|
this.options = options;
|
|
183
330
|
this.fetchImpl = options.fetch ?? fetch;
|
|
184
331
|
this.now = options.now ?? (() => /* @__PURE__ */ new Date());
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
region: options.region,
|
|
189
|
-
service: "s3",
|
|
190
|
-
retries: 0
|
|
191
|
-
};
|
|
192
|
-
if (options.sessionToken !== void 0)
|
|
193
|
-
awsOptions.sessionToken = options.sessionToken;
|
|
194
|
-
this.aws = new AwsClient(awsOptions);
|
|
332
|
+
if (options.credentials === void 0) {
|
|
333
|
+
this.credentialsSnapshot = staticCredentials(options);
|
|
334
|
+
}
|
|
195
335
|
}
|
|
196
336
|
async get(path) {
|
|
197
337
|
const response = await this.request("GET", path);
|
|
@@ -286,19 +426,41 @@ var S3ObjectStore = class {
|
|
|
286
426
|
url,
|
|
287
427
|
headers,
|
|
288
428
|
region: this.options.region,
|
|
289
|
-
|
|
290
|
-
secretAccessKey: this.options.secretAccessKey,
|
|
429
|
+
...await this.currentCredentials(),
|
|
291
430
|
now: this.now()
|
|
292
431
|
};
|
|
293
|
-
if (this.options.sessionToken !== void 0)
|
|
294
|
-
signRequest.sessionToken = this.options.sessionToken;
|
|
295
432
|
const requestBody = body === void 0 ? void 0 : bodyInit2(body);
|
|
296
|
-
const signed = await signS3Request(signRequest,
|
|
433
|
+
const signed = await signS3Request(signRequest, void 0, requestBody);
|
|
297
434
|
const init = { method, headers: signed };
|
|
298
435
|
if (requestBody !== void 0)
|
|
299
436
|
init.body = requestBody;
|
|
300
437
|
return this.fetchImpl(url, init);
|
|
301
438
|
}
|
|
439
|
+
async currentCredentials() {
|
|
440
|
+
if (this.options.credentials === void 0) {
|
|
441
|
+
if (this.credentialsSnapshot === void 0)
|
|
442
|
+
this.credentialsSnapshot = staticCredentials(this.options);
|
|
443
|
+
return this.credentialsSnapshot;
|
|
444
|
+
}
|
|
445
|
+
if (this.credentialsSnapshot !== void 0 && !credentialsNeedRefresh(this.credentialsSnapshot, this.now(), this.credentialRefreshWindowMs())) {
|
|
446
|
+
return this.credentialsSnapshot;
|
|
447
|
+
}
|
|
448
|
+
if (this.credentialsPromise === void 0) {
|
|
449
|
+
this.credentialsPromise = Promise.resolve(this.options.credentials()).then((credentials) => {
|
|
450
|
+
const normalized = validateCredentials(credentials);
|
|
451
|
+
this.credentialsSnapshot = normalized;
|
|
452
|
+
this.credentialsPromise = void 0;
|
|
453
|
+
return normalized;
|
|
454
|
+
}).catch((cause) => {
|
|
455
|
+
this.credentialsPromise = void 0;
|
|
456
|
+
throw cause;
|
|
457
|
+
});
|
|
458
|
+
}
|
|
459
|
+
return await this.credentialsPromise;
|
|
460
|
+
}
|
|
461
|
+
credentialRefreshWindowMs() {
|
|
462
|
+
return this.options.credentialRefreshWindowMs ?? 3e5;
|
|
463
|
+
}
|
|
302
464
|
};
|
|
303
465
|
async function signS3Request(request, client = s3SignerClient(request), body) {
|
|
304
466
|
const headers = new Headers(request.headers);
|
|
@@ -329,6 +491,39 @@ function s3SignerClient(request) {
|
|
|
329
491
|
options.sessionToken = request.sessionToken;
|
|
330
492
|
return new AwsClient(options);
|
|
331
493
|
}
|
|
494
|
+
function staticCredentials(options) {
|
|
495
|
+
if (options.accessKeyId === void 0 || options.secretAccessKey === void 0) {
|
|
496
|
+
throw new LakeqlError("LAKEQL_VALIDATION_ERROR", "S3 credentials are required", {
|
|
497
|
+
bucket: options.bucket
|
|
498
|
+
});
|
|
499
|
+
}
|
|
500
|
+
return validateCredentials({
|
|
501
|
+
accessKeyId: options.accessKeyId,
|
|
502
|
+
secretAccessKey: options.secretAccessKey,
|
|
503
|
+
...options.sessionToken !== void 0 ? { sessionToken: options.sessionToken } : {}
|
|
504
|
+
});
|
|
505
|
+
}
|
|
506
|
+
function validateCredentials(credentials) {
|
|
507
|
+
const accessKeyId = credentials.accessKeyId.trim();
|
|
508
|
+
const secretAccessKey = credentials.secretAccessKey.trim();
|
|
509
|
+
if (accessKeyId === "" || secretAccessKey === "") {
|
|
510
|
+
throw new LakeqlError("LAKEQL_VALIDATION_ERROR", "S3 credentials are required");
|
|
511
|
+
}
|
|
512
|
+
const normalized = {
|
|
513
|
+
accessKeyId,
|
|
514
|
+
secretAccessKey
|
|
515
|
+
};
|
|
516
|
+
if (credentials.sessionToken !== void 0)
|
|
517
|
+
normalized.sessionToken = credentials.sessionToken;
|
|
518
|
+
if (credentials.expiresAt !== void 0)
|
|
519
|
+
normalized.expiresAt = credentials.expiresAt;
|
|
520
|
+
return normalized;
|
|
521
|
+
}
|
|
522
|
+
function credentialsNeedRefresh(credentials, now, refreshWindowMs) {
|
|
523
|
+
if (credentials.expiresAt === void 0)
|
|
524
|
+
return false;
|
|
525
|
+
return credentials.expiresAt.getTime() - now.getTime() <= refreshWindowMs;
|
|
526
|
+
}
|
|
332
527
|
var listObjectsParser = new XMLParser({
|
|
333
528
|
ignoreAttributes: true,
|
|
334
529
|
parseTagValue: false,
|
|
@@ -424,4 +619,4 @@ function arrayBuffer(bytes) {
|
|
|
424
619
|
return copy.buffer;
|
|
425
620
|
}
|
|
426
621
|
|
|
427
|
-
export { httpStore, s3Store };
|
|
622
|
+
export { fsJsonCache, httpStore, s3JsonCache, s3Store };
|