Clean and order a raw CSV with a Data Prep pipeline

Outcome: complete this walkthrough and you will have built and run a Data Prep pipeline that reads a raw CSV from managed S3, cleans it (remove duplicates on county+year), orders it (sort by year), and writes the result to a managed-S3 output — all from the UI on the Serverless DuckDB engine · Time: ~7 min active · ~10 min elapsed (waits included)

Before you start

Steps

1. Open the pipeline builder

In the left sidebar under Processing, click Pipelines. A fresh Untitled Pipeline canvas opens.

Locator: Processing → Pipelines

2. Name the pipeline

Click the Pipeline Name field and type county-wages-clean.

Locator: Pipeline Name textbox

3. Add the input: read from managed S3

Click + Add step. In the wizard under Get data pick Managed S3. Set File Pattern to data/county-wages.csv and Format to csv, then click Add step → and Save step.

Locator: + Add step → Get data → Managed S3 → File Pattern / Format

4. Clean: remove duplicates

Click + Add step → under Clean data pick Remove duplicates. Set Key Columns to county_fips and year (a county+year should appear once), Keep = first. Click Add step → and Save step.

Locator: + Add step → Clean data → Remove duplicates → Key Columns

5. Order: sort by year

Click + Add step → under Reshape pick Sort rows. Set Column to year, Direction ascending. Click Add step → and Save step.

Locator: + Add step → Reshape → Sort rows → Column / Direction

6. Add the output: save to managed S3

Click + Add step → under Model & deliver pick Save to S3. Set Output Path to k3ld-walkthroughs/W8-data-prep/output (Format stays csv). Click Add step → and Save step.

Locator: + Add step → Model & deliver → Save to S3 → Output Path

7. Check it's Ready

Look at the status pill next to the node count.

Locator: Ready status pill

Pipeline builder: county-wages-clean, 4 nodes — Managed S3 read (data/county-wages.csv) → Dedup (county_fips, year) → Sort (year asc) → Managed S3 output; status Ready

8. Run it

Click Run. It executes on the Serverless engine (DuckDB) — seconds, no GPU.

Locator: Run (orange button)

9. Read the result

In the results modal, expand Stage execution / Step execution to see each cleaning step's status, then expand Final Compiled SQL to see what DuckDB ran.

Locator: Pipeline Results modal

Pipeline Results modal: DuckDB, 1,000 rows, 5/5 steps done — Pipeline, Managed S3, Dedup, Sort, Managed S3 all checked

10. Preview the output file in Files

Read the success line under the results (s3://…/k3ld-walkthroughs/W8-data-prep/output/pipeline-….csv), then open Catalog → Files and navigate to k3ld-walkthroughs → W8-data-prep → output. Click the Preview (eye) icon on the CSV.

Locator: Catalog → Files → k3ld-walkthroughs/W8-data-prep/output → Preview (eye)

CSV preview in Files: k3ld-walkthroughs/W8-data-prep/output/pipeline-49132702-….csv (CSV, 35.9 KB) with the cleaned table — county_fips, year, empl, wages, wkly, annpay — sorted by year ascending

Expected result

When the steps are done:

Start over & leftovers

Each run writes a NEW pipeline--.csv under the output folder — old runs are never overwritten. If you set Output Path to k3ld-walkthroughs/W8-data-prep/output, delete the k3ld-walkthroughs folder from Files to remove every run's output. If you left it unset, the file lands under pipe-canvas-/run-/output/ (delete that pipe-canvas folder). To remove the saved pipeline, use Pipelines → Pipeline menu → Load… → delete on county-wages-clean.

Try variations

  1. Insert other cleaning steps between input and output (+ Add step → Clean data): Filter rows (e.g. empl > 0), Fix column types, Rename columns.
  2. Swap Sort for Aggregate (Summarize by group, e.g. total wages by year) to turn cleaning into analysis.
  3. Point the input at a glob (e.g. data/fineweb_*.jsonl) to read many files, or change output Format to parquet.

Terms used


Walkthrough W8-data-prep-pipeline · verified against build server v130 + frontend (2026-09-03) · role editor. Scenario Pack source: walkthroughs/W8-data-prep-pipeline/. This page is rendered from scenario.json — edit that, not this.

Input is the demo file data/county-wages.csv (existing demo data on the tenant).