dbt (data build tool) interview questions

16. What is an incremental_strategy?
incremental_strategy config controls the code that dbt uses to build incremental models. Different approaches may vary by effectiveness depending on the volume of data, the reliability of your unique_key, or the availability of certain features.
Snowflake: merge (default), delete+insert (optional)
BigQuery: merge (default), insert_overwrite (optional)
Spark: insert_overwrite (default), merge (optional, Delta-only)

17. What is aliases in dbt ?
When dbt runs a model, it will generally create a relation (either a table or a view) in the database. By default, dbt uses the filename of the model as the identifier for this relation in the database. This identifier can optionally be overridden using the alias model configuration.

18. What is a custom schema in dbt ?
By default, all dbt models are built in the schema specified in your target. In dbt projects with lots of models, it may be useful to instead build some models in schemas other than your target schema – this can help logically group models together. You can use custom schemas in dbt to build models in a schema other than your target schema. It’s important to note that by default, dbt will generate the schema name for a model by concatenating the custom schema to the target schema, as in: <target_schema>_<custom_schema>;.

19. How do I use custom schemas?
Use the schema configuration key to specify a custom schema for a model. As with any configuration, you can either:
apply this configuration to a specific model by using a config block within a model, or
apply it to a subdirectory of models by specifying it in your dbt_project.yml file
{{ config(schema=’marketing’) }}

20. Which vars are available in generate_schema_name?
Globally-scoped variables and variables defined on the command line with –vars are accessible in the generate_schema_name context.

Author: user

Leave a Reply

Your email address will not be published. Required fields are marked *