-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* dbt: update project models * add: events to project by source models * add: additional models * fix: white space * fix: linting
- Loading branch information
Showing
12 changed files
with
115 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[virtualenvs] | ||
in-project = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
warehouse/dbt/models/marts/events/daily/events_daily_to_artifact_by_source.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{# | ||
All events daily to an artifact by source | ||
#} | ||
|
||
SELECT | ||
e.to_id AS artifact_id, | ||
e.from_id, | ||
e.event_type, | ||
TIMESTAMP_TRUNC(e.time, DAY) AS bucket_day, | ||
SUM(e.amount) AS amount | ||
FROM {{ ref('int_events_to_project') }} AS e | ||
GROUP BY 1, 2, 3, 4 |
12 changes: 12 additions & 0 deletions
12
warehouse/dbt/models/marts/events/daily/events_daily_to_collection_by_source.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{# | ||
All events daily to a collection by source | ||
#} | ||
|
||
SELECT | ||
e.collection_id, | ||
e.from_id, | ||
e.event_type, | ||
TIMESTAMP_TRUNC(e.time, DAY) AS bucket_day, | ||
SUM(e.amount) AS amount | ||
FROM {{ ref('int_events_to_collection') }} AS e | ||
GROUP BY 1, 2, 3, 4 |
12 changes: 12 additions & 0 deletions
12
warehouse/dbt/models/marts/events/daily/events_daily_to_project_by_source.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{# | ||
All events daily to a project by source | ||
#} | ||
|
||
SELECT | ||
e.project_id, | ||
e.from_id, | ||
e.event_type, | ||
TIMESTAMP_TRUNC(e.time, DAY) AS bucket_day, | ||
SUM(e.amount) AS amount | ||
FROM {{ ref('int_events_to_project') }} AS e | ||
GROUP BY 1, 2, 3, 4 |
12 changes: 12 additions & 0 deletions
12
warehouse/dbt/models/marts/events/monthly/events_monthly_to_artifact_by_source.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{# | ||
All events monthly to an artifact by source | ||
#} | ||
|
||
SELECT | ||
e.artifact_id, | ||
e.from_id, | ||
e.event_type, | ||
TIMESTAMP_TRUNC(e.bucket_day, MONTH) AS bucket_month, | ||
SUM(e.amount) AS amount | ||
FROM {{ ref('events_daily_to_artifact_by_source') }} AS e | ||
GROUP BY 1, 2, 3, 4 |
12 changes: 12 additions & 0 deletions
12
warehouse/dbt/models/marts/events/monthly/events_monthly_to_collection_by_source.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{# | ||
All events monthly to a collection by source | ||
#} | ||
|
||
SELECT | ||
e.collection_id, | ||
e.from_id, | ||
e.event_type, | ||
TIMESTAMP_TRUNC(e.bucket_day, MONTH) AS bucket_month, | ||
SUM(e.amount) AS amount | ||
FROM {{ ref('events_daily_to_collection_by_source') }} AS e | ||
GROUP BY 1, 2, 3, 4 |
12 changes: 12 additions & 0 deletions
12
warehouse/dbt/models/marts/events/monthly/events_monthly_to_project_by_source.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{# | ||
All events monthly to a project by source | ||
#} | ||
|
||
SELECT | ||
e.project_id, | ||
e.from_id, | ||
e.event_type, | ||
TIMESTAMP_TRUNC(e.bucket_day, MONTH) AS bucket_month, | ||
SUM(e.amount) AS amount | ||
FROM {{ ref('events_daily_to_project_by_source') }} AS e | ||
GROUP BY 1, 2, 3, 4 |
12 changes: 12 additions & 0 deletions
12
warehouse/dbt/models/marts/events/weekly/events_weekly_to_artifact_by_source.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{# | ||
All events weekly to an artifact by source | ||
#} | ||
|
||
SELECT | ||
e.artifact_id, | ||
e.from_id, | ||
e.event_type, | ||
TIMESTAMP_TRUNC(e.bucket_day, WEEK) AS bucket_week, | ||
SUM(e.amount) AS amount | ||
FROM {{ ref('events_daily_to_artifact_by_source') }} AS e | ||
GROUP BY 1, 2, 3, 4 |
12 changes: 12 additions & 0 deletions
12
warehouse/dbt/models/marts/events/weekly/events_weekly_to_collection_by_source.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{# | ||
All events weekly to a collection by source | ||
#} | ||
|
||
SELECT | ||
e.collection_id, | ||
e.from_id, | ||
e.event_type, | ||
TIMESTAMP_TRUNC(e.bucket_day, WEEK) AS bucket_week, | ||
SUM(e.amount) AS amount | ||
FROM {{ ref('events_daily_to_collection_by_source') }} AS e | ||
GROUP BY 1, 2, 3, 4 |
12 changes: 12 additions & 0 deletions
12
warehouse/dbt/models/marts/events/weekly/events_weekly_to_project_by_source.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{# | ||
All events weekly to a project by source | ||
#} | ||
|
||
SELECT | ||
e.project_id, | ||
e.from_id, | ||
e.event_type, | ||
TIMESTAMP_TRUNC(e.bucket_day, WEEK) AS bucket_week, | ||
SUM(e.amount) AS amount | ||
FROM {{ ref('events_daily_to_project_by_source') }} AS e | ||
GROUP BY 1, 2, 3, 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters