mirror of
https://gitlab.com/cief-data/dbt_cloud.git
synced 2026-08-19 12:24:04 +00:00
base model
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
-- IMPORTS
|
||||
WITH source AS (
|
||||
SELECT * FROM {{ source('src_exchange_mysql', 'voucher_redemptions') }}
|
||||
|
||||
),
|
||||
|
||||
-- LOGIC
|
||||
voucher_redemptions_rename AS (
|
||||
|
||||
SELECT
|
||||
id AS voucher_redemption_id,
|
||||
voucher_id,
|
||||
transaction_id,
|
||||
redemption_id,
|
||||
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__voucher_redemptions AS (
|
||||
|
||||
SELECT
|
||||
-- ids
|
||||
voucher_redemption_id,
|
||||
voucher_id,
|
||||
transaction_id,
|
||||
redemption_id,
|
||||
|
||||
-- dimensions
|
||||
voucher_credit,
|
||||
|
||||
-- measures
|
||||
|
||||
-- date/times
|
||||
created_datetime,
|
||||
updated_datetime,
|
||||
|
||||
-- metadata
|
||||
_dbt_ran_datetime
|
||||
|
||||
FROM voucher_redemptions_rename
|
||||
|
||||
)
|
||||
|
||||
SELECT * FROM final__base_exchange__voucher_redemptions
|
||||
Reference in New Issue
Block a user