Skip to content

Commit

Permalink
Finish implementing initial support for DuckDB
Browse files Browse the repository at this point in the history
  • Loading branch information
gwenwindflower committed Apr 14, 2024
1 parent 9b13827 commit f51b08d
Show file tree
Hide file tree
Showing 9 changed files with 360 additions and 0 deletions.
169 changes: 169 additions & 0 deletions test_build/_sources.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
sources:
- name: customers
columns:
- name: customer_id
description: ""
data_type: INTEGER
tests: []
- name: first_name
description: ""
data_type: VARCHAR
tests: []
- name: last_name
description: ""
data_type: VARCHAR
tests: []
- name: first_order
description: ""
data_type: DATE
tests: []
- name: most_recent_order
description: ""
data_type: DATE
tests: []
- name: number_of_orders
description: ""
data_type: BIGINT
tests: []
- name: customer_lifetime_value
description: ""
data_type: DOUBLE
tests: []
- name: orders
columns:
- name: order_id
description: ""
data_type: INTEGER
tests: []
- name: customer_id
description: ""
data_type: INTEGER
tests: []
- name: order_date
description: ""
data_type: DATE
tests: []
- name: status
description: ""
data_type: VARCHAR
tests: []
- name: credit_card_amount
description: ""
data_type: DOUBLE
tests: []
- name: coupon_amount
description: ""
data_type: DOUBLE
tests: []
- name: bank_transfer_amount
description: ""
data_type: DOUBLE
tests: []
- name: gift_card_amount
description: ""
data_type: DOUBLE
tests: []
- name: amount
description: ""
data_type: DOUBLE
tests: []
- name: raw_customers
columns:
- name: id
description: ""
data_type: INTEGER
tests: []
- name: first_name
description: ""
data_type: VARCHAR
tests: []
- name: last_name
description: ""
data_type: VARCHAR
tests: []
- name: raw_orders
columns:
- name: id
description: ""
data_type: INTEGER
tests: []
- name: user_id
description: ""
data_type: INTEGER
tests: []
- name: order_date
description: ""
data_type: DATE
tests: []
- name: status
description: ""
data_type: VARCHAR
tests: []
- name: raw_payments
columns:
- name: id
description: ""
data_type: INTEGER
tests: []
- name: order_id
description: ""
data_type: INTEGER
tests: []
- name: payment_method
description: ""
data_type: VARCHAR
tests: []
- name: amount
description: ""
data_type: INTEGER
tests: []
- name: stg_customers
columns:
- name: customer_id
description: ""
data_type: INTEGER
tests: []
- name: first_name
description: ""
data_type: VARCHAR
tests: []
- name: last_name
description: ""
data_type: VARCHAR
tests: []
- name: stg_orders
columns:
- name: order_id
description: ""
data_type: INTEGER
tests: []
- name: customer_id
description: ""
data_type: INTEGER
tests: []
- name: order_date
description: ""
data_type: DATE
tests: []
- name: status
description: ""
data_type: VARCHAR
tests: []
- name: stg_payments
columns:
- name: payment_id
description: ""
data_type: INTEGER
tests: []
- name: order_id
description: ""
data_type: INTEGER
tests: []
- name: payment_method
description: ""
data_type: VARCHAR
tests: []
- name: amount
description: ""
data_type: DOUBLE
tests: []
27 changes: 27 additions & 0 deletions test_build/stg_customers.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
with

source as (

select * from {{ ref('customers') }}

),

renamed as (

select
-- datetimes
first_order as first_order,
most_recent_order as most_recent_order,

-- numbers
customer_id as customer_id,
number_of_orders as number_of_orders,

-- text
first_name as first_name,
last_name as last_name,

from source
)

select * from renamed
25 changes: 25 additions & 0 deletions test_build/stg_orders.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
with

source as (

select * from {{ ref('orders') }}

),

renamed as (

select
-- datetimes
order_date as order_date,

-- numbers
order_id as order_id,
customer_id as customer_id,

-- text
status as status,

from source
)

select * from renamed
22 changes: 22 additions & 0 deletions test_build/stg_raw_customers.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
with

source as (

select * from {{ ref('raw_customers') }}

),

renamed as (

select
-- numbers
id as id,

-- text
first_name as first_name,
last_name as last_name,

from source
)

select * from renamed
25 changes: 25 additions & 0 deletions test_build/stg_raw_orders.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
with

source as (

select * from {{ ref('raw_orders') }}

),

renamed as (

select
-- datetimes
order_date as order_date,

-- numbers
id as id,
user_id as user_id,

-- text
status as status,

from source
)

select * from renamed
23 changes: 23 additions & 0 deletions test_build/stg_raw_payments.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
with

source as (

select * from {{ ref('raw_payments') }}

),

renamed as (

select
-- numbers
id as id,
order_id as order_id,
amount as amount,

-- text
payment_method as payment_method,

from source
)

select * from renamed
22 changes: 22 additions & 0 deletions test_build/stg_stg_customers.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
with

source as (

select * from {{ ref('stg_customers') }}

),

renamed as (

select
-- numbers
customer_id as customer_id,

-- text
first_name as first_name,
last_name as last_name,

from source
)

select * from renamed
25 changes: 25 additions & 0 deletions test_build/stg_stg_orders.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
with

source as (

select * from {{ ref('stg_orders') }}

),

renamed as (

select
-- datetimes
order_date as order_date,

-- numbers
order_id as order_id,
customer_id as customer_id,

-- text
status as status,

from source
)

select * from renamed
22 changes: 22 additions & 0 deletions test_build/stg_stg_payments.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
with

source as (

select * from {{ ref('stg_payments') }}

),

renamed as (

select
-- numbers
payment_id as payment_id,
order_id as order_id,

-- text
payment_method as payment_method,

from source
)

select * from renamed

0 comments on commit f51b08d

Please sign in to comment.