QuestionQ3

Verified

Consider this dbt_project.yml:

name: "jaffle_shop"  
version: "1.0.0"  
config-version: 2  
profile: "snowflake"  
model-paths: ["models"]  
macro-paths: ["macros"]  
snapshot-paths: ["snapshots"]  
target-path: "target"  
clean-targets:  
  - "logs"  
  - "target"  
  - "dbt_modules"  
  - "dbt_packages"  
models:  
  jaffle_shop:  
    orders:  
      materialized: table  

When you execute dbt run, your models build as views rather than tables:

19:36:14 Found 1 model, 0 tests, 0 snapshots, 0 analyses, 179 macros, 0 operations, 0 seed files, 0 sources, 0 exposures, 0 metrics  
19:36:16 Concurrency: 1 threads (target='default')  
19:36:17 Finished running 1 view model in 3.35s.  
19:36:17 Completed successfully  
19:36:17 Done. PASS=1 WARN=0 ERROR=0 SKIP=0 TOTAL=1  

Could the following be a root cause of the model not being materialized as a table?

The target-path is incorrectly configured.

Explanation

The target-path controls where dbt writes artifacts; it does not determine whether a model is built as a table or a view. Materialization is controlled by model configuration, and models default to views when no applicable table configuration takes effect. (docs.getdbt.com)

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!