From c201aca3e3699fa24689d620ab8556db19c794c2 Mon Sep 17 00:00:00 2001 From: Horatiu Bolovan <93126326+Aciroh@users.noreply.github.com> Date: Sat, 20 Apr 2024 16:42:50 +0300 Subject: [PATCH] [Add Models] Delete unused files and add stg_dosare_parti model --- dbt/dbt_project.yml | 4 +-- dbt/dependencies.yml | 3 +++ dbt/models/dosare/models/stg_dosare_parti.sql | 7 +++++ dbt/models/dosare/schema/stg_dosare_parti.yml | 15 +++++++++++ dbt/models/example/my_first_dbt_model.sql | 27 ------------------- dbt/models/example/my_second_dbt_model.sql | 6 ----- dbt/models/example/schema.yml | 21 --------------- 7 files changed, 27 insertions(+), 56 deletions(-) create mode 100644 dbt/dependencies.yml create mode 100644 dbt/models/dosare/models/stg_dosare_parti.sql create mode 100644 dbt/models/dosare/schema/stg_dosare_parti.yml delete mode 100644 dbt/models/example/my_first_dbt_model.sql delete mode 100644 dbt/models/example/my_second_dbt_model.sql delete mode 100644 dbt/models/example/schema.yml diff --git a/dbt/dbt_project.yml b/dbt/dbt_project.yml index f2bd50d..22c0a31 100644 --- a/dbt/dbt_project.yml +++ b/dbt/dbt_project.yml @@ -33,5 +33,5 @@ clean-targets: # directories to be removed by `dbt clean` models: opendataexplorer: # Config indicated by + and applies to all files under models/example/ - example: - +materialized: view + dosare: + +materialized: table diff --git a/dbt/dependencies.yml b/dbt/dependencies.yml new file mode 100644 index 0000000..076526a --- /dev/null +++ b/dbt/dependencies.yml @@ -0,0 +1,3 @@ +packages: + - package: dbt-labs/snowplow + version: 0.7.0 \ No newline at end of file diff --git a/dbt/models/dosare/models/stg_dosare_parti.sql b/dbt/models/dosare/models/stg_dosare_parti.sql new file mode 100644 index 0000000..36ae2eb --- /dev/null +++ b/dbt/models/dosare/models/stg_dosare_parti.sql @@ -0,0 +1,7 @@ +with source as ( + select * + from {{source('dosare_raw', 'dosare_parti')}} +) + +select * +from source \ No newline at end of file diff --git a/dbt/models/dosare/schema/stg_dosare_parti.yml b/dbt/models/dosare/schema/stg_dosare_parti.yml new file mode 100644 index 0000000..ee57587 --- /dev/null +++ b/dbt/models/dosare/schema/stg_dosare_parti.yml @@ -0,0 +1,15 @@ +version: 2 + +models: + - name: stg_dosare_parti + description: Lista de părți din dosar, Numele părții din dosar + columns: + - name: data + description: Data de înregistrare a dosarului + tests: + - not_null + - name: nume + description: Numele părții din dosar + tests: + - not_null + diff --git a/dbt/models/example/my_first_dbt_model.sql b/dbt/models/example/my_first_dbt_model.sql deleted file mode 100644 index f31a12d..0000000 --- a/dbt/models/example/my_first_dbt_model.sql +++ /dev/null @@ -1,27 +0,0 @@ - -/* - Welcome to your first dbt model! - Did you know that you can also configure models directly within SQL files? - This will override configurations stated in dbt_project.yml - - Try changing "table" to "view" below -*/ - -{{ config(materialized='table') }} - -with source_data as ( - - select 1 as id - union all - select null as id - -) - -select * -from source_data - -/* - Uncomment the line below to remove records with null `id` values -*/ - --- where id is not null diff --git a/dbt/models/example/my_second_dbt_model.sql b/dbt/models/example/my_second_dbt_model.sql deleted file mode 100644 index c91f879..0000000 --- a/dbt/models/example/my_second_dbt_model.sql +++ /dev/null @@ -1,6 +0,0 @@ - --- Use the `ref` function to select from other models - -select * -from {{ ref('my_first_dbt_model') }} -where id = 1 diff --git a/dbt/models/example/schema.yml b/dbt/models/example/schema.yml deleted file mode 100644 index 2a53081..0000000 --- a/dbt/models/example/schema.yml +++ /dev/null @@ -1,21 +0,0 @@ - -version: 2 - -models: - - name: my_first_dbt_model - description: "A starter dbt model" - columns: - - name: id - description: "The primary key for this table" - tests: - - unique - - not_null - - - name: my_second_dbt_model - description: "A starter dbt model" - columns: - - name: id - description: "The primary key for this table" - tests: - - unique - - not_null