Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions models/staging/stg_customers.sql
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@
with


source as (


select * from {{ source('ecom', 'raw_customers') }}


),


renamed as (

select

---------- ids
-- ================= identifiers =================
cast(id as varchar) as customer_id,

---------- text

-- ================= text fields =================
name as customer_name


from source

)


select * from renamed
10 changes: 5 additions & 5 deletions models/staging/stg_locations.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ renamed as (

select

---------- ids
-- primary key: location identifier
cast(id as varchar) as location_id,

---------- text
-- display name for the location
name as location_name,

---------- numerics
-- tax rate applied at this location (percentage)
tax_rate,

---------- timestamps
-- opening date, truncated to day granularity
{{ dbt.date_trunc('day', 'opened_at') }} as opened_date

from source

)

select * from renamed
SELECT * FROM renamed