Giter Club home page Giter Club logo

simple_dbt_project's Introduction

SIMPLE_DBT_PROJECT

Prerequistite

  • run local postgresql
docker run --name pg_local -p 5432:5432 \
-e POSTGRES_USER=start_data_engineer -e POSTGRES_PASSWORD=password \
-e POSTGRES_DB=tutorial -d postgres:12
  • edit dbt config profile in ~/.dbt/profiles.yml
tutorial:
  outputs:
    dev:
      type: postgres
      threads: 1
      host: localhost
      port: 5432
      user: start_data_engineer
      pass: password
      dbname: tutorial
      schema: `dbt`_tutorial
  target: dev

Project stucture after setup

.
├── README.md
├── analysis
├── data
│   ├── customer.csv
│   ├── orders.csv
│   └── state.csv
├── dbt_modules
├── logs
├── dbt_project.yml
├── macros
├── models
│   ├── mart
│   │   ├── customer_orders.sql
│   │   └── schema.yml
│   └── staging
│       ├── schema.yml
│       ├── stg_customer.sql
│       ├── stg_orders.sql
│       └── stg_state.sql
├── snapshots
├── target
└── tests

Running dbt

# check for any errors
dbt debug
# load file into database
dbt seed
# run data pipeline
dbt run
# test table data with schema.yml defined in models
dbt test
# generate doc
dbt docs generate
# run dbt doc server
dbt docs serve
  • Go to http://localhost:8080 to see the UI
  • And remember to remove postgresql container when you finist testing.

References

dbt-data-build-tool-tutorial

simple_dbt_project's People

Contributors

lushaohsuan avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.