analyzes Flashcards

(6 cards)

1
Q

What is a dbt analysis?

A

A dbt analysis is a SQL file located in the analyses/ directory of a dbt project that is compiled but not executed or materialized in the database. It is used for exploratory or ad hoc analytical queries.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Where should analysis files be stored in a dbt project?

A

Analysis files should be placed in the analyses/ directory within the dbt project to be recognized as analyses.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Can you use ref() in a dbt analysis?

A

Yes, you can use the ref() function in analyses to reference models and other dbt objects in an environment-agnostic way.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What happens when you run dbt compile on an analysis?

A

Running dbt compile compiles the SQL in the analysis file and places the result in the target/compiled/{project name}/analyses/ directory. The query can then be copied and executed externally.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Why are analyses not materialized in the database?

A

Analyses are intended for ad hoc exploration or reporting and not for building persistent data transformations, so they are compiled but not executed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a typical use case for a dbt analysis?

A

A common use case is to write and version control complex SQL queries for reporting or debugging that do not belong in the main data model but benefit from dbt’s dependency and templating features.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly