CLI reference
timelake [-w <warehouse>] [-o key=value]... <command>Every command prints help with --help, for example timelake import --help. timelake --version prints the version.
Global options
| Flag | Meaning |
|---|---|
-w, --warehouse <url|path> | Warehouse location: s3://bucket/prefix, gs://…, az://…, file:///…, or a local path. Env: TIMELAKE_WAREHOUSE. Default ./warehouse. |
-o, --option <key=value> | Storage option, repeatable, e.g. -o aws_endpoint=http://localhost:9000 -o aws_allow_http=true. |
create
Create a table. The schema comes from a file (--from) or --schema.
timelake create iot.readings --from sample.parquet --time-column time --series-key device_id
timelake create iot.devices --schema "device_id:string,site:string,installed:date"| Flag | Meaning |
|---|---|
--from <file> | Take the schema from this Parquet or CSV file. |
--schema <name:type,…> | Schema inline, with Iceberg's type names: boolean, int, long, float, double, decimal(P,S), date, time, timestamp, timestamptz, timestamp_ns, timestamptz_ns, string, uuid, fixed[L], binary. Also bool, integer (int32), bigint (int64), real (float32), float64, text and varchar. |
--time-column <col> | The time column; makes this a time-series table. |
--series-key <a,b> | Columns that identify a series, comma-separated. |
--chunk <hour|day|month> | Time partition size (default day). Also accepts 1h, 1d, 24h, 1 month. |
--retention <dur> | Drop data older than this, e.g. 90d (units s, m, h, d, w, y). |
--no-dedup | Keep every row with the same (series, time): when appending, reading, and compacting. |
--no-ingest-time | Leave out the _ingest_ts column, which records when each row was inserted. |
--prop <k=v> | A table setting or Iceberg property, e.g. --prop retention=90d; repeatable. |
append
Append Parquet or CSV files to an existing table.
timelake append iot.readings day1.parquet day2.parquet --batch-id load-2026-01| Flag | Meaning |
|---|---|
--rows-per-commit <n> | Rows per commit (default 10,000,000; 0 = one commit per input file). |
--no-maintain | Skip inline auto-maintenance after each commit. |
--batch-id <id> | Idempotency key; the commit number is appended (id-0, id-1, …), so re-running the same load is a no-op. |
import
Create the table if it doesn’t exist (schema from the first file, or --from/--schema), then append the files. Takes the flags of both create and append.
timelake import iot.readings readings/*.parquet --time-column time --series-key device_id --retention 365dInputs: .parquet files or directories of Parquet, and .csv, .csv.gz, and .tsv with a header row.
sql
Run SQL given as an argument or on stdin. Several statements separated by ; run in order. Besides queries, it runs CREATE, DROP, and REFRESH MATERIALIZED ROLLUP (see Rollups).
timelake sql "SELECT count(*) FROM iot.readings"
echo "SELECT * FROM readings LIMIT 5" | timelake sql --namespace iot --format csv| Flag | Meaning |
|---|---|
--format <table|csv|json|none> | Output format (default table). json writes one JSON object per line (newline-delimited), nulls included. none prints only the row count. |
--namespace <ns> | Namespace for unqualified table names (default default). |
--set <key=value> | A DataFusion or Timelake setting, e.g. --set datafusion.execution.target_partitions=32 or --set read_dedup=false (timelake. is added to a name without a prefix). |
latest
Print the newest row of every series. It reads the last-value index; a table without one (for example, one first written by another tool) is scanned instead. Takes --format like sql.
$ timelake latest iot.readings --format json
{"time":"2026-01-05T10:15:00","device_id":"pump-1","temp":64.0,"humidity":40}
{"time":"2026-01-05T10:10:00","device_id":"pump-2","temp":60.2,"humidity":44}maintain
Compact, apply retention, refresh rollups, and expire snapshots, for the given tables or all tables.
timelake maintain
timelake maintain iot.readings --no-expire| Flag | Meaning |
|---|---|
--no-compact | Skip compaction. |
--no-retention | Skip dropping partitions past the retention period. |
--no-expire | Skip snapshot expiry and file cleanup. |
--no-rollups | Skip refreshing the tables' rollups. |
Each table gets a line saying what each step did: partitions and files compacted, rows, duplicates removed and megabytes read, partitions and files dropped, rollups refreshed, snapshots expired, and objects deleted. One merge reads at most 24 files; when a partition needed more, the line ends its compaction part with "more to compact, run again".
upgrade
Bring tables to the current format: record the format version, build a missing last-value index, rewrite unsorted or small files, write the head. Every step is a commit, and no snapshot expires for --keep-snapshots, so rollback undoes it. All tables if none are given. See Upgrading.
timelake upgrade --dry-run
timelake upgrade iot.readings| Flag | Meaning |
|---|---|
--dry-run | Only print what would change. |
--no-compact | Don't rewrite files. |
--keep-snapshots | How long every snapshot is kept so the upgrade can be undone (default 7d). |
alter
Change a table's settings. Each change is checked against the settings registry, and all of them are committed together as new table metadata (no new snapshot).
timelake alter iot.readings --set read-dedup=false --set retention=90d
timelake alter iot.readings --unset retention| Flag | Meaning |
|---|---|
--set <name=value> | Set a setting (read-dedup, timelake.read_dedup, …) or an Iceberg property; repeatable. |
--unset <name> | Remove one, so its default applies again; repeatable. |
settings
List every setting with its default, the levels it can be set at, and the first sentence of its description. With a
table, show the table's values, with defaults in parentheses. --json prints everything, descriptions included.
timelake settings
timelake settings iot.readings --jsonrollback
Make an earlier snapshot current again: timelake rollback <table> <snapshot id>. The ids are in timelake info; upgrade prints the command that undoes it.
info
Show a table’s contract, schema, size, snapshots, last-value index, and newest partitions.
timelake info iot.readings
timelake info iot.readings --jsonls
List tables as namespace.table; --json prints a JSON array.
duckdb
Print the DuckDB SQL that reads a table without Timelake, plus the location of its last-value index.
index
Rewrite timelake-tables.json in the warehouse root, the list of tables that readers use when they can't list objects (plain HTTPS, browsers, @timelake/client). Creating and dropping tables updates it automatically, so run this only after copying tables in by other means.
drop
Delete a table and all of its files. This cannot be undone.