From 0e9ade31ab978f3cacee21a005d691280d7dee3f Mon Sep 17 00:00:00 2001 From: David Griffiths Date: Sat, 4 Nov 2023 23:12:09 +0000 Subject: [PATCH 1/9] making some regression errors and linting issues --- models/marts/orders.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/marts/orders.sql b/models/marts/orders.sql index 3726c92..31df64f 100644 --- a/models/marts/orders.sql +++ b/models/marts/orders.sql @@ -36,7 +36,7 @@ compute_booleans as ( orders.*, order_items_summary.order_cost, order_items_summary.count_food_items > 0 as is_food_order, - order_items_summary.count_drink_items > 0 as is_drink_order + count_drink_items > 1 as is_drink_order -- making some regression errors and linting issues from orders From 8b252aa11c4181a6c823ba62d4ad6ebf5fdb77d1 Mon Sep 17 00:00:00 2001 From: David Griffiths Date: Sat, 4 Nov 2023 23:25:49 +0000 Subject: [PATCH 2/9] creating an error by breaking order_id with ref integrity error --- models/marts/orders.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/marts/orders.sql b/models/marts/orders.sql index 31df64f..1f4f113 100644 --- a/models/marts/orders.sql +++ b/models/marts/orders.sql @@ -16,7 +16,7 @@ order_items_summary as ( select - order_items.order_id, + 1 as order_id, -- order_items.order_id, -- what a rookie error sum(order_items.supply_cost) as order_cost, sum(order_items.is_food_item) as count_food_items, @@ -45,4 +45,4 @@ compute_booleans as ( on orders.order_id = order_items_summary.order_id ) -select * from compute_booleans +select * from order_items_summary From 823b988dbf0d599fd614129a87d5e58b3c67f23d Mon Sep 17 00:00:00 2001 From: David Griffiths Date: Wed, 8 Nov 2023 02:00:03 +0000 Subject: [PATCH 3/9] fixing errors --- models/marts/orders.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/models/marts/orders.sql b/models/marts/orders.sql index 1f4f113..0333979 100644 --- a/models/marts/orders.sql +++ b/models/marts/orders.sql @@ -16,8 +16,8 @@ order_items_summary as ( select - 1 as order_id, -- order_items.order_id, -- what a rookie error - + -- 1 as order_id, -- order_items.order_id, -- what a rookie error + order_items.order_id, sum(order_items.supply_cost) as order_cost, sum(order_items.is_food_item) as count_food_items, sum(order_items.is_drink_item) as count_drink_items @@ -36,7 +36,7 @@ compute_booleans as ( orders.*, order_items_summary.order_cost, order_items_summary.count_food_items > 0 as is_food_order, - count_drink_items > 1 as is_drink_order -- making some regression errors and linting issues + count_drink_items as is_drink_order from orders From 2ee3fb6a2ff9c0046e7aa07c376a3ce097b9c78b Mon Sep 17 00:00:00 2001 From: David Griffiths Date: Wed, 8 Nov 2023 02:05:09 +0000 Subject: [PATCH 4/9] more fixing --- models/marts/orders.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/marts/orders.sql b/models/marts/orders.sql index 0333979..2ddc893 100644 --- a/models/marts/orders.sql +++ b/models/marts/orders.sql @@ -45,4 +45,4 @@ compute_booleans as ( on orders.order_id = order_items_summary.order_id ) -select * from order_items_summary +select * from compute_booleans From 2f3f41bf745f2b7d58fbc56ff1300b35f5e0180d Mon Sep 17 00:00:00 2001 From: David Griffiths Date: Wed, 8 Nov 2023 02:06:05 +0000 Subject: [PATCH 5/9] fixing --- models/marts/orders.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/marts/orders.sql b/models/marts/orders.sql index 2ddc893..342a787 100644 --- a/models/marts/orders.sql +++ b/models/marts/orders.sql @@ -35,8 +35,8 @@ compute_booleans as ( orders.*, order_items_summary.order_cost, - order_items_summary.count_food_items > 0 as is_food_order, - count_drink_items as is_drink_order + count_drink_items as is_drink_order, + order_items_summary.count_food_items > 0 as is_food_order from orders From d9b3d1068fa29f94803c6467ae177b6d68d92b26 Mon Sep 17 00:00:00 2001 From: David Griffiths Date: Wed, 8 Nov 2023 02:19:58 +0000 Subject: [PATCH 6/9] fixes --- models/marts/orders.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/marts/orders.sql b/models/marts/orders.sql index 342a787..0400a7e 100644 --- a/models/marts/orders.sql +++ b/models/marts/orders.sql @@ -35,8 +35,8 @@ compute_booleans as ( orders.*, order_items_summary.order_cost, - count_drink_items as is_drink_order, - order_items_summary.count_food_items > 0 as is_food_order + order_items_summary.count_drink_items as is_drink_order, + order_items_summary.count_food_items as is_food_order from orders From 870effc0a0ba6b0a37460ce40965528808f6e9f4 Mon Sep 17 00:00:00 2001 From: David Griffiths Date: Wed, 8 Nov 2023 02:26:30 +0000 Subject: [PATCH 7/9] lets make some errors! --- models/marts/orders.sql | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/models/marts/orders.sql b/models/marts/orders.sql index 0400a7e..68819af 100644 --- a/models/marts/orders.sql +++ b/models/marts/orders.sql @@ -16,8 +16,7 @@ order_items_summary as ( select - -- 1 as order_id, -- order_items.order_id, -- what a rookie error - order_items.order_id, + 1 as order_id, -- order_items.order_id, -- what a rookie error sum(order_items.supply_cost) as order_cost, sum(order_items.is_food_item) as count_food_items, sum(order_items.is_drink_item) as count_drink_items From ed19cd2e16ad659384b553d7421bdfd571671f29 Mon Sep 17 00:00:00 2001 From: David Griffiths Date: Wed, 8 Nov 2023 02:29:06 +0000 Subject: [PATCH 8/9] errors! --- models/marts/orders.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/marts/orders.sql b/models/marts/orders.sql index 68819af..1700ba1 100644 --- a/models/marts/orders.sql +++ b/models/marts/orders.sql @@ -16,7 +16,7 @@ order_items_summary as ( select - 1 as order_id, -- order_items.order_id, -- what a rookie error + '1' as order_id, -- order_items.order_id, -- what a rookie error sum(order_items.supply_cost) as order_cost, sum(order_items.is_food_item) as count_food_items, sum(order_items.is_drink_item) as count_drink_items From 5b88c85ac8de16cfd35730f50f87abf8528c67ff Mon Sep 17 00:00:00 2001 From: David Griffiths Date: Wed, 8 Nov 2023 02:34:48 +0000 Subject: [PATCH 9/9] removing rows --- models/marts/orders.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/marts/orders.sql b/models/marts/orders.sql index 1700ba1..23e740e 100644 --- a/models/marts/orders.sql +++ b/models/marts/orders.sql @@ -44,4 +44,4 @@ compute_booleans as ( on orders.order_id = order_items_summary.order_id ) -select * from compute_booleans +select * from compute_booleans limit 100