-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(pipeline): add final dimension tables
The following changes are scoped to the final models: * clean up unmaintained doc * rename `marts/api` to `marts/inclusion` * rename models to following naming convention * force full-refresh for schema seeds * add unique constraint to schema seeds to be able to set foreign keys * unnest jsonb list columns to new tables, with contracts * enforce contract for marts by default * set indexes using dbt contracts * set foreign keys using dbt contracts
- Loading branch information
Showing
21 changed files
with
464 additions
and
277 deletions.
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
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
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
18 changes: 18 additions & 0 deletions
18
pipeline/dbt/macros/marts_inclusion__unnest_jsonb_list_to_table.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,18 @@ | ||
{% macro unnest_jsonb_list_to_table(resource_type, nested_column) %} | ||
|
||
WITH {{ resource_type }}s AS ( | ||
SELECT * FROM {{ ref('int__union_{}s__enhanced'.format(resource_type) ) }} | ||
), | ||
|
||
final AS ( | ||
SELECT | ||
_di_surrogate_id AS "{{ resource_type }}_surrogate_id", | ||
value_ AS "value" | ||
FROM | ||
{{ resource_type }}s, | ||
UNNEST({{ nested_column }}) AS value_ | ||
) | ||
|
||
SELECT * FROM final | ||
|
||
{% endmacro %} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.