-
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.
trim raw_GA__signal_denormalized text fields (et/somenergia-jardiner!…
…121) Merge branch 'fix/trim_device_name' into 'main'
- Loading branch information
Showing
2 changed files
with
21 additions
and
21 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
40 changes: 20 additions & 20 deletions
40
dbt_jardiner/models/jardiner/raw/gestio_actius/raw_gestio_actius__signal_denormalized.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,26 +1,26 @@ | ||
{{ config(materialized="view") }} | ||
|
||
with | ||
fresh as ( | ||
select * | ||
from {{ ref("snapshot_signal_denormalized") }} | ||
where dbt_valid_to is null | ||
), | ||
fresh as ( | ||
select * | ||
from {{ ref("snapshot_signal_denormalized") }} | ||
where dbt_valid_to is null | ||
), | ||
|
||
base as ( | ||
select | ||
plant_uuid::uuid, | ||
plant::text as plant_name, | ||
signal::text as signal_name, | ||
metric::text as metric_name, | ||
device::text as device_name, | ||
device_type::text, | ||
device_uuid::uuid, | ||
device_parent::text, | ||
signal_uuid::uuid, | ||
inserted_at::timestamptz, | ||
updated_at::timestamptz | ||
from fresh | ||
) | ||
base as ( | ||
select | ||
plant_uuid::uuid, | ||
trim(plant::text) as plant_name, | ||
trim(signal::text) as signal_name, | ||
metric::text as metric_name, | ||
trim(device::text) as device_name, | ||
device_type::text, | ||
device_uuid::uuid, | ||
trim(device_parent::text) as device_parent, | ||
signal_uuid::uuid, | ||
inserted_at::timestamptz, | ||
updated_at::timestamptz | ||
from fresh | ||
) | ||
|
||
select * from base |