Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
billettc committed Nov 8, 2023
1 parent 12d1493 commit f42d519
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .dbt/hivemapper/models/example/dbt_driver_count.sql
Original file line number Diff line number Diff line change
@@ -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
19 changes: 19 additions & 0 deletions .dbt/hivemapper/models/example/dbt_payment_total.sql
Original file line number Diff line number Diff line change
@@ -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
23 changes: 23 additions & 0 deletions .dbt/hivemapper/models/example/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit f42d519

Please sign in to comment.