-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #67 from Opetushallitus/OK-729__SUREn-siirtotiedos…
…toja Ok 729 suren siirtotiedostoja
- Loading branch information
Showing
14 changed files
with
251 additions
and
85 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,4 @@ | ||
{%- set stage_model = ref('stg_sure_harkinnanvaraisuudet') -%} | ||
{%- set key_columns_list = ['hakemusOid'] -%} | ||
|
||
{{ generate_dw_model_muokattu(stage_model, key_columns_list) }} |
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,4 @@ | ||
{%- set stage_model = ref('stg_sure_proxysuoritukset') -%} | ||
{%- set key_columns_list = ['hakemusOid'] -%} | ||
|
||
{{ generate_dw_model_muokattu(stage_model, key_columns_list) }} |
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,29 @@ | ||
{{ | ||
config( | ||
materialized = 'table', | ||
indexes = [ | ||
{'columns': ['hakemus_oid','hakukohde_oid']} | ||
] | ||
) | ||
}} | ||
|
||
with source as ( -- noqa: PRS | ||
select * from {{ ref('dw_sure_harkinnanvaraisuudet') }} -- noqa: PRS | ||
), -- noqa: PRS | ||
|
||
rows as ( | ||
select | ||
hakemusoid, | ||
jsonb_array_elements(hakutoiveet) as hakutoive | ||
from source | ||
), | ||
|
||
final as ( | ||
select | ||
hakemusoid as hakemus_oid, | ||
hakutoive->>'hakukohdeOid' as hakukohde_oid, | ||
hakutoive->>'harkinnanvaraisuudenSyy' as harkinnanvaraisuude_syy | ||
from rows | ||
) | ||
|
||
select * from final |
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,21 @@ | ||
{{ | ||
config( | ||
materialized = 'table', | ||
indexes = [ | ||
{'columns': ['hakemus_oid']} | ||
] | ||
) | ||
}} | ||
|
||
with raw as ( | ||
select * from {{ ref('dw_sure_proxysuoritukset') }} where pohjakoulutus is not null | ||
), | ||
|
||
final as ( | ||
select | ||
hakemusoid as hakemus_oid, | ||
pohjakoulutus | ||
from raw | ||
) | ||
|
||
select * from final |
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
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,2 +1,2 @@ | ||
[sqlfluff] | ||
exclude_rules = CP02 | ||
exclude_rules = CP02,RF02 |
Oops, something went wrong.