Upstream

How to use Upstream

Upstream reads the SQL behind your data and draws a map of where every column comes from and where it goes. This page explains what that's good for, what each part of the screen does, and then walks through the four things people use it for most.

  1. Purpose, in plain English
  2. What Upstream is for
  3. The parts of the screen
  4. Reading the map
  5. Walkthroughs
  6. The health checks, explained
  7. Questions

Purpose, in plain English

Upstream answers two questions about any number or field in your data: where did this come from, and what else depends on it?

You bring

Your SQL

The queries that build your tables. Plain SQL works, and so does a dbt project, the most common way teams organize this kind of SQL.

Upstream reads

Every column, every step

It follows each column through renames, calculations, joins and totals, all the way back to the raw table it started in.

You get

A map and a warning

A picture of how your data flows, a list of where personal data ends up, and a heads-up before a change breaks something.

You'll want it when…

What Upstream is for

The idea behind it is called data lineage: knowing the family tree of every piece of data. Big companies pay for tools that do this. Here's what it looks like in real situations.

An analyst

"Why doesn't revenue match?"

Finance says the dashboard's revenue is lower than their spreadsheet. You click revenue in the daily revenue table and see it's built from line totals that already have discounts taken off. Mystery solved in a minute.

Use: click the column, read "How it got here".
A privacy or security team

"Where do customer emails go?"

An audit asks every place an email address is stored or shared. The personal data report lists every final table still showing it, plus which raw column it came from, ready to download.

Use: the "Where personal data ends up" report.
A data engineer

"Can I delete this column?"

A raw table has a column nobody seems to use. Before removing it, you preview dropping it. If nothing turns red, it's safe. If three dashboards light up, you know who to warn.

Use: click the column, then Preview dropping it.
A consultant on a new client

"What am I walking into?"

First week on a client's data warehouse. You upload their dbt project and read the health checks: personal data in the wrong places, models nobody uses, risky SELECT *. That's your first-week findings deck.

Use: upload manifest.json, read Health checks.
A reviewer

"Is this change safe?"

A teammate wants to hash emails in a staging model. You paste their version in and review it: it would break two columns downstream, so they need to update those too before it ships.

Use: Edit and review on the model.
Anyone learning SQL

"What is this query actually doing?"

Paste a long query full of CTEs and joins. The map shows which columns feed which, and the side panel highlights the exact line in the SQL that makes each one.

Use: paste it, click any column.

The parts of the screen

The guided tour points at each of these on the real page. Here they are in order, top to bottom.

  1. Toolbar

    Paste your models, Upload files (SQL files, a dbt sources.yml or manifest.json) and Load the sample. Next to them: search, Focus on selection and Personal data only, plus quick counts and the health score.

  2. Model list

    Every table, grouped into layers: source raw tables, staging cleaned up, intermediate combined, and mart what people actually read. A magenta dot means personal data, yellow means a warning, and red means an error.

  3. The map

    One card per table and one row per column. Data flows left to right. Click a column to trace it, or click a card's name to see the whole table. Drag the background to move around, and use + / − / Fit to zoom.

  4. Side panel

    Everything about what you clicked: what kind of data it is, how it was made, every step from the raw table, the highlighted line in the SQL, and what depends on it. It's also where you edit a model and review the change.

  5. Health checks

    A score out of 100 and a list of problems found in the SQL. Show me jumps to each one.

  6. Personal data report

    Every column in a final table that still carries personal data, with where it came from. Download it as a CSV, or download the whole lineage as JSON.

Reading the map

Three small sets of symbols carry most of the information.

How a column was made

=
Passed through unchanged
as
Same value, new name
fx
Calculated from other columns
#
Hashed or masked, like md5(email) or the last four digits of a card
Σ
Aggregated: SUM, COUNT, MAX…
win
Window function, like a running total or rank
k
A fixed value

Personal data

Readable. The real value is there to see.
Hashed or masked. Not readable, but a hash of an email can still be matched to the same email elsewhere.
Only in totals. Counted or summed, so no single person's value shows.

MIN, MAX and ANY_VALUE return a real value from the group, so personal data stays readable through them.

Lines

Comes from: everything the selected column was built from
Feeds into: everything built on top of it
Would break if you went ahead with a drop or a change

With Focus on selection on, everything not on the path is hidden. Show everything brings it back.

Walkthroughs

These use the sample store that loads the first time you open Upstream. If you've loaded something else, click Load the sample first.

1. Find where a number comes from

about 1 minute

Trace the revenue on the daily revenue table back to the raw data.

  1. In the model list, click mart_daily_revenue under Marts.Its card is outlined on the map and the side panel shows the table.
  2. On the map, click the revenue column.Everything else is hidden. Blue lines run back through the tables it was built from.
  3. In the side panel, read How it got here.Revenue is a SUM of line_total, and line_total is quantity × unit price minus discount. So revenue is already net of discounts.
  4. Scroll to In the SQL to see the exact line, highlighted.

2. Follow personal data

about 2 minutes

Find every place a customer's email address ends up.

  1. Click raw.customers in the model list, then click email on its card.The magenta dot means it's personal data. Upstream guessed that from the name. You can change it in the side panel.
  2. Follow the amber line to the right.It passes through stg_customers and dim_customers and ends in mart_marketing_audience, which a comment in its SQL says is sent to an email vendor every night.
  3. Scroll down to Where personal data ends up.The email shows as Readable in that final table, along with the name and zip code.
  4. Click Download this report (CSV) if you need to hand it to someone.
Compare: click raw.web_events.ip_address. It's hashed in staging, so it reaches the final table as Hashed, not readable.

3. Check a change before you make it

about 2 minutes

Hash the email in staging and see what that would break.

  1. Click stg_customers in the model list, then Edit and review next to its SQL.
  2. Change the line lower(trim(email)) as email, to md5(lower(trim(email))) as email_hash,
  3. Read the review under the editor.It says email was removed and email_hash added, and that dim_customers.email and mart_marketing_audience.email would break. Those turn red on the map.
  4. Click Discard to throw it away, or Apply change to keep it.Nothing is saved until you apply.
Then try a safe change: rename the alias back to email but keep the md5(...). Nothing breaks, and the review shows the email is now better protected downstream.

4. Load your own project

2 to 5 minutes

Three ways in, from quickest to most complete.

  1. Paste. Click Paste your models and put -- model: name above each query. Optionally list raw tables under -- sources.
  2. Upload SQL files. Each .sql file becomes a model named after the file. Add your dbt sources.yml in the same upload to bring in source columns.
  3. Upload a dbt manifest. Run dbt compile, then upload target/manifest.json. Upstream reads the compiled SQL for every model, so macros are already expanded.
-- sources
raw.orders: id, customer_id, total, created_at

-- model: stg_orders
select id as order_id, customer_id, total
from raw.orders

-- model: customer_totals
select customer_id, sum(total) as lifetime_total
from stg_orders
group by customer_id
Tables you don't list under sources still work. Upstream learns their columns from how the queries use them, and the health checks remind you to declare them.

The health checks, explained

Each check looks for a real problem that data and governance teams run into. The score starts at 100 and drops 12 for each high, 5 for each medium and 1 for each low finding (up to 10 for lows).

CheckLevelWhy it mattersWhat to do
Personal data readable in a final modelhighFinal tables feed dashboards, exports and vendors, so anyone who can read them can read the data.Confirm every reader should see it, or mask it upstream.
Government ID or financial data readablehighSSNs, passports and full card numbers carry the biggest risk if they leak.Truncate, hash or drop it as early as possible.
Missing columnhighA query uses a column the table doesn't have, so it will fail when it runs.Fix the name, or add the column upstream.
Model can't be readhighA syntax error or a circular dependency.Open the model and read the error.
Personal data loaded but never usedmediumData you hold but don't need is still risk. Collecting less is the simplest privacy control.Stop loading it.
SELECT * in a final modelmediumA new column upstream, personal data included, flows straight through without anyone deciding it should.List the columns explicitly.
Unresolved referencesmediumAn ambiguous or unknown column, so the lineage for it may be incomplete.Qualify it with a table alias.
Hashed identifiers in a final modellowA hashed email can still be matched to the same email hashed elsewhere.Treat it as pseudonymous, not anonymous.
Mart reads raw tables directlylowIt skips staging, so cleaning rules aren't applied the same way everywhere.Read from the staging model instead.
Model nobody useslowA staging or intermediate model with no readers is usually leftover.Delete it, or connect it.
Unused columns / undeclared sourceslowHousekeeping that keeps the map accurate.Trim or declare them.

Questions

Does Upstream run my queries or see my data?

No. It only reads the text of the SQL. It never connects to a database and never sees a single row. Your project is saved in this browser's storage and nothing is uploaded anywhere.

Which SQL does it understand?

Standard SELECT queries with CTEs, subqueries, joins (including USING), UNION, window functions, CASE, casts and common functions. It also handles Snowflake SELECT * EXCLUDE, BigQuery SELECT * EXCEPT, referring to an earlier alias in the same SELECT, and dbt ref() and source().

What can't it see?
  • Dynamic SQL and stored procedures
  • Jinja macros, unless you upload a compiled manifest.json
  • What happens inside custom functions (UDFs). It sees what goes in and out, not how.
  • Columns from SELECT * on a table whose columns it doesn't know. List those under sources.

When it isn't sure, it says so in the warnings instead of guessing.

How does it decide what's personal data?

By column name: email, phone, first and last name, address, zip code, birth date, SSN, passport, card number, IP address and so on. Names can be misleading, so click any raw column and set its tag yourself. Every column downstream updates.

Why is MAX(email) still personal, but COUNT(email) isn't?

MAX, MIN and ANY_VALUE return one real value from the group, so an actual email address comes out. COUNT and SUM return a number about the group, so no single person's value shows.

What does "Rows also depend on" mean?

Columns in WHERE, JOIN, GROUP BY, HAVING and QUALIFY don't appear in the result, but they decide which rows are in it. If someone changes how status is spelled, a filter on it can quietly drop rows. Upstream lists those columns separately for each model.

Is this a replacement for dbt docs or a data catalog?

No. Those tools connect to your warehouse and cover much more. Upstream is for quick, private answers from the SQL alone: no setup, no accounts, and nothing to install.

Ready to trace something?

Open Upstream with the sample loaded, or take the tour first.