-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into dependabot/gradle/packages/Manager/org.sprin…
…gframework.boot-3.3.0
- Loading branch information
Showing
281 changed files
with
26,734 additions
and
18,990 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
43 changes: 43 additions & 0 deletions
43
packages/DataTransformation/models/marts/planLimits/council_plan_boundaries.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,43 @@ | ||
{{ config( | ||
materialized = 'table', | ||
indexes=[ | ||
{'columns': ['council_id', 'source_id'], 'unique': True}, | ||
] | ||
) }} | ||
|
||
WITH geom_source AS ( | ||
|
||
SELECT | ||
council_id, | ||
source_id, | ||
boundary | ||
FROM {{ ref('stg_council_plan_boundary_geom_source') }} | ||
), | ||
|
||
rec2_data AS ( | ||
|
||
SELECT | ||
council_id, | ||
source_id, | ||
boundary | ||
FROM {{ ref('council_plan_boundary_rec2_data') }} | ||
), | ||
|
||
geojson_data AS ( | ||
|
||
SELECT | ||
council_id, | ||
source_id, | ||
boundary | ||
FROM {{ ref('stg_council_plan_boundary_geojson_data') }} | ||
), | ||
|
||
combined_data AS ( | ||
SELECT * FROM geom_source | ||
UNION ALL | ||
SELECT * FROM rec2_data | ||
UNION ALL | ||
SELECT * FROM geojson_data | ||
) | ||
|
||
SELECT * FROM combined_data |
63 changes: 63 additions & 0 deletions
63
packages/DataTransformation/models/marts/planLimits/council_plan_boundary_rec2_data.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,63 @@ | ||
{{ config( | ||
materialized = 'table' | ||
) }} | ||
|
||
WITH | ||
RECURSIVE | ||
input AS ( | ||
SELECT | ||
council_id, | ||
source_id, | ||
hydro_ids, | ||
excluded_hydro_ids | ||
FROM | ||
{{ ref('stg_council_plan_boundary_rec2_source') }} | ||
), | ||
|
||
expanded_input AS ( | ||
SELECT | ||
council_id, | ||
source_id, | ||
UNNEST(hydro_ids) AS hydro_id | ||
FROM | ||
input | ||
), | ||
|
||
all_hydro_ids AS ( | ||
SELECT * | ||
FROM | ||
expanded_input | ||
UNION ALL | ||
SELECT | ||
a.council_id, | ||
a.source_id, | ||
rv.hydro_id | ||
FROM | ||
{{ ref('rivers') }} AS rv | ||
INNER JOIN all_hydro_ids AS a ON rv.next_hydro_id = a.hydro_id | ||
), | ||
|
||
with_watershed_geom AS ( | ||
SELECT | ||
a.council_id, | ||
a.source_id, | ||
a.hydro_id, | ||
w.geom | ||
FROM | ||
all_hydro_ids AS a | ||
INNER JOIN {{ ref('watersheds') }} AS w ON a.hydro_id = w.hydro_id | ||
), | ||
|
||
as_grouped_boundaries AS ( | ||
SELECT | ||
council_id, | ||
source_id, | ||
ST_UNION(geom) AS boundary | ||
FROM | ||
with_watershed_geom | ||
GROUP BY council_id, source_id | ||
) | ||
|
||
SELECT * | ||
FROM | ||
as_grouped_boundaries |
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 |
---|---|---|
|
@@ -286,6 +286,7 @@ models: | |
meta: | ||
data_type: varchar | ||
|
||
|
||
- name: water_allocation_and_usage_by_area | ||
columns: | ||
- name: date | ||
|
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
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
Oops, something went wrong.