How to use the dbt 'analyses' directory

preview_player
Показать описание
Get a FREE checklist to build simple, reliable data architectures (without the mess)

While dbt is often used for building models, sometimes all you need is a compiled script.

Jinja allows you to easily create complex logic, but what if you don't want to deploy it?

Fortunately, there is a feature made just for that purpose and its called "Analyses"

It's shipped out of the box and even has its own dedicated folder.

In this video we'll discuss what it is, when you would use it and how to implement it.

Timestamps:
0:00 - Intro
0:20 - What are Analyses?
0:59 - When should you use it?
2:05 - How do you add one?
4:29 - Things to consider

Title & Tags:
When should you use the "analyses" directory? | dbt tutorial for beginners
#kahandatasolutions #dataengineering #databuildtool
Рекомендации по теме
Комментарии
Автор

Get a FREE checklist to build simple, reliable data architectures (without the mess)

KahanDataSolutions
Автор

One comment on the analyses folder is that you can run your queries (compiled or not) directly in the editor and see your output in VS Code itself. No need to take it to Snowflake and run it there. If you navigate to the Output tab below, it shows the output of your query.

ckarkhan
Автор

Hi, i have two macros, first one to register datetime of start and end in the parameters on-run-start and on-run-end (this works perfect). Then the second one its meant to register not only the start datetime in the pre-hook and finish datetime in the post-hook but also register a count(*) on every model that i have in a subfolder of the project.
I set as follow,
models:
test:
# Config indicated by + and applies to all files under models/staging/
redshift_test:
+materialized: view
+schema: staging
+pre-hook: "{{ dbt_test(this, 'start', 'count_rows') }}"
+post-hook: "{{ dbt_test(this, 'end', 'count_rows') }}"

But when i run this, it never register this two rows in the final audit table on Redshift, how can i indicate to the macro that has to execute this macro on every model (passing the name of the model to the macro) of this subfolder "redshift_test"?? Thanks

roberbonox
visit shbcf.ru