lakeql 0.1.0 → 0.1.2
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 +96 -17
- package/dist/bin.js +8822 -0
- package/dist/{chunk-VRJ72DGA.js → chunk-D3A4VN3U.js} +246 -1393
- package/dist/chunk-MUTXXFOW.js +1379 -0
- package/dist/cloudflare.d.ts +1 -1
- package/dist/cloudflare.js +3 -2
- package/dist/index.d.ts +41 -8
- package/dist/index.js +2 -1
- package/dist/node.d.ts +1 -1
- package/dist/node.js +3 -2
- package/package.json +20 -17
package/README.md
CHANGED
|
@@ -1,25 +1,104 @@
|
|
|
1
|
-
#
|
|
1
|
+
# lakeql
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/lakeql)
|
|
4
|
+
[](https://github.com/earonesty/lakeql/blob/main/LICENSE)
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
**Query Parquet and Iceberg tables directly from object storage, in TypeScript.**
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
lakeql is small and dependency-light enough to run in **Cloudflare Workers and
|
|
9
|
+
other edge/serverless runtimes**, where DuckDB-WASM or a JVM engine is too heavy.
|
|
10
|
+
It streams with HTTP range reads and bounded memory, and either reads a table
|
|
11
|
+
correctly or rejects it with a typed error — it won't return quietly-wrong rows.
|
|
9
12
|
|
|
10
|
-
|
|
13
|
+
▶ **Try it live in your browser:** https://lakeql.com/
|
|
11
14
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
- `scanBatches(plan, options)` yields row batches from Parquet files or delete-aware Iceberg plans.
|
|
16
|
-
- `scanRows(plan, options)` yields rows one at a time over the same plans.
|
|
15
|
+
```sh
|
|
16
|
+
npm install lakeql
|
|
17
|
+
```
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
HTTP, R2, S3, or core object-store control.
|
|
19
|
+
## Quick start
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
Read a Parquet file over HTTP — no credentials, runs in Node or on the edge:
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
```ts
|
|
24
|
+
import { createLake, httpStore, gt } from "lakeql/node";
|
|
25
|
+
|
|
26
|
+
const lake = createLake({ store: httpStore({ baseUrl: "https://example.com/data" }) });
|
|
27
|
+
|
|
28
|
+
const rows = await lake
|
|
29
|
+
.path("sales.parquet")
|
|
30
|
+
.select(["store_id", "amount"])
|
|
31
|
+
.where(gt("amount", 100))
|
|
32
|
+
.limit(100)
|
|
33
|
+
.toArray();
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Inside a Cloudflare Worker, reading from R2:
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
import { createLake, r2Store } from "lakeql/cloudflare";
|
|
40
|
+
|
|
41
|
+
export default {
|
|
42
|
+
async fetch(_req: Request, env: { DATA: R2Bucket }) {
|
|
43
|
+
const lake = createLake({
|
|
44
|
+
store: r2Store(env.DATA),
|
|
45
|
+
budget: { maxOutputRows: 1000, maxConcurrentReads: 4 },
|
|
46
|
+
});
|
|
47
|
+
const rows = await lake.path("sales.parquet").limit(100).toArray();
|
|
48
|
+
return Response.json(rows);
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Plan an Iceberg table (snapshot selection, partition- and delete-aware pruning):
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
import { loadIcebergTable, eq } from "lakeql/node";
|
|
57
|
+
|
|
58
|
+
const table = await loadIcebergTable({
|
|
59
|
+
store: httpStore({ baseUrl: "https://example.com/warehouse" }),
|
|
60
|
+
metadataPath: "places/metadata/v2.metadata.json",
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
const plan = table.planFiles({ ref: "main", where: eq("country", "US") });
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Entry points
|
|
67
|
+
|
|
68
|
+
| Import | Adds |
|
|
69
|
+
| --- | --- |
|
|
70
|
+
| `lakeql` | Core query engine, Parquet, Iceberg, and the unified `loadTable` / `planFiles` / `scanRows` / `scanBatches` helpers. |
|
|
71
|
+
| `lakeql/node` | Everything in `lakeql`, plus `httpStore` and `s3Store`. |
|
|
72
|
+
| `lakeql/cloudflare` | Everything in `lakeql`, plus `r2Store`. |
|
|
73
|
+
|
|
74
|
+
## CLI
|
|
75
|
+
|
|
76
|
+
A global install adds a `lakeql` command for quick local queries:
|
|
77
|
+
|
|
78
|
+
```sh
|
|
79
|
+
npm install -g lakeql
|
|
80
|
+
lakeql query --path sales.parquet --sql "select region, sum(amount) as revenue from input group by region order by revenue desc"
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## What it supports
|
|
84
|
+
|
|
85
|
+
lakeql aims to read supported Parquet and Iceberg features correctly and reject
|
|
86
|
+
unsupported table semantics explicitly. See the
|
|
87
|
+
[compatibility matrix](https://github.com/earonesty/lakeql/blob/main/docs/compatibility.md)
|
|
88
|
+
and [unsupported-but-detected](https://github.com/earonesty/lakeql/blob/main/docs/unsupported.md).
|
|
89
|
+
Object-store adapters (`httpStore`, `s3Store`, `r2Store`) use HTTP range reads by
|
|
90
|
+
default; Iceberg writes are append-only.
|
|
91
|
+
|
|
92
|
+
## Documentation
|
|
93
|
+
|
|
94
|
+
Full docs, recipes, and the engine contract live in the
|
|
95
|
+
[repository](https://github.com/earonesty/lakeql#readme):
|
|
96
|
+
[querying Parquet](https://github.com/earonesty/lakeql/blob/main/docs/querying-parquet.md) ·
|
|
97
|
+
[querying Iceberg](https://github.com/earonesty/lakeql/blob/main/docs/querying-iceberg.md) ·
|
|
98
|
+
[Cloudflare Workers](https://github.com/earonesty/lakeql/blob/main/docs/cloudflare-workers.md) ·
|
|
99
|
+
[error codes](https://github.com/earonesty/lakeql/blob/main/docs/errors.md) ·
|
|
100
|
+
[why not DuckDB-WASM?](https://github.com/earonesty/lakeql/blob/main/docs/why-not-duckdb-wasm.md)
|
|
101
|
+
|
|
102
|
+
## License
|
|
103
|
+
|
|
104
|
+
MIT
|