dbt (data build tool) interview questions

getDbt

DBT – Best practices that developers show follow

Get all articles on dbt here <<<DONT MISS >>>

1. What is a model in dbt (data build tool)?
A model is a select statement. Models are defined in .sql files (typically in your models directory):
Each .sql file contains one model / select statement .

A model corresponds to a select statement and is outlined in .sql files, usually stored within your models directory. Each .sql file encapsulates a single model/select statement, utilizing the file name as the model identifier. Models may be organized into subdirectories within the models directory. Upon executing the dbt run command, dbt will construct this model within your data warehouse by enclosing it in a create view as or create table as statement.

2. What are the configurations in a model?
Configurations are “model settings” that can be set in your dbt_project.yml file, and in your model file using a config block. Some example configurations include:
Change the materialization that a model uses – a materialization determines the SQL that dbt uses to create the model in your warehouse. 

3. Can I store my models in a directory other than the `models` directory in my project?
By default, dbt expects your seed files to be located in the models subdirectory of your project.
To change this, update the source-paths configuration in your dbt_project.yml file, like so:
dbt_project.yml
source-paths: [“transformations”]


4. Can I split my models across multiple schemas?
Yes. Use the schema configuration in your dbt_project.yml file, or using a config block:
dbt_project.yml
name: jaffle_shop

models:
jaffle_shop:
marketing:
schema: marketing #


5. Do model names need to be unique?
Yes! To build dependencies between models, you need to use the ref function. The ref function only takes one argument — the model name (i.e. the filename). As a result, these model names need to be unique, even if they are in distinct folders.

Author: user

Leave a Reply