# Load a CSV kept with the project

Acquire / file

A variant of [Read a CSV or delimited file](https://meridian.online/operations/read-a-csv-or-delimited-file).

Load a static CSV file stored alongside the pipeline code into the warehouse as a table.

Page: <https://meridian.online/operations/read-a-csv-or-delimited-file/load-a-csv-kept-with-the-project>

## Status

Runs as a SQL step.

arcform carries it as a `sql:` step today.

## The DuckDB step

load a CSV kept with the project as a table, typed and replaced on every run

```sql
-- the seed file sits beside the pipeline code; it is written here only so the proof has one to read
COPY (SELECT * FROM (VALUES ('north', '007', 5000.00), ('south', '012', 4200.50), ('east', '103', NULL), ('west', '018', 3100.00)) t(region, code, target))
  TO '<your_scratch_dir>/seed_regions.csv' (HEADER);
CREATE OR REPLACE TABLE seed_regions AS
SELECT * FROM read_csv('<your_scratch_dir>/seed_regions.csv', header = true, columns = {'region': 'VARCHAR', 'code': 'VARCHAR', 'target': 'DECIMAL(10, 2)'});
-- a second run replaces the table and does not append to it
CREATE OR REPLACE TABLE seed_regions AS
SELECT * FROM read_csv('<your_scratch_dir>/seed_regions.csv', header = true, columns = {'region': 'VARCHAR', 'code': 'VARCHAR', 'target': 'DECIMAL(10, 2)'});
SELECT * FROM seed_regions;
SELECT CASE WHEN ((SELECT count(*) FROM duckdb_tables() WHERE table_name = 'seed_regions') = 1 AND (SELECT count(*) = 4 AND count(target) = 3 AND sum(target) = 12300.50 AND max(code) FILTER (WHERE region = 'north') = '007' FROM seed_regions) AND (SELECT list(column_type) FROM (DESCRIBE seed_regions)) = ['VARCHAR', 'VARCHAR', 'DECIMAL(10,2)']) THEN 'as expected' ELSE error('the seed did not load as one table of 4 rows with the code 007 kept as text and the target a decimal') END AS verdict;
```

Replace `<your_scratch_dir>` with a directory of your own that you can write to before running the statement.

The statement writes `seed_regions.csv` itself, in `<your_scratch_dir>`.

It needs nothing installed beyond DuckDB itself.

## What other tools call it

Meridian's classification; an independent blind rating agreed on 95.7% of 324 rows (variant, version 3).

- Bruin: [`Seed assets (family)`](https://getbruin.com/docs/bruin/assets/seed.html) (read 2026-09-27)
- dbt-utils: [`seed`](https://docs.getdbt.com/docs/build/seeds) (read 2026-09-27)
- SQLMesh: [`SEED`](https://github.com/SQLMesh/sqlmesh/blob/23b237cea7218cc8f338b89c14f0957394a0003b/docs/concepts/models/model_kinds.md) (read 2026-09-27)
