lakeql 0.1.0
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/LICENSE +21 -0
- package/README.md +25 -0
- package/dist/chunk-VRJ72DGA.js +6824 -0
- package/dist/cloudflare.d.ts +44 -0
- package/dist/cloudflare.js +79 -0
- package/dist/index.d.ts +1386 -0
- package/dist/index.js +1 -0
- package/dist/node.d.ts +27 -0
- package/dist/node.js +422 -0
- package/package.json +72 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ObjectStore } from './index.js';
|
|
2
|
+
export { AggregateExpr, AggregateGroupSnapshot, AggregateOp, AggregateOperatorState, AggregateOptions, AggregateResult, AggregateSnapshotValue, AggregateSpec, AggregateStateSnapshot, AggregationBuilder, ApplyIcebergDeletesOptions, BBoxIndex, BetweenExpr, Bookmark, BookmarkInit, BookmarkPosition, BookmarkQuery, BroadcastJoinOptions, CacheAdapter, CacheApiCache, CacheApiCacheOptions, CacheEntry, CallExpr, CheckpointAdapter, CheckpointStore, Clock, ColumnExpr, ColumnInput, CompareExpr, CompareOp, ConditionalObjectStore, ConditionalPutOptions, CreateParquetTableAsOptions, CreateParquetTableAsQuery, CreateParquetTableAsResult, CsvStreamOptions, DecodedIcebergDeletes, DecodedIcebergParquetDeletes, ERROR_CODES, EngineFilePlan, EngineTable, ErrorDetails, ExplainJson, ExplainResult, Expr, IcebergAppendFile, IcebergAppendOptions, IcebergAppendOutputManifestOptions, IcebergAppendResult, IcebergCatalog, IcebergCommitCatalog, IcebergCommitInput, IcebergCommitResult, IcebergDeleteFile, IcebergDeletionVector, IcebergEnginePlan, IcebergEngineTable, IcebergEqualityDelete, IcebergField, IcebergGlueCatalogOptions, IcebergNessieCatalogOptions, IcebergParquetDeleteFile, IcebergParquetDeleteFileContent, IcebergPartitionField, IcebergPartitionSpec, IcebergPlan, IcebergPositionDelete, IcebergReadMode, IcebergRestCatalog, IcebergRestCatalogOptions, IcebergRowBatch, IcebergSortOrder, IcebergTable, IcebergTableIdentifier, IcebergUnsupportedCatalog, IdGenerator, InExpr, IndexPruneResult, IndexValue, InsertValidationRules, JoinType, JsonExpr, JsonOrderByTerm, JsonQueryV1, LaQLError, LaQLErrorCode, Lake, LakeConfig, 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, ObjectInfo, ObjectStoreIcebergCommitCatalog, ObjectStoreReadControls, OperatorSnapshotValue, OrderByTerm, OutputManifest, OutputManifestEntry, PACKAGE, ParquetEnginePlan, ParquetEngineTable, ParquetLakeConfig, ParquetMetadata, ParquetRowBatch, ParquetRowGroupPlan, ParquetScanAdapter, PartitionedParquetOutputEntryOptions, PathQueryInit, PlanIcebergFilesOptions, PlanParquetRowGroupsOptions, PlannedIcebergFile, PlannedParquetRowGroup, PredicatePlan, PredicatePlanOptions, ProjectIcebergRowOptions, PutOptions, QueryBudget, QueryBuilder, QueryPolicy, QueryPolicyContext, QueryResult, QueryRunOptions, QueryStats, QueueAdapter, ReadParquetBatchOptions, ReadParquetOptions, ResumableBatchOptions, ResumedQuery, Row, RuntimeSubstrate, Scalar, ScanAdapter, ScanBatch, ScanEngineOptions, ScanOptions, ScanPlannedIcebergRowsOptions, ScanTaskPlan, ScanTaskPlanOptions, SidecarFileIndex, SliceOptions, SliceResult, Snapshot, SortOperatorState, SortOptions, SortResult, SortRunState, SpillAdapter, SpillRef, SpillUsage, SqlBoolean, TaskCheckpoint, TaskInput, TaskManifest, TaskManifestTask, TaskState, TaskTransitionInput, TopKOperatorState, TopKOptions, TopKResult, ValueInput, WriteParquetOptions, WriteParquetRowsOptions, WritePartitionedParquetFile, WritePartitionedParquetResult, WritePartitionedParquetTaskOptions, WritePartitionedParquetTaskResult, advanceTaskCheckpoint, and, applyIcebergDeletes, assertBookmarkMatches, asyncBufferFromStore, bboxMayIntersect, between, broadcastJoin, buildBBoxIndex, buildMinMaxIndex, cacheApiCache, classifyPredicate, col, createBookmark, createLake, createOutputManifest, createOutputManifestFromCheckpoints, createLake as createParquetLake, createParquetTableAs, createTaskManifest, deserializeAggregateOperatorState, deserializeSortOperatorState, deserializeTopKOperatorState, 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, 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, throwIfAborted, transitionTaskCheckpoint, verifyPaginationToken, withObjectStoreReadControls, writeOutputManifest, writeParquet, writePartitionedParquet, writePartitionedParquetTask } from './index.js';
|
|
3
|
+
import 'hyparquet/src/types.js';
|
|
4
|
+
import 'hyparquet';
|
|
5
|
+
import 'hyparquet-writer';
|
|
6
|
+
|
|
7
|
+
interface R2ObjectBody {
|
|
8
|
+
key: string;
|
|
9
|
+
size: number;
|
|
10
|
+
etag?: string;
|
|
11
|
+
uploaded?: Date;
|
|
12
|
+
httpMetadata?: {
|
|
13
|
+
contentType?: string;
|
|
14
|
+
};
|
|
15
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
|
16
|
+
}
|
|
17
|
+
interface R2BucketLike {
|
|
18
|
+
get(key: string, options?: {
|
|
19
|
+
range?: {
|
|
20
|
+
offset: number;
|
|
21
|
+
length: number;
|
|
22
|
+
};
|
|
23
|
+
}): Promise<R2ObjectBody | null>;
|
|
24
|
+
head(key: string): Promise<Omit<R2ObjectBody, "arrayBuffer"> | null>;
|
|
25
|
+
put(key: string, value: Uint8Array | ReadableStream<Uint8Array>, options?: {
|
|
26
|
+
httpMetadata?: {
|
|
27
|
+
contentType?: string;
|
|
28
|
+
};
|
|
29
|
+
customMetadata?: Record<string, string>;
|
|
30
|
+
}): Promise<unknown>;
|
|
31
|
+
delete(key: string): Promise<void>;
|
|
32
|
+
list(options?: {
|
|
33
|
+
prefix?: string;
|
|
34
|
+
limit?: number;
|
|
35
|
+
cursor?: string;
|
|
36
|
+
}): Promise<{
|
|
37
|
+
objects: Omit<R2ObjectBody, "arrayBuffer">[];
|
|
38
|
+
truncated?: boolean;
|
|
39
|
+
cursor?: string;
|
|
40
|
+
}>;
|
|
41
|
+
}
|
|
42
|
+
declare function r2Store(bucket: R2BucketLike): ObjectStore;
|
|
43
|
+
|
|
44
|
+
export { ObjectStore, r2Store };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { LaQLError } from './chunk-VRJ72DGA.js';
|
|
2
|
+
export { AggregationBuilder, CacheApiCache, ERROR_CODES, IcebergRestCatalog, IcebergTable, IcebergUnsupportedCatalog, LaQLError, Lake, MemoryCache, MemoryCheckpointAdapter, MemoryObjectStore, MemorySpillAdapter, ObjectStoreIcebergCommitCatalog, PACKAGE, ParquetScanAdapter, QueryBuilder, QueryResult, ResumedQuery, 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, 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, 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, throwIfAborted, transitionTaskCheckpoint, verifyPaginationToken, withObjectStoreReadControls, writeOutputManifest, writeParquet, writePartitionedParquet, writePartitionedParquetTask } from './chunk-VRJ72DGA.js';
|
|
3
|
+
|
|
4
|
+
// ../r2/dist/index.js
|
|
5
|
+
function r2Store(bucket) {
|
|
6
|
+
return new R2ObjectStore(bucket);
|
|
7
|
+
}
|
|
8
|
+
var R2ObjectStore = class {
|
|
9
|
+
bucket;
|
|
10
|
+
constructor(bucket) {
|
|
11
|
+
this.bucket = bucket;
|
|
12
|
+
}
|
|
13
|
+
async get(path) {
|
|
14
|
+
const object = await this.bucket.get(path);
|
|
15
|
+
if (!object)
|
|
16
|
+
return null;
|
|
17
|
+
return new Uint8Array(await object.arrayBuffer());
|
|
18
|
+
}
|
|
19
|
+
async getRange(path, range) {
|
|
20
|
+
const object = await this.bucket.get(path, { range });
|
|
21
|
+
if (!object)
|
|
22
|
+
throw new LaQLError("LAQL_OBJECT_NOT_FOUND", `No object at ${path}`, { path });
|
|
23
|
+
return new Uint8Array(await object.arrayBuffer());
|
|
24
|
+
}
|
|
25
|
+
async put(path, body, options) {
|
|
26
|
+
const putOptions = {};
|
|
27
|
+
if (options?.contentType)
|
|
28
|
+
putOptions.httpMetadata = { contentType: options.contentType };
|
|
29
|
+
if (options?.metadata)
|
|
30
|
+
putOptions.customMetadata = options.metadata;
|
|
31
|
+
await this.bucket.put(path, body, putOptions);
|
|
32
|
+
}
|
|
33
|
+
async delete(path) {
|
|
34
|
+
await this.bucket.delete(path);
|
|
35
|
+
}
|
|
36
|
+
async *list(prefix, options) {
|
|
37
|
+
let cursor;
|
|
38
|
+
let emitted = 0;
|
|
39
|
+
do {
|
|
40
|
+
const listOptions = { prefix };
|
|
41
|
+
if (options?.limit !== void 0)
|
|
42
|
+
listOptions.limit = options.limit - emitted;
|
|
43
|
+
if (cursor !== void 0)
|
|
44
|
+
listOptions.cursor = cursor;
|
|
45
|
+
const result = await this.bucket.list(listOptions);
|
|
46
|
+
for (const object of result.objects) {
|
|
47
|
+
if (options?.limit !== void 0 && emitted >= options.limit)
|
|
48
|
+
return;
|
|
49
|
+
yield r2Info(object);
|
|
50
|
+
emitted += 1;
|
|
51
|
+
}
|
|
52
|
+
cursor = result.truncated === true ? result.cursor : void 0;
|
|
53
|
+
} while (cursor !== void 0 && (options?.limit === void 0 || emitted < options.limit));
|
|
54
|
+
}
|
|
55
|
+
async head(path) {
|
|
56
|
+
const object = await this.bucket.head(path);
|
|
57
|
+
if (!object)
|
|
58
|
+
return null;
|
|
59
|
+
const head = { size: object.size };
|
|
60
|
+
if (object.etag !== void 0)
|
|
61
|
+
head.etag = object.etag;
|
|
62
|
+
if (object.uploaded !== void 0)
|
|
63
|
+
head.lastModified = object.uploaded;
|
|
64
|
+
if (object.httpMetadata?.contentType !== void 0) {
|
|
65
|
+
head.contentType = object.httpMetadata.contentType;
|
|
66
|
+
}
|
|
67
|
+
return head;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
function r2Info(object) {
|
|
71
|
+
const info = { path: object.key, size: object.size };
|
|
72
|
+
if (object.etag !== void 0)
|
|
73
|
+
info.etag = object.etag;
|
|
74
|
+
if (object.uploaded !== void 0)
|
|
75
|
+
info.lastModified = object.uploaded;
|
|
76
|
+
return info;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export { r2Store };
|