mirror of
https://gitlab.com/cief-data/dbt_cloud.git
synced 2026-08-19 04:14:00 +00:00
base model
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
-- IMPORTS
|
||||
WITH source AS (
|
||||
SELECT * FROM {{ source('src_exchange_mysql', 'vouchers') }}
|
||||
|
||||
),
|
||||
|
||||
-- LOGIC
|
||||
vouchers_rename AS (
|
||||
|
||||
SELECT
|
||||
id AS voucher_id,
|
||||
name,
|
||||
code,
|
||||
type,
|
||||
value AS voucher_credit,
|
||||
created_at AS created_datetime,
|
||||
updated_at AS updated_datetime,
|
||||
'{{ modules.datetime.datetime.now(modules.pytz.timezone("Asia/Kuala_Lumpur")) }}' AS _dbt_ran_datetime
|
||||
|
||||
FROM source
|
||||
|
||||
),
|
||||
|
||||
-- FINAL
|
||||
final__base_exchange__vouchers AS (
|
||||
|
||||
SELECT
|
||||
-- ids
|
||||
voucher_id,
|
||||
|
||||
-- dimensions
|
||||
name,
|
||||
code,
|
||||
type,
|
||||
voucher_credit,
|
||||
|
||||
-- measures
|
||||
|
||||
-- date/times
|
||||
created_datetime,
|
||||
updated_datetime,
|
||||
|
||||
-- metadata
|
||||
_dbt_ran_datetime
|
||||
|
||||
FROM vouchers_rename
|
||||
|
||||
)
|
||||
|
||||
SELECT * FROM final__base_exchange__vouchers
|
||||
Reference in New Issue
Block a user