Skip to content

Instantly share code, notes, and snippets.

@vvgsrk
Created April 26, 2022 10:48
Show Gist options
  • Save vvgsrk/6ff49d064e4b6ef01156bf1da7b8ebe6 to your computer and use it in GitHub Desktop.
Save vvgsrk/6ff49d064e4b6ef01156bf1da7b8ebe6 to your computer and use it in GitHub Desktop.
Product management product history query in DBT Source layer
WITH source AS (
SELECT
*
FROM
{{ source(
'product_management',
'product_history'
) }}
),
renamed AS (
SELECT
"PRODUCT_ID" AS "PRODUCT_ID",
"PRODUCT_NAME" AS "PRODUCT_NAME",
"PRICE_PER_UNIT" AS "PRICE_PER_UNIT",
"BASIC_UNIT" AS "BASIC_UNIT",
"IS_STOCK_LIMITED" AS "IS_STOCK_LIMITED",
"IS_ACTIVE_FOR_SALE" AS "IS_ACTIVE_FOR_SALE",
"__EVENT_TS" AS "__EVENT_TS",
"__LOAD_TS" AS "__LOAD_TS"
FROM
source
)
SELECT
*
FROM
renamed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment