Skip to content

Latest commit

 

History

History
105 lines (76 loc) · 2.29 KB

get-started-jaffle-shop.md

File metadata and controls

105 lines (76 loc) · 2.29 KB

Getting Started by Jaffle Shop

Jaffle Shop is an example project officially provided by dbt-labs. This document uses jaffle_shop_duckdb to enable you to start using recce locally from scratch within five minutes.

  1. Clone the “Jaffle Shop” dbt data project

    git clone [email protected]:dbt-labs/jaffle_shop_duckdb.git
    cd jaffle_shop_duckdb
  2. Prepare virtual env

    python -m venv venv
    source venv/bin/activate
  3. Installation

    pip install -r requirements.txt
    pip install recce
  4. Provide additional environment to compare. Edit ./profiles.yml to add one more target.

    jaffle_shop:
        target: dev
        outputs:
        dev:
            type: duckdb
            path: 'jaffle_shop.duckdb'
            threads: 24
    +   prod:
    +     type: duckdb
    +     path: 'jaffle_shop.duckdb'
    +     schema: prod
    +     threads: 24
  5. Prepare production environment

    dbt build --target prod
    dbt docs generate --target prod

    and copy the artifacts to ./target-base/

    cp -R target/ target-base/
  6. Prepare development environment. First, edit an existing model ./models/staging/stg_payments.sql.

    ...
    
    renamed as (
             payment_method,
    
    -        -- `amount` is currently stored in cents, so we convert it to dollars
    -        amount / 100 as amount
    +        amount
    
             from source
    )

    run on development environment.

    dbt build
    dbt docs generate
  7. Run the recce server

    recce server

    or the following command if you would like to persist the recce state.

    recce server issue-123.json

    Open the link http://0.0.0.0:8000, you can see the lineage diff

  8. Switch to the Query tab, run this query

    select * from {{ ref("orders") }} order by 1

    Click the Run Diff or press Cmd + Shift + Enter

    Click on the 🔑 icon next to the order_id column to compare records that are uniquely identified by their order_id.

  9. Click the + to add the query result to checklist