Skip to content

Commit

Permalink
Merge pull request #72 from Opetushallitus/OK-729__SUREn-siirtotiedos…
Browse files Browse the repository at this point in the history
…toja

sqlfluff
  • Loading branch information
razze76 authored Nov 27, 2024
2 parents bdbaa1a + 1ad4e74 commit 4e182de
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
15 changes: 7 additions & 8 deletions dbt/models/int/int_yleiskayttoiset/int_organisaatio_rakenne.sql
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ with recursive organisaatio as (

org (parent_oid, child_oid) as (
select
ylempi_organisaatio as parent_oid,
organisaatio_oid as child_oid
ylempi_organisaatio as parent_oid,
organisaatio_oid as child_oid
from organisaatio

union all

select
orga.parent_oid,
org2.organisaatio_oid as child_oid
orga.parent_oid,
org2.organisaatio_oid as child_oid
from organisaatio as org2
inner join org as orga on orga.child_oid = org2.ylempi_organisaatio
inner join org as orga on org2.ylempi_organisaatio = orga.child_oid
),

final as (
Expand All @@ -33,10 +33,9 @@ final as (
from org
union
select
organisaatio_oid as parent_oid,
organisaatio_oid as child_oid
organisaatio_oid as parent_oid,
organisaatio_oid as child_oid
from organisaatio
)

select * from final

2 changes: 1 addition & 1 deletion dbt/models/pub/pub_dim_hakukohde.sql
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,4 @@ final as (
)

select * from final
order by haku_oid
order by haku_oid
1 change: 0 additions & 1 deletion dbt/models/pub/pub_dim_hakutoive.sql
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,3 @@ final as (
)

select * from final
order by haku_oid
4 changes: 2 additions & 2 deletions dbt/models/pub/pub_dim_organisaatio_rakenne.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
}}

with source as (
select * from {{ ref('int_organisaatio_rakenne') }}
select * from {{ ref('int_organisaatio_rakenne') }}
)

select
parent_oid,
child_oid
from source
order by 1,2
order by 1, 2

0 comments on commit 4e182de

Please sign in to comment.