Git Product home page Git Product logo

ddbt's Introduction

Dom's Data Build Tool

Build Status GoDoc

This repo represents my attempt to build a fast version of DBT which gets very slow on large projects (3000+ data models). This project attempts to be a direct drop in replacement for DBT at the command line.

Warning: This is experimental and may not work exactly as you expect

Installation

  1. Clone this repo
$ git clone [email protected]:monzo/ddbt.git
  1. Change directory into cloned repo
$ cd ddbt
  1. Install (requires go-lang)
$ go install
  1. Confirm installation
$ ddbt --version
ddbt version 0.6.5

Command Quickstart

  • ddbt run will compile and execute all your models, or those filtered for, against your data warehouse
  • ddbt test will run all tests referencing all your models, or those filtered for, in your project against your data warehouse
  • ddbt show my_model will output the compiled SQL to the terminal
  • ddbt copy my_model will copy the compiled SQL into your clipboard
  • ddbt show-dag will output the order of how the models will execute
  • ddbt watch will get act like run, followed by test. DDBT will then watch your file system for any changes and automatically rerun those parts of the DAG and affected downstream tests or failing tests.
  • ddbt watch --skip-run is the same as watch, but will skip the initial run (preventing you having to wait for all the models to run) before running the tests and starting to watch your file system.
  • ddbt completion zsh will generate a shell completion script zsh (or bash if you pass that as argument). Detailed steps to set up the completion script can be found in ddbt completion --help
  • ddbt isolate-dag will create a temporary directory and symlink in all files needed for the given model_filter such that Fishtown's DBT could be run against it without having to be run against every model in your data warehouse
  • ddbt schema-gen -m my_model will output a new or updated schema yml file for the model provided in the same directory as the dbt model file.
  • ddbt lookml-gen my_model will generate lookml view and copy it to your clipboard

Global Arguments

  • --models model_filter or -m model_filter: Instead of running for every model in your project, DDBT will only execute against the requested models. See filters below for what is accepted for my_model
  • --threads=n: force DDBT to run with n threads instead of what is defined in your dbt_project.yml
  • --target=x or -t x: force DDBT to run against the x output defined in your profile.yml instead of the default defined in that file.
  • --upstream=y or -u y: For any references to models outside the explicit models specified by run or test, the upstream target used to read that data will be swapped to y instead of the output target of x
  • --fail-on-not-found=false or -f=false: By default, ddbt will fail if a the specified models don't exist, passing in this argument as false will warn instead of failing
  • --enable-schema-based-tests or -s=true: Schema-based tests are disabled by default for now, but as a way to enable them pass this argument as true
  • --custom-config-path=my/custom/path or -c=my/custom/path: Allows a custom path to be used for the dbt_project.yml. This is useful if you want to use a different location than the default one. For example if you're mid-way through migrating commands from an old dbt version to a new version and using two different versions of dbt_project.yml at the same time.

Model Filters

When running or testing the project, you may only want to run for a subset of your models.

Currently DDBT supports the following syntax options:

  • -m my_model: DDBT will only execute against the model with that name
  • -m +my_model: DDBT will run against my_model and all upstreams referenced by it
  • -m my_model+: DDBT will run against my_model and all downstreams that referenced it
  • -m +my_model+: DDBT will run against my_model and both all upstreams and downstreams.
  • -m tag:tagValue: DDBT will only execute models which have a tag which is equal to tagValue

ddbt's People

Contributors

akhatre avatar borjavb avatar domblack avatar francescogalletta avatar jackwardell avatar nickng avatar nlathia avatar robertpknight avatar twindebank avatar ucg8j 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.