Data Prep
The model describes the warehouse. Data prep is for the rows that are not in it: a budget in a spreadsheet, a store list from ops, targets an agent collected, a query result someone wants to fix up by hand. Since 0.7.4 the server keeps them, shapes them with a graph your application sends, and joins them beside a model query when a request asks.
curl -s -X POST "http://127.0.0.1:3699/projects/shop/sources?file_name=budget.csv&dataset=true&name=Q3%20budget" \
--data-binary @budget.csv
The answer, 201, with the source and snapshot abridged (Sources has them whole):
{
"source": {"id": "src_4a1382f7ca617fc6", "kind": "upload", "name": "Q3 budget", "snapshot": 1, "read": 1},
"snapshot": {"source": "src_4a1382f7ca617fc6", "number": 1, "kind": "upload", "file_name": "budget.csv", "rows": 3},
"dataset": {"id": "ds_99a09f6e1d595492", "name": "Q3 budget", "live": 1, "made": 1, "rows": 3,
"columns": [{"name": "region", "role": "dimension", "type": "text"},
{"name": "budget", "role": "measure", "type": "integer"}],
"created": "2026-11-28T19:27:02.710Z", "updated": "2026-11-28T19:27:02.710Z"}
}
One upload made a source, its first snapshot, and a dataset over it that copies nothing. The file was three lines under a header, region,budget. Now the budget sits beside revenue from the warehouse:
curl -s http://127.0.0.1:3699/projects/shop/branches/main/blend \
-H "Content-Type: application/json" \
-d '{"spec": {"projections": [{"field": "Region"}, {"field": "Revenue"}, {"field": "budget.budget", "alias": "Budget"}]},
"datasets": [{"id": "ds_99a09f6e1d595492", "as": "budget"}],
"blend": [{"join": "budget", "to": "model", "on": [{"left": "Region", "right": "budget.region"}], "kind": "enrich"}]}'
{"columns": [{"name": "Region", "type": "string", "arrow_type": "Utf8"},
{"name": "Revenue", "type": "decimal", "arrow_type": "Decimal128(38, 2)"},
{"name": "Budget", "type": "integer", "arrow_type": "Int64"}],
"rows": [["MW", "10.86", 12], ["NE", "24.85", 30], ["SO", null, 5]],
"total": 3, "offset": 0, "complete": true, "cache": "miss",
"model": {"result": "r-20261128-9f27613695a3b7c721c4", "sql": "SELECT\n\tT0.\"region\" AS \"__m0\",\n\tsum(T0.\"revenue\") AS \"__m1\"\nFROM\n\torders T0\nGROUP BY\n\tT0.\"region\""},
"datasets": [{"id": "ds_99a09f6e1d595492", "version": 1}]}
Three things
| is | made by | kept as | |
|---|---|---|---|
| Source | where rows come from: an upload, a push or a query | a request to POST .../sources | immutable snapshots, one per file, post or pull |
| Graph | a pipeline: source and dataset nodes, steps, joins, appends, SQL, edits, one output | your application, which keeps it and sends it with every run | a copy beside each output it made |
| Dataset | what is browsed, shared and blended | a run of a graph, or a source as it is | immutable versions, each with its lineage and run record |
Your application builds the graph, keeps it, and decides when it runs. Nothing runs unasked: a new snapshot changes no dataset until the next run that reads it.
What it never touches
The model. A dataset is in no catalog: not in fields, tables, explore, sampled values or what an MCP client is told. A model plans byte for byte the same SQL with datasets present, and a dataset’s columns are reachable only from a blend request that attaches it under an alias. The planner does not depend on data prep and cannot see a dataset.
The warehouse, except through the model. A query source runs a spec on a deployed branch exactly as /run does, under the context the run was sent with. Graphs run in the server, in an embedded DuckDB with external access off: a step reads no file and no URL, only its inputs.
Access
The server keeps no users, for data prep as for everything else. Sources and datasets belong to a project, addressed by id, and anyone who reaches the server can read, change or delete any of them. Every answer that reads inputs (a run, a dry run, a preview) carries reads, each source and dataset by kind and id, for your application to check against who is asking:
"reads": [{"kind": "source", "id": "src_be28bf24ae006946"}, {"kind": "source", "id": "src_496cb47f693068fc"}]
Deciding who may upload, run, read or delete is your application’s job, as it is for deploys and queries. See securing access.
Routes
Every route is also served under /orgs/{org}; without the prefix the org is default. A source or dataset can be made only in a project deployed on some branch of the org.
| Route | Does |
|---|---|
GET/POST /projects/{uid}/sources | list sources; make one from a CSV, pushed rows or a query (Sources) |
GET/PATCH/DELETE /projects/{uid}/sources/{id} | one source; rename it, retype its columns; delete it |
GET/POST /projects/{uid}/sources/{id}/snapshots, GET .../snapshots/{n} | its snapshots; add one |
GET /projects/{uid}/sources/{id}/rows | a page of a snapshot |
GET/POST /projects/{uid}/datasets, GET/DELETE .../datasets/{id} | datasets (Datasets) |
GET .../datasets/{id}/rows, .../lineage, .../versions/{k} | a page of an output, what made it |
POST /projects/{uid}/runs, GET .../runs/{id} | run a graph; its record (Graphs and runs) |
POST /projects/{uid}/runs?check=true | a dry run |
POST /projects/{uid}/preview | run part of a graph over a sample, keeping nothing |
POST /projects/{uid}/branches/{branch}/blend | a model query with datasets joined beside it (Blend) |
POST /datasets/restore | bring back what the object store has and this node does not |
The full request and answer shapes are in the API reference. There are no zsql commands for data prep: it is driven over HTTP by an application.
Settings
Data prep is on unless the server is started with it off. Off, every route above answers 404:
{"error": {"class": "NotFound", "message": "datasets are turned off on this server (ZSQL_DATASETS=off)"}}
| Variable | Default | Bounds |
|---|---|---|
ZSQL_DATASETS | on | off turns data prep off; on, off, 1, 0, true, false, yes, no |
ZSQL_DATASET_MAX_ROWS | 1,000,000 | the most rows a snapshot or an output holds |
ZSQL_DATASET_MAX_BYTES | 268435456 (256 MiB) | the most bytes an upload is, and the most a snapshot or an output is as the compressed Parquet file kept; also the body limit of the upload routes |
ZSQL_PREP_MEMORY | 1GB | the embedded engine’s memory limit; it spills under the data directory past it |
ZSQL_PREP_THREADS | 2 | the engine’s threads |
ZSQL_ADMIT_PREP | cores ÷ 2, at least 2 | data prep requests the server works on at once; past it, 503 Busy with Retry-After |
Other bounds are fixed: a CSV has at most 4,096 columns, a field at most 1 MiB, and a file at most 33,554,432 values; a graph at most 200 nodes, a steps node at most 500 steps, an edits node at most 10,000 edits; a formula at most 4,096 characters; a sql step runs at most 60 seconds. A data prep request has the 90-second deadline of the execution routes.
Where it is kept
Under the data directory, beside the project’s deployed branches, in a directory no branch name can take:
<data-dir>/<org>/<project>/.datasets/
.sources/<src>/source.json a source: kind, name, how it is read
.sources/<src>/snapshots/<n>/ rows.parquet and its manifest
<ds>/dataset.json a dataset's manifest, written last
<ds>/v<k>/ an output: rows.parquet, or a pointer to a snapshot;
manifest, lineage, run record, graph
.runs/<run>.json a run's record
Rows are Parquet files (zstd, with a page index), so a page is read without decoding the rows before it. Nothing is changed in place: each thing is written beside where it goes and renamed there, with its manifest last, so a crash leaves things as they were before the job. A deploy, a redeploy, a branch removed and a restart all leave .datasets alone. Removing the project (DELETE /projects/{uid}) removes its sources and datasets and lists them in its answer under datasets.
A restart does not run anything again. A run or job that was going when the server crashed or stopped is marked interrupted (cause crash or stop) on its record and on its dataset or source, until its next run. A stopping server gives running jobs its grace period to finish first.
Backup and restore
With ZSQL_OBJECT_STORE set, each source and dataset is copied there as it changes, and its manifest says how that went (backup.at, and backup.failed when the copy did not succeed; a failed copy fails nothing else). After a lost disk, or on a new node, bring them back:
curl -s -X POST http://127.0.0.1:3699/datasets/restore
{"restored": ["shop/src_f5cb70f6258f056c", "shop/ds_17d94dc946e0c8fd"]}
It restores every dataset and source of the org that the object store has whole and this node does not, as project/id. Without an object store it is refused:
{"error": {"class": "Invalid", "message": "there is no object store to restore from (ZSQL_OBJECT_STORE)"}}
Next steps
- Sources and snapshots: uploads, pushes and query sources
- Datasets: versions, lineage and reading rows
- Graphs and runs: nodes, runs, dry runs and previews
- Steps and formulas: every step and the formula language
- Edits: changes made by hand, carried in the graph
- Blend: a dataset beside a model query