From f42d519967f4437dede8916f185fe3de64f9d3cc Mon Sep 17 00:00:00 2001 From: billettc Date: Tue, 7 Nov 2023 22:06:32 -0500 Subject: [PATCH] wip --- .../models/example/dbt_driver_count.sql | 19 +++++++++++++++ .../models/example/dbt_payment_total.sql | 19 +++++++++++++++ .dbt/hivemapper/models/example/schema.yml | 23 +++++++++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 .dbt/hivemapper/models/example/dbt_driver_count.sql create mode 100644 .dbt/hivemapper/models/example/dbt_payment_total.sql diff --git a/.dbt/hivemapper/models/example/dbt_driver_count.sql b/.dbt/hivemapper/models/example/dbt_driver_count.sql new file mode 100644 index 0000000..964734a --- /dev/null +++ b/.dbt/hivemapper/models/example/dbt_driver_count.sql @@ -0,0 +1,19 @@ + +/* + 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='view') }} + +select count(*) as driver_count +from hivemapper.drivers + +/* + Uncomment the line below to remove records with null `id` values +*/ + +-- where id is not null diff --git a/.dbt/hivemapper/models/example/dbt_payment_total.sql b/.dbt/hivemapper/models/example/dbt_payment_total.sql new file mode 100644 index 0000000..6623bb1 --- /dev/null +++ b/.dbt/hivemapper/models/example/dbt_payment_total.sql @@ -0,0 +1,19 @@ + +/* + 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='view') }} + +select sum(mints.amount) as total_payments from hivemapper.payments +inner join hivemapper.mints on mints.id = payments.mint_id + +/* + Uncomment the line below to remove records with null `id` values +*/ + +-- where id is not null diff --git a/.dbt/hivemapper/models/example/schema.yml b/.dbt/hivemapper/models/example/schema.yml index dea8a6b..241b32d 100644 --- a/.dbt/hivemapper/models/example/schema.yml +++ b/.dbt/hivemapper/models/example/schema.yml @@ -13,4 +13,27 @@ models: meta: dimension: label: "Fleet Count" + type: number + - name: dbt_driver_count + description: "Driver Count" + columns: + - name: driver_count + description: "The count" + tests: + - unique + - not_null + meta: + dimension: + label: "Driver Count" + type: number + - name: dbt_payment_total + description: "Total Payment" + columns: + - name: total_payments + tests: + - unique + - not_null + meta: + dimension: + label: "Total Payment" type: number \ No newline at end of file