-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
71 changed files
with
1,412 additions
and
883 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{%- macro acteur(ephemeral_filtered_acteur, propositionservice ) -%} | ||
|
||
SELECT DISTINCT va.* | ||
FROM {{ ref(ephemeral_filtered_acteur) }} AS va | ||
INNER JOIN {{ ref(propositionservice) }} AS cps | ||
ON va.identifiant_unique = cps.acteur_id | ||
|
||
{%- endmacro -%} |
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
5 changes: 4 additions & 1 deletion
5
...emp_opendata_parentpropositionservice.sql → ...cro_filtered_parentpropositionservice.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 |
---|---|---|
@@ -1,10 +1,13 @@ | ||
{%- macro filtered_parentpropositionservice(ephemeral_filtered_acteur ) -%} | ||
|
||
SELECT | ||
tvps.id AS id, | ||
tcfa.parent_id AS parent_id, | ||
tvps.acteur_id AS acteur_id, | ||
tvps.action_id AS action_id | ||
FROM qfdmo_vuepropositionservice AS tvps | ||
INNER JOIN {{ ref('temp_opendata_filteredacteur') }} AS tcfa | ||
INNER JOIN {{ ref(ephemeral_filtered_acteur) }} AS tcfa | ||
ON tvps.acteur_id = tcfa.identifiant_unique | ||
AND tcfa.parent_id IS NOT NULL | ||
|
||
{%- endmacro -%} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{%- macro propositionservice(ephemeral_filtered_propositionservice, propositionservice_sous_categories ) -%} | ||
|
||
SELECT | ||
MIN(ps.id) AS id, | ||
ps.acteur_id, | ||
ps.action_id | ||
FROM {{ ref(ephemeral_filtered_propositionservice) }} AS ps | ||
INNER JOIN {{ ref(propositionservice_sous_categories) }} AS pssscat | ||
ON ps.id = pssscat.propositionservice_id | ||
GROUP BY acteur_id, action_id | ||
|
||
{%- endmacro -%} |
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,37 @@ | ||
{%- macro propositionservice_sous_categories(ephemeral_filtered_acteur, ephemeral_filtered_propositionservice, ephemeral_filtered_parentpropositionservice ) -%} | ||
|
||
with | ||
parent_propositionservice_sous_categories | ||
AS | ||
( | ||
SELECT | ||
MIN(pssscat.id) AS id, | ||
CONCAT(pps.parent_id::text, '_', pps.action_id::text) AS propositionservice_id, | ||
pssscat.souscategorieobjet_id AS souscategorieobjet_id | ||
FROM {{ ref("int_propositionservice_sous_categories") }} AS pssscat | ||
INNER JOIN {{ ref(ephemeral_filtered_parentpropositionservice) }} AS pps | ||
ON pps.id = pssscat.propositionservice_id | ||
GROUP BY | ||
pps.parent_id, | ||
pps.action_id, | ||
pssscat.souscategorieobjet_id | ||
), | ||
nochild_propositionservice_sous_categories | ||
AS | ||
( | ||
SELECT | ||
pssscat.id AS id, | ||
pssscat.propositionservice_id AS propositionservice_id, | ||
pssscat.souscategorieobjet_id AS souscategorieobjet_id | ||
FROM {{ ref("int_propositionservice_sous_categories") }} AS pssscat | ||
INNER JOIN {{ ref(ephemeral_filtered_propositionservice) }} AS ps ON pssscat.propositionservice_id = ps.id | ||
INNER JOIN {{ ref(ephemeral_filtered_acteur) }} AS cfa ON ps.acteur_id = cfa.identifiant_unique AND cfa.parent_id is null | ||
) | ||
|
||
SELECT * | ||
FROM parent_propositionservice_sous_categories | ||
UNION ALL | ||
SELECT * | ||
FROM nochild_propositionservice_sous_categories | ||
|
||
{%- endmacro -%} |
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 @@ | ||
select * from {{ source('qfdmo', 'qfdmo_acteur') }} |
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 @@ | ||
select * from {{ source('qfdmo', 'qfdmo_acteur_acteur_services') }} |
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 @@ | ||
select * from {{ source('qfdmo', 'qfdmo_acteur_labels') }} |
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 @@ | ||
select * from {{ source('qfdmo', 'qfdmo_propositionservice') }} |
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 @@ | ||
select * from {{ source('qfdmo', 'qfdmo_propositionservice_sous_categories') }} |
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 @@ | ||
select * from {{ source('qfdmo', 'qfdmo_revisionacteur') }} |
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 @@ | ||
select * from {{ source('qfdmo', 'qfdmo_revisionacteur_acteur_services') }} |
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 @@ | ||
select * from {{ source('qfdmo', 'qfdmo_revisionacteur_labels') }} |
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 @@ | ||
select * from {{ source('qfdmo', 'qfdmo_revisionpropositionservice') }} |
1 change: 1 addition & 0 deletions
1
dbt/models/base/base_revisionpropositionservice_sous_categories.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 @@ | ||
select * from {{ source('qfdmo', 'qfdmo_revisionpropositionservice_sous_categories') }} |
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 @@ | ||
select * from {{ source('qfdmo', 'qfdmo_source') }} |
Oops, something went wrong.