Compare commits

..

9 Commits

Author SHA1 Message Date
Ubuntu 4b86cd5551 add give_gift data 2022-06-01 17:30:33 +07:00
Ubuntu c5c4d4cfcc add sync b rands 2022-05-27 21:47:46 +07:00
Ubuntu 25bf52e4c0 update 2022-05-26 21:44:20 +07:00
Ubuntu a27c99cf15 update 2022-05-12 05:53:59 +07:00
Ubuntu f6af10b64d update 2022-05-11 16:47:34 +07:00
Ubuntu c92bdc7cb4 update 2022-05-11 11:54:13 +07:00
Ubuntu 9b3f73cec2 update 2022-05-11 11:23:31 +07:00
Ubuntu a2286f7773 update 2022-05-11 11:21:03 +07:00
Ubuntu eef556e75c update 2022-05-11 09:44:48 +07:00
700 changed files with 922 additions and 14029 deletions

View File

@ -6,5 +6,5 @@ push:
run:
dbt deps --profiles-dir=. --project-dir=.
#dbt run --profiles-dir=. --project-dir=. --full-refresh
dbt run --profiles-dir=. --project-dir=. --full-refresh --select session_deliveries
dbt run --profiles-dir=. --project-dir=. --full-refresh --select user_give_gift

View File

@ -53,6 +53,10 @@ vars:
admin_tags_ab2: unibag._airbyte_raw_admin_tags
admin_tags_ab3: unibag._airbyte_raw_admin_tags
admin_tags: unibag._airbyte_raw_admin_tags
brands_ab1: unibag._airbyte_raw_brands
brands_ab2: unibag._airbyte_raw_brands
brands_ab3: unibag._airbyte_raw_brands
brands: unibag._airbyte_raw_brands
cash_flows_ab1: unibag._airbyte_raw_cash_flows
cash_flows_ab2: unibag._airbyte_raw_cash_flows
cash_flows_ab3: unibag._airbyte_raw_cash_flows
@ -77,6 +81,10 @@ vars:
events_ab2: unibag._airbyte_raw_events
events_ab3: unibag._airbyte_raw_events
events: unibag._airbyte_raw_events
give_gifts_ab1: unibag._airbyte_raw_give_gifts
give_gifts_ab2: unibag._airbyte_raw_give_gifts
give_gifts_ab3: unibag._airbyte_raw_give_gifts
give_gifts: unibag._airbyte_raw_give_gifts
inventories_ab1: unibag._airbyte_raw_inventories
inventories_ab2: unibag._airbyte_raw_inventories
inventories_ab3: unibag._airbyte_raw_inventories
@ -165,6 +173,10 @@ vars:
team_bonus_ab2: unibag._airbyte_raw_team_bonus
team_bonus_ab3: unibag._airbyte_raw_team_bonus
team_bonus: unibag._airbyte_raw_team_bonus
team_histories_ab1: unibag._airbyte_raw_team_histories
team_histories_ab2: unibag._airbyte_raw_team_histories
team_histories_ab3: unibag._airbyte_raw_team_histories
team_histories: unibag._airbyte_raw_team_histories
team_members_ab1: unibag._airbyte_raw_team_members
team_members_ab2: unibag._airbyte_raw_team_members
team_members_ab3: unibag._airbyte_raw_team_members
@ -173,6 +185,14 @@ vars:
teams_ab2: unibag._airbyte_raw_teams
teams_ab3: unibag._airbyte_raw_teams
teams: unibag._airbyte_raw_teams
user_courses_ab1: unibag._airbyte_raw_user_courses
user_courses_ab2: unibag._airbyte_raw_user_courses
user_courses_ab3: unibag._airbyte_raw_user_courses
user_courses: unibag._airbyte_raw_user_courses
user_give_gift_ab1: unibag._airbyte_raw_user_give_gift
user_give_gift_ab2: unibag._airbyte_raw_user_give_gift
user_give_gift_ab3: unibag._airbyte_raw_user_give_gift
user_give_gift: unibag._airbyte_raw_user_give_gift
user_identifications_ab1: unibag._airbyte_raw_user_identifications
user_identifications_ab2: unibag._airbyte_raw_user_identifications
user_identifications_ab3: unibag._airbyte_raw_user_identifications
@ -193,599 +213,3 @@ vars:
wards_ab2: unibag._airbyte_raw_wards
wards_ab3: unibag._airbyte_raw_wards
wards: unibag._airbyte_raw_wards
cash_flows_options_ab1: unibag._airbyte_raw_cash_flows
cash_flows_options_ab2: unibag._airbyte_raw_cash_flows
cash_flows_options_ab3: unibag._airbyte_raw_cash_flows
cash_flows_options: unibag._airbyte_raw_cash_flows
customers_info_ab1: unibag._airbyte_raw_customers
customers_info_ab2: unibag._airbyte_raw_customers
customers_info_ab3: unibag._airbyte_raw_customers
customers_info: unibag._airbyte_raw_customers
customers_statistic_ab1: unibag._airbyte_raw_customers
customers_statistic_ab2: unibag._airbyte_raw_customers
customers_statistic_ab3: unibag._airbyte_raw_customers
customers_statistic: unibag._airbyte_raw_customers
event_rewards_options_ab1: unibag._airbyte_raw_event_rewards
event_rewards_options_ab2: unibag._airbyte_raw_event_rewards
event_rewards_options_ab3: unibag._airbyte_raw_event_rewards
event_rewards_options: unibag._airbyte_raw_event_rewards
events_icon_ab1: unibag._airbyte_raw_events
events_icon_ab2: unibag._airbyte_raw_events
events_icon_ab3: unibag._airbyte_raw_events
events_icon: unibag._airbyte_raw_events
events_cover_ab1: unibag._airbyte_raw_events
events_cover_ab2: unibag._airbyte_raw_events
events_cover_ab3: unibag._airbyte_raw_events
events_cover: unibag._airbyte_raw_events
events_notice_ab1: unibag._airbyte_raw_events
events_notice_ab2: unibag._airbyte_raw_events
events_notice_ab3: unibag._airbyte_raw_events
events_notice: unibag._airbyte_raw_events
events_options_ab1: unibag._airbyte_raw_events
events_options_ab2: unibag._airbyte_raw_events
events_options_ab3: unibag._airbyte_raw_events
events_options: unibag._airbyte_raw_events
events_segments_ab1: unibag._airbyte_raw_events
events_segments_ab2: unibag._airbyte_raw_events
events_segments_ab3: unibag._airbyte_raw_events
events_segments: unibag._airbyte_raw_events
inventories_contact_ab1: unibag._airbyte_raw_inventories
inventories_contact_ab2: unibag._airbyte_raw_inventories
inventories_contact_ab3: unibag._airbyte_raw_inventories
inventories_contact: unibag._airbyte_raw_inventories
inventories_partner_ab1: unibag._airbyte_raw_inventories
inventories_partner_ab2: unibag._airbyte_raw_inventories
inventories_partner_ab3: unibag._airbyte_raw_inventories
inventories_partner: unibag._airbyte_raw_inventories
inventories_location_ab1: unibag._airbyte_raw_inventories
inventories_location_ab2: unibag._airbyte_raw_inventories
inventories_location_ab3: unibag._airbyte_raw_inventories
inventories_location: unibag._airbyte_raw_inventories
inventories_supplier_ab1: unibag._airbyte_raw_inventories
inventories_supplier_ab2: unibag._airbyte_raw_inventories
inventories_supplier_ab3: unibag._airbyte_raw_inventories
inventories_supplier: unibag._airbyte_raw_inventories
inventories_paymentmethods_ab1: unibag._airbyte_raw_inventories
inventories_paymentmethods_ab2: unibag._airbyte_raw_inventories
inventories_paymentmethods_ab3: unibag._airbyte_raw_inventories
inventories_paymentmethods: unibag._airbyte_raw_inventories
membership_histories_new_ab1: unibag._airbyte_raw_membership_histories
membership_histories_new_ab2: unibag._airbyte_raw_membership_histories
membership_histories_new_ab3: unibag._airbyte_raw_membership_histories
membership_histories_new: unibag._airbyte_raw_membership_histories
membership_histories_old_ab1: unibag._airbyte_raw_membership_histories
membership_histories_old_ab2: unibag._airbyte_raw_membership_histories
membership_histories_old_ab3: unibag._airbyte_raw_membership_histories
membership_histories_old: unibag._airbyte_raw_membership_histories
order_deliveries_weight_ab1: unibag._airbyte_raw_order_deliveries
order_deliveries_weight_ab2: unibag._airbyte_raw_order_deliveries
order_deliveries_weight_ab3: unibag._airbyte_raw_order_deliveries
order_deliveries_weight: unibag._airbyte_raw_order_deliveries
order_deliveries_customer_ab1: unibag._airbyte_raw_order_deliveries
order_deliveries_customer_ab2: unibag._airbyte_raw_order_deliveries
order_deliveries_customer_ab3: unibag._airbyte_raw_order_deliveries
order_deliveries_customer: unibag._airbyte_raw_order_deliveries
order_deliveries_delivery_ab1: unibag._airbyte_raw_order_deliveries
order_deliveries_delivery_ab2: unibag._airbyte_raw_order_deliveries
order_deliveries_delivery_ab3: unibag._airbyte_raw_order_deliveries
order_deliveries_delivery: unibag._airbyte_raw_order_deliveries
order_deliveries_location_ab1: unibag._airbyte_raw_order_deliveries
order_deliveries_location_ab2: unibag._airbyte_raw_order_deliveries
order_deliveries_location_ab3: unibag._airbyte_raw_order_deliveries
order_deliveries_location: unibag._airbyte_raw_order_deliveries
order_deliveries_promotion_ab1: unibag._airbyte_raw_order_deliveries
order_deliveries_promotion_ab2: unibag._airbyte_raw_order_deliveries
order_deliveries_promotion_ab3: unibag._airbyte_raw_order_deliveries
order_deliveries_promotion: unibag._airbyte_raw_order_deliveries
order_deliveries_trackingtime_ab1: unibag._airbyte_raw_order_deliveries
order_deliveries_trackingtime_ab2: unibag._airbyte_raw_order_deliveries
order_deliveries_trackingtime_ab3: unibag._airbyte_raw_order_deliveries
order_deliveries_trackingtime: unibag._airbyte_raw_order_deliveries
order_items_sku_ab1: unibag._airbyte_raw_order_items
order_items_sku_ab2: unibag._airbyte_raw_order_items
order_items_sku_ab3: unibag._airbyte_raw_order_items
order_items_sku: unibag._airbyte_raw_order_items
order_items_price_ab1: unibag._airbyte_raw_order_items
order_items_price_ab2: unibag._airbyte_raw_order_items
order_items_price_ab3: unibag._airbyte_raw_order_items
order_items_price: unibag._airbyte_raw_order_items
orders_price_ab1: unibag._airbyte_raw_orders
orders_price_ab2: unibag._airbyte_raw_orders
orders_price_ab3: unibag._airbyte_raw_orders
orders_price: unibag._airbyte_raw_orders
orders_payment_ab1: unibag._airbyte_raw_orders
orders_payment_ab2: unibag._airbyte_raw_orders
orders_payment_ab3: unibag._airbyte_raw_orders
orders_payment: unibag._airbyte_raw_orders
orders_delivery_ab1: unibag._airbyte_raw_orders
orders_delivery_ab2: unibag._airbyte_raw_orders
orders_delivery_ab3: unibag._airbyte_raw_orders
orders_delivery: unibag._airbyte_raw_orders
orders_supplier_ab1: unibag._airbyte_raw_orders
orders_supplier_ab2: unibag._airbyte_raw_orders
orders_supplier_ab3: unibag._airbyte_raw_orders
orders_supplier: unibag._airbyte_raw_orders
orders_inventory_ab1: unibag._airbyte_raw_orders
orders_inventory_ab2: unibag._airbyte_raw_orders
orders_inventory_ab3: unibag._airbyte_raw_orders
orders_inventory: unibag._airbyte_raw_orders
orders_promotion_ab1: unibag._airbyte_raw_orders
orders_promotion_ab2: unibag._airbyte_raw_orders
orders_promotion_ab3: unibag._airbyte_raw_orders
orders_promotion: unibag._airbyte_raw_orders
orders_sendemail_ab1: unibag._airbyte_raw_orders
orders_sendemail_ab2: unibag._airbyte_raw_orders
orders_sendemail_ab3: unibag._airbyte_raw_orders
orders_sendemail: unibag._airbyte_raw_orders
orders_useragent_ab1: unibag._airbyte_raw_orders
orders_useragent_ab2: unibag._airbyte_raw_orders
orders_useragent_ab3: unibag._airbyte_raw_orders
orders_useragent: unibag._airbyte_raw_orders
product_categories_icon_ab1: unibag._airbyte_raw_product_categories
product_categories_icon_ab2: unibag._airbyte_raw_product_categories
product_categories_icon_ab3: unibag._airbyte_raw_product_categories
product_categories_icon: unibag._airbyte_raw_product_categories
product_categories_statistic_ab1: unibag._airbyte_raw_product_categories
product_categories_statistic_ab2: unibag._airbyte_raw_product_categories
product_categories_statistic_ab3: unibag._airbyte_raw_product_categories
product_categories_statistic: unibag._airbyte_raw_product_categories
product_sku_info_ab1: unibag._airbyte_raw_product_sku
product_sku_info_ab2: unibag._airbyte_raw_product_sku
product_sku_info_ab3: unibag._airbyte_raw_product_sku
product_sku_info: unibag._airbyte_raw_product_sku
product_sku_price_ab1: unibag._airbyte_raw_product_sku
product_sku_price_ab2: unibag._airbyte_raw_product_sku
product_sku_price_ab3: unibag._airbyte_raw_product_sku
product_sku_price: unibag._airbyte_raw_product_sku
product_sku_statistic_ab1: unibag._airbyte_raw_product_sku
product_sku_statistic_ab2: unibag._airbyte_raw_product_sku
product_sku_statistic_ab3: unibag._airbyte_raw_product_sku
product_sku_statistic: unibag._airbyte_raw_product_sku
product_sku_pricepercent_ab1: unibag._airbyte_raw_product_sku
product_sku_pricepercent_ab2: unibag._airbyte_raw_product_sku
product_sku_pricepercent_ab3: unibag._airbyte_raw_product_sku
product_sku_pricepercent: unibag._airbyte_raw_product_sku
product_sku_versions_info_ab1: unibag._airbyte_raw_product_sku_versions
product_sku_versions_info_ab2: unibag._airbyte_raw_product_sku_versions
product_sku_versions_info_ab3: unibag._airbyte_raw_product_sku_versions
product_sku_versions_info: unibag._airbyte_raw_product_sku_versions
product_sku_versions_price_ab1: unibag._airbyte_raw_product_sku_versions
product_sku_versions_price_ab2: unibag._airbyte_raw_product_sku_versions
product_sku_versions_price_ab3: unibag._airbyte_raw_product_sku_versions
product_sku_versions_price: unibag._airbyte_raw_product_sku_versions
product_sku_versions_statistic_ab1: unibag._airbyte_raw_product_sku_versions
product_sku_versions_statistic_ab2: unibag._airbyte_raw_product_sku_versions
product_sku_versions_statistic_ab3: unibag._airbyte_raw_product_sku_versions
product_sku_versions_statistic: unibag._airbyte_raw_product_sku_versions
products_info_ab1: unibag._airbyte_raw_products
products_info_ab2: unibag._airbyte_raw_products
products_info_ab3: unibag._airbyte_raw_products
products_info: unibag._airbyte_raw_products
products_order_ab1: unibag._airbyte_raw_products
products_order_ab2: unibag._airbyte_raw_products
products_order_ab3: unibag._airbyte_raw_products
products_order: unibag._airbyte_raw_products
products_price_ab1: unibag._airbyte_raw_products
products_price_ab2: unibag._airbyte_raw_products
products_price_ab3: unibag._airbyte_raw_products
products_price: unibag._airbyte_raw_products
products_score_ab1: unibag._airbyte_raw_products
products_score_ab2: unibag._airbyte_raw_products
products_score_ab3: unibag._airbyte_raw_products
products_score: unibag._airbyte_raw_products
products_statistic_ab1: unibag._airbyte_raw_products
products_statistic_ab2: unibag._airbyte_raw_products
products_statistic_ab3: unibag._airbyte_raw_products
products_statistic: unibag._airbyte_raw_products
products_pricepercent_ab1: unibag._airbyte_raw_products
products_pricepercent_ab2: unibag._airbyte_raw_products
products_pricepercent_ab3: unibag._airbyte_raw_products
products_pricepercent: unibag._airbyte_raw_products
products_sharestatistic_ab1: unibag._airbyte_raw_products
products_sharestatistic_ab2: unibag._airbyte_raw_products
products_sharestatistic_ab3: unibag._airbyte_raw_products
products_sharestatistic: unibag._airbyte_raw_products
products_reviewstatistic_ab1: unibag._airbyte_raw_products
products_reviewstatistic_ab2: unibag._airbyte_raw_products
products_reviewstatistic_ab3: unibag._airbyte_raw_products
products_reviewstatistic: unibag._airbyte_raw_products
promotion_orders_supplier_ab1: unibag._airbyte_raw_promotion_orders
promotion_orders_supplier_ab2: unibag._airbyte_raw_promotion_orders
promotion_orders_supplier_ab3: unibag._airbyte_raw_promotion_orders
promotion_orders_supplier: unibag._airbyte_raw_promotion_orders
promotions_options_ab1: unibag._airbyte_raw_promotions
promotions_options_ab2: unibag._airbyte_raw_promotions
promotions_options_ab3: unibag._airbyte_raw_promotions
promotions_options: unibag._airbyte_raw_promotions
promotions_applyfor_ab1: unibag._airbyte_raw_promotions
promotions_applyfor_ab2: unibag._airbyte_raw_promotions
promotions_applyfor_ab3: unibag._airbyte_raw_promotions
promotions_applyfor: unibag._airbyte_raw_promotions
promotions_statistic_ab1: unibag._airbyte_raw_promotions
promotions_statistic_ab2: unibag._airbyte_raw_promotions
promotions_statistic_ab3: unibag._airbyte_raw_promotions
promotions_statistic: unibag._airbyte_raw_promotions
promotions_conditionforuser_ab1: unibag._airbyte_raw_promotions
promotions_conditionforuser_ab2: unibag._airbyte_raw_promotions
promotions_conditionforuser_ab3: unibag._airbyte_raw_promotions
promotions_conditionforuser: unibag._airbyte_raw_promotions
promotions_suppliercommission_ab1: unibag._airbyte_raw_promotions
promotions_suppliercommission_ab2: unibag._airbyte_raw_promotions
promotions_suppliercommission_ab3: unibag._airbyte_raw_promotions
promotions_suppliercommission: unibag._airbyte_raw_promotions
session_deliveries_request_ab1: unibag._airbyte_raw_session_deliveries
session_deliveries_request_ab2: unibag._airbyte_raw_session_deliveries
session_deliveries_request_ab3: unibag._airbyte_raw_session_deliveries
session_deliveries_request: unibag._airbyte_raw_session_deliveries
session_deliveries_customer_ab1: unibag._airbyte_raw_session_deliveries
session_deliveries_customer_ab2: unibag._airbyte_raw_session_deliveries
session_deliveries_customer_ab3: unibag._airbyte_raw_session_deliveries
session_deliveries_customer: unibag._airbyte_raw_session_deliveries
session_deliveries_delivery_ab1: unibag._airbyte_raw_session_deliveries
session_deliveries_delivery_ab2: unibag._airbyte_raw_session_deliveries
session_deliveries_delivery_ab3: unibag._airbyte_raw_session_deliveries
session_deliveries_delivery: unibag._airbyte_raw_session_deliveries
session_deliveries_location_ab1: unibag._airbyte_raw_session_deliveries
session_deliveries_location_ab2: unibag._airbyte_raw_session_deliveries
session_deliveries_location_ab3: unibag._airbyte_raw_session_deliveries
session_deliveries_location: unibag._airbyte_raw_session_deliveries
session_deliveries_promotion_ab1: unibag._airbyte_raw_session_deliveries
session_deliveries_promotion_ab2: unibag._airbyte_raw_session_deliveries
session_deliveries_promotion_ab3: unibag._airbyte_raw_session_deliveries
session_deliveries_promotion: unibag._airbyte_raw_session_deliveries
social_posts_statistic_ab1: unibag._airbyte_raw_social_posts
social_posts_statistic_ab2: unibag._airbyte_raw_social_posts
social_posts_statistic_ab3: unibag._airbyte_raw_social_posts
social_posts_statistic: unibag._airbyte_raw_social_posts
social_posts_sharestatistic_ab1: unibag._airbyte_raw_social_posts
social_posts_sharestatistic_ab2: unibag._airbyte_raw_social_posts
social_posts_sharestatistic_ab3: unibag._airbyte_raw_social_posts
social_posts_sharestatistic: unibag._airbyte_raw_social_posts
suppliers_bank_ab1: unibag._airbyte_raw_suppliers
suppliers_bank_ab2: unibag._airbyte_raw_suppliers
suppliers_bank_ab3: unibag._airbyte_raw_suppliers
suppliers_bank: unibag._airbyte_raw_suppliers
suppliers_logo_ab1: unibag._airbyte_raw_suppliers
suppliers_logo_ab2: unibag._airbyte_raw_suppliers
suppliers_logo_ab3: unibag._airbyte_raw_suppliers
suppliers_logo: unibag._airbyte_raw_suppliers
suppliers_balance_ab1: unibag._airbyte_raw_suppliers
suppliers_balance_ab2: unibag._airbyte_raw_suppliers
suppliers_balance_ab3: unibag._airbyte_raw_suppliers
suppliers_balance: unibag._airbyte_raw_suppliers
suppliers_location_ab1: unibag._airbyte_raw_suppliers
suppliers_location_ab2: unibag._airbyte_raw_suppliers
suppliers_location_ab3: unibag._airbyte_raw_suppliers
suppliers_location: unibag._airbyte_raw_suppliers
suppliers_statistic_ab1: unibag._airbyte_raw_suppliers
suppliers_statistic_ab2: unibag._airbyte_raw_suppliers
suppliers_statistic_ab3: unibag._airbyte_raw_suppliers
suppliers_statistic: unibag._airbyte_raw_suppliers
suppliers_reviewstatistic_ab1: unibag._airbyte_raw_suppliers
suppliers_reviewstatistic_ab2: unibag._airbyte_raw_suppliers
suppliers_reviewstatistic_ab3: unibag._airbyte_raw_suppliers
suppliers_reviewstatistic: unibag._airbyte_raw_suppliers
team_activities_options_ab1: unibag._airbyte_raw_team_activities
team_activities_options_ab2: unibag._airbyte_raw_team_activities
team_activities_options_ab3: unibag._airbyte_raw_team_activities
team_activities_options: unibag._airbyte_raw_team_activities
team_members_statistic_ab1: unibag._airbyte_raw_team_members
team_members_statistic_ab2: unibag._airbyte_raw_team_members
team_members_statistic_ab3: unibag._airbyte_raw_team_members
team_members_statistic: unibag._airbyte_raw_team_members
team_members_statisticmonth_ab1: unibag._airbyte_raw_team_members
team_members_statisticmonth_ab2: unibag._airbyte_raw_team_members
team_members_statisticmonth_ab3: unibag._airbyte_raw_team_members
team_members_statisticmonth: unibag._airbyte_raw_team_members
teams_logo_ab1: unibag._airbyte_raw_teams
teams_logo_ab2: unibag._airbyte_raw_teams
teams_logo_ab3: unibag._airbyte_raw_teams
teams_logo: unibag._airbyte_raw_teams
teams_level_ab1: unibag._airbyte_raw_teams
teams_level_ab2: unibag._airbyte_raw_teams
teams_level_ab3: unibag._airbyte_raw_teams
teams_level: unibag._airbyte_raw_teams
teams_statistic_ab1: unibag._airbyte_raw_teams
teams_statistic_ab2: unibag._airbyte_raw_teams
teams_statistic_ab3: unibag._airbyte_raw_teams
teams_statistic: unibag._airbyte_raw_teams
teams_information_ab1: unibag._airbyte_raw_teams
teams_information_ab2: unibag._airbyte_raw_teams
teams_information_ab3: unibag._airbyte_raw_teams
teams_information: unibag._airbyte_raw_teams
user_identifications_backside_ab1: unibag._airbyte_raw_user_identifications
user_identifications_backside_ab2: unibag._airbyte_raw_user_identifications
user_identifications_backside_ab3: unibag._airbyte_raw_user_identifications
user_identifications_backside: unibag._airbyte_raw_user_identifications
user_identifications_frontside_ab1: unibag._airbyte_raw_user_identifications
user_identifications_frontside_ab2: unibag._airbyte_raw_user_identifications
user_identifications_frontside_ab3: unibag._airbyte_raw_user_identifications
user_identifications_frontside: unibag._airbyte_raw_user_identifications
user_identifications_detectinformation_ab1: unibag._airbyte_raw_user_identifications
user_identifications_detectinformation_ab2: unibag._airbyte_raw_user_identifications
user_identifications_detectinformation_ab3: unibag._airbyte_raw_user_identifications
user_identifications_detectinformation: unibag._airbyte_raw_user_identifications
users_info_ab1: unibag._airbyte_raw_users
users_info_ab2: unibag._airbyte_raw_users
users_info_ab3: unibag._airbyte_raw_users
users_info: unibag._airbyte_raw_users
users_team_ab1: unibag._airbyte_raw_users
users_team_ab2: unibag._airbyte_raw_users
users_team_ab3: unibag._airbyte_raw_users
users_team: unibag._airbyte_raw_users
users_zalo_ab1: unibag._airbyte_raw_users
users_zalo_ab2: unibag._airbyte_raw_users
users_zalo_ab3: unibag._airbyte_raw_users
users_zalo: unibag._airbyte_raw_users
users_email_ab1: unibag._airbyte_raw_users
users_email_ab2: unibag._airbyte_raw_users
users_email_ab3: unibag._airbyte_raw_users
users_email: unibag._airbyte_raw_users
users_phone_ab1: unibag._airbyte_raw_users
users_phone_ab2: unibag._airbyte_raw_users
users_phone_ab3: unibag._airbyte_raw_users
users_phone: unibag._airbyte_raw_users
users_avatar_ab1: unibag._airbyte_raw_users
users_avatar_ab2: unibag._airbyte_raw_users
users_avatar_ab3: unibag._airbyte_raw_users
users_avatar: unibag._airbyte_raw_users
users_facebook_ab1: unibag._airbyte_raw_users
users_facebook_ab2: unibag._airbyte_raw_users
users_facebook_ab3: unibag._airbyte_raw_users
users_facebook: unibag._airbyte_raw_users
users_referral_ab1: unibag._airbyte_raw_users
users_referral_ab2: unibag._airbyte_raw_users
users_referral_ab3: unibag._airbyte_raw_users
users_referral: unibag._airbyte_raw_users
users_statistic_ab1: unibag._airbyte_raw_users
users_statistic_ab2: unibag._airbyte_raw_users
users_statistic_ab3: unibag._airbyte_raw_users
users_statistic: unibag._airbyte_raw_users
users_membership_ab1: unibag._airbyte_raw_users
users_membership_ab2: unibag._airbyte_raw_users
users_membership_ab3: unibag._airbyte_raw_users
users_membership: unibag._airbyte_raw_users
users_identification_ab1: unibag._airbyte_raw_users
users_identification_ab2: unibag._airbyte_raw_users
users_identification_ab3: unibag._airbyte_raw_users
users_identification: unibag._airbyte_raw_users
vouchers_logo_ab1: unibag._airbyte_raw_vouchers
vouchers_logo_ab2: unibag._airbyte_raw_vouchers
vouchers_logo_ab3: unibag._airbyte_raw_vouchers
vouchers_logo: unibag._airbyte_raw_vouchers
vouchers_options_ab1: unibag._airbyte_raw_vouchers
vouchers_options_ab2: unibag._airbyte_raw_vouchers
vouchers_options_ab3: unibag._airbyte_raw_vouchers
vouchers_options: unibag._airbyte_raw_vouchers
vouchers_applyfor_ab1: unibag._airbyte_raw_vouchers
vouchers_applyfor_ab2: unibag._airbyte_raw_vouchers
vouchers_applyfor_ab3: unibag._airbyte_raw_vouchers
vouchers_applyfor: unibag._airbyte_raw_vouchers
events_icon_dimensions_ab1: unibag._airbyte_raw_events
events_icon_dimensions_ab2: unibag._airbyte_raw_events
events_icon_dimensions_ab3: unibag._airbyte_raw_events
events_icon_dimensions: unibag._airbyte_raw_events
events_cover_dimensions_ab1: unibag._airbyte_raw_events
events_cover_dimensions_ab2: unibag._airbyte_raw_events
events_cover_dimensions_ab3: unibag._airbyte_raw_events
events_cover_dimensions: unibag._airbyte_raw_events
events_segments_lastmonthsales_ab1: unibag._airbyte_raw_events
events_segments_lastmonthsales_ab2: unibag._airbyte_raw_events
events_segments_lastmonthsales_ab3: unibag._airbyte_raw_events
events_segments_lastmonthsales: unibag._airbyte_raw_events
events_segments_highestmonthlysales_ab1: unibag._airbyte_raw_events
events_segments_highestmonthlysales_ab2: unibag._airbyte_raw_events
events_segments_highestmonthlysales_ab3: unibag._airbyte_raw_events
events_segments_highestmonthlysales: unibag._airbyte_raw_events
inventories_location_location_ab1: unibag._airbyte_raw_inventories
inventories_location_location_ab2: unibag._airbyte_raw_inventories
inventories_location_location_ab3: unibag._airbyte_raw_inventories
inventories_location_location: unibag._airbyte_raw_inventories
membership_histories_new_condition_ab1: unibag._airbyte_raw_membership_histories
membership_histories_new_condition_ab2: unibag._airbyte_raw_membership_histories
membership_histories_new_condition_ab3: unibag._airbyte_raw_membership_histories
membership_histories_new_condition: unibag._airbyte_raw_membership_histories
membership_histories_old_condition_ab1: unibag._airbyte_raw_membership_histories
membership_histories_old_condition_ab2: unibag._airbyte_raw_membership_histories
membership_histories_old_condition_ab3: unibag._airbyte_raw_membership_histories
membership_histories_old_condition: unibag._airbyte_raw_membership_histories
membership_histories_old_statistic_ab1: unibag._airbyte_raw_membership_histories
membership_histories_old_statistic_ab2: unibag._airbyte_raw_membership_histories
membership_histories_old_statistic_ab3: unibag._airbyte_raw_membership_histories
membership_histories_old_statistic: unibag._airbyte_raw_membership_histories
order_deliveries_delivery_feeship_ab1: unibag._airbyte_raw_order_deliveries
order_deliveries_delivery_feeship_ab2: unibag._airbyte_raw_order_deliveries
order_deliveries_delivery_feeship_ab3: unibag._airbyte_raw_order_deliveries
order_deliveries_delivery_feeship: unibag._airbyte_raw_order_deliveries
orders_delivery_weight_ab1: unibag._airbyte_raw_orders
orders_delivery_weight_ab2: unibag._airbyte_raw_orders
orders_delivery_weight_ab3: unibag._airbyte_raw_orders
orders_delivery_weight: unibag._airbyte_raw_orders
orders_delivery_feeship_ab1: unibag._airbyte_raw_orders
orders_delivery_feeship_ab2: unibag._airbyte_raw_orders
orders_delivery_feeship_ab3: unibag._airbyte_raw_orders
orders_delivery_feeship: unibag._airbyte_raw_orders
orders_delivery_location_ab1: unibag._airbyte_raw_orders
orders_delivery_location_ab2: unibag._airbyte_raw_orders
orders_delivery_location_ab3: unibag._airbyte_raw_orders
orders_delivery_location: unibag._airbyte_raw_orders
product_categories_icon_dimensions_ab1: unibag._airbyte_raw_product_categories
product_categories_icon_dimensions_ab2: unibag._airbyte_raw_product_categories
product_categories_icon_dimensions_ab3: unibag._airbyte_raw_product_categories
product_categories_icon_dimensions: unibag._airbyte_raw_product_categories
product_sku_info_category_ab1: unibag._airbyte_raw_product_sku
product_sku_info_category_ab2: unibag._airbyte_raw_product_sku
product_sku_info_category_ab3: unibag._airbyte_raw_product_sku
product_sku_info_category: unibag._airbyte_raw_product_sku
product_sku_info_supplier_ab1: unibag._airbyte_raw_product_sku
product_sku_info_supplier_ab2: unibag._airbyte_raw_product_sku
product_sku_info_supplier_ab3: unibag._airbyte_raw_product_sku
product_sku_info_supplier: unibag._airbyte_raw_product_sku
product_sku_info_inventory_ab1: unibag._airbyte_raw_product_sku
product_sku_info_inventory_ab2: unibag._airbyte_raw_product_sku
product_sku_info_inventory_ab3: unibag._airbyte_raw_product_sku
product_sku_info_inventory: unibag._airbyte_raw_product_sku
product_sku_versions_info_category_ab1: unibag._airbyte_raw_product_sku_versions
product_sku_versions_info_category_ab2: unibag._airbyte_raw_product_sku_versions
product_sku_versions_info_category_ab3: unibag._airbyte_raw_product_sku_versions
product_sku_versions_info_category: unibag._airbyte_raw_product_sku_versions
product_sku_versions_info_supplier_ab1: unibag._airbyte_raw_product_sku_versions
product_sku_versions_info_supplier_ab2: unibag._airbyte_raw_product_sku_versions
product_sku_versions_info_supplier_ab3: unibag._airbyte_raw_product_sku_versions
product_sku_versions_info_supplier: unibag._airbyte_raw_product_sku_versions
product_sku_versions_info_inventory_ab1: unibag._airbyte_raw_product_sku_versions
product_sku_versions_info_inventory_ab2: unibag._airbyte_raw_product_sku_versions
product_sku_versions_info_inventory_ab3: unibag._airbyte_raw_product_sku_versions
product_sku_versions_info_inventory: unibag._airbyte_raw_product_sku_versions
products_info_category_ab1: unibag._airbyte_raw_products
products_info_category_ab2: unibag._airbyte_raw_products
products_info_category_ab3: unibag._airbyte_raw_products
products_info_category: unibag._airbyte_raw_products
products_info_supplier_ab1: unibag._airbyte_raw_products
products_info_supplier_ab2: unibag._airbyte_raw_products
products_info_supplier_ab3: unibag._airbyte_raw_products
products_info_supplier: unibag._airbyte_raw_products
products_info_inventory_ab1: unibag._airbyte_raw_products
products_info_inventory_ab2: unibag._airbyte_raw_products
products_info_inventory_ab3: unibag._airbyte_raw_products
products_info_inventory: unibag._airbyte_raw_products
promotions_options_bonus_ab1: unibag._airbyte_raw_promotions
promotions_options_bonus_ab2: unibag._airbyte_raw_promotions
promotions_options_bonus_ab3: unibag._airbyte_raw_promotions
promotions_options_bonus: unibag._airbyte_raw_promotions
session_deliveries_request_to_ab1: unibag._airbyte_raw_session_deliveries
session_deliveries_request_to_ab2: unibag._airbyte_raw_session_deliveries
session_deliveries_request_to_ab3: unibag._airbyte_raw_session_deliveries
session_deliveries_request_to: unibag._airbyte_raw_session_deliveries
session_deliveries_request_from_ab1: unibag._airbyte_raw_session_deliveries
session_deliveries_request_from_ab2: unibag._airbyte_raw_session_deliveries
session_deliveries_request_from_ab3: unibag._airbyte_raw_session_deliveries
session_deliveries_request_from: unibag._airbyte_raw_session_deliveries
session_deliveries_delivery_feeship_ab1: unibag._airbyte_raw_session_deliveries
session_deliveries_delivery_feeship_ab2: unibag._airbyte_raw_session_deliveries
session_deliveries_delivery_feeship_ab3: unibag._airbyte_raw_session_deliveries
session_deliveries_delivery_feeship: unibag._airbyte_raw_session_deliveries
suppliers_logo_dimensions_ab1: unibag._airbyte_raw_suppliers
suppliers_logo_dimensions_ab2: unibag._airbyte_raw_suppliers
suppliers_logo_dimensions_ab3: unibag._airbyte_raw_suppliers
suppliers_logo_dimensions: unibag._airbyte_raw_suppliers
teams_logo_dimensions_ab1: unibag._airbyte_raw_teams
teams_logo_dimensions_ab2: unibag._airbyte_raw_teams
teams_logo_dimensions_ab3: unibag._airbyte_raw_teams
teams_logo_dimensions: unibag._airbyte_raw_teams
user_identifications_backside_dimensions_ab1: unibag._airbyte_raw_user_identifications
user_identifications_backside_dimensions_ab2: unibag._airbyte_raw_user_identifications
user_identifications_backside_dimensions_ab3: unibag._airbyte_raw_user_identifications
user_identifications_backside_dimensions: unibag._airbyte_raw_user_identifications
user_identifications_frontside_dimensions_ab1: unibag._airbyte_raw_user_identifications
user_identifications_frontside_dimensions_ab2: unibag._airbyte_raw_user_identifications
user_identifications_frontside_dimensions_ab3: unibag._airbyte_raw_user_identifications
user_identifications_frontside_dimensions: unibag._airbyte_raw_user_identifications
user_identifications__ation_addressentities_ab1: unibag._airbyte_raw_user_identifications
user_identifications__ation_addressentities_ab2: unibag._airbyte_raw_user_identifications
user_identifications__ation_addressentities_ab3: unibag._airbyte_raw_user_identifications
user_identifications__ation_addressentities: unibag._airbyte_raw_user_identifications
users_avatar_dimensions_ab1: unibag._airbyte_raw_users
users_avatar_dimensions_ab2: unibag._airbyte_raw_users
users_avatar_dimensions_ab3: unibag._airbyte_raw_users
users_avatar_dimensions: unibag._airbyte_raw_users
vouchers_logo_dimensions_ab1: unibag._airbyte_raw_vouchers
vouchers_logo_dimensions_ab2: unibag._airbyte_raw_vouchers
vouchers_logo_dimensions_ab3: unibag._airbyte_raw_vouchers
vouchers_logo_dimensions: unibag._airbyte_raw_vouchers
vouchers_options_bonus_ab1: unibag._airbyte_raw_vouchers
vouchers_options_bonus_ab2: unibag._airbyte_raw_vouchers
vouchers_options_bonus_ab3: unibag._airbyte_raw_vouchers
vouchers_options_bonus: unibag._airbyte_raw_vouchers
events_icon_dimensions_md_ab1: unibag._airbyte_raw_events
events_icon_dimensions_md_ab2: unibag._airbyte_raw_events
events_icon_dimensions_md_ab3: unibag._airbyte_raw_events
events_icon_dimensions_md: unibag._airbyte_raw_events
events_icon_dimensions_sm_ab1: unibag._airbyte_raw_events
events_icon_dimensions_sm_ab2: unibag._airbyte_raw_events
events_icon_dimensions_sm_ab3: unibag._airbyte_raw_events
events_icon_dimensions_sm: unibag._airbyte_raw_events
events_cover_dimensions_md_ab1: unibag._airbyte_raw_events
events_cover_dimensions_md_ab2: unibag._airbyte_raw_events
events_cover_dimensions_md_ab3: unibag._airbyte_raw_events
events_cover_dimensions_md: unibag._airbyte_raw_events
events_cover_dimensions_sm_ab1: unibag._airbyte_raw_events
events_cover_dimensions_sm_ab2: unibag._airbyte_raw_events
events_cover_dimensions_sm_ab3: unibag._airbyte_raw_events
events_cover_dimensions_sm: unibag._airbyte_raw_events
product_categories_icon_dimensions_md_ab1: unibag._airbyte_raw_product_categories
product_categories_icon_dimensions_md_ab2: unibag._airbyte_raw_product_categories
product_categories_icon_dimensions_md_ab3: unibag._airbyte_raw_product_categories
product_categories_icon_dimensions_md: unibag._airbyte_raw_product_categories
product_categories_icon_dimensions_sm_ab1: unibag._airbyte_raw_product_categories
product_categories_icon_dimensions_sm_ab2: unibag._airbyte_raw_product_categories
product_categories_icon_dimensions_sm_ab3: unibag._airbyte_raw_product_categories
product_categories_icon_dimensions_sm: unibag._airbyte_raw_product_categories
product_sku_info_inventory_location_ab1: unibag._airbyte_raw_product_sku
product_sku_info_inventory_location_ab2: unibag._airbyte_raw_product_sku
product_sku_info_inventory_location_ab3: unibag._airbyte_raw_product_sku
product_sku_info_inventory_location: unibag._airbyte_raw_product_sku
products_info_inventory_location_ab1: unibag._airbyte_raw_products
products_info_inventory_location_ab2: unibag._airbyte_raw_products
products_info_inventory_location_ab3: unibag._airbyte_raw_products
products_info_inventory_location: unibag._airbyte_raw_products
session_deliveries_request_to_location_ab1: unibag._airbyte_raw_session_deliveries
session_deliveries_request_to_location_ab2: unibag._airbyte_raw_session_deliveries
session_deliveries_request_to_location_ab3: unibag._airbyte_raw_session_deliveries
session_deliveries_request_to_location: unibag._airbyte_raw_session_deliveries
suppliers_logo_dimensions_md_ab1: unibag._airbyte_raw_suppliers
suppliers_logo_dimensions_md_ab2: unibag._airbyte_raw_suppliers
suppliers_logo_dimensions_md_ab3: unibag._airbyte_raw_suppliers
suppliers_logo_dimensions_md: unibag._airbyte_raw_suppliers
suppliers_logo_dimensions_sm_ab1: unibag._airbyte_raw_suppliers
suppliers_logo_dimensions_sm_ab2: unibag._airbyte_raw_suppliers
suppliers_logo_dimensions_sm_ab3: unibag._airbyte_raw_suppliers
suppliers_logo_dimensions_sm: unibag._airbyte_raw_suppliers
teams_logo_dimensions_md_ab1: unibag._airbyte_raw_teams
teams_logo_dimensions_md_ab2: unibag._airbyte_raw_teams
teams_logo_dimensions_md_ab3: unibag._airbyte_raw_teams
teams_logo_dimensions_md: unibag._airbyte_raw_teams
teams_logo_dimensions_sm_ab1: unibag._airbyte_raw_teams
teams_logo_dimensions_sm_ab2: unibag._airbyte_raw_teams
teams_logo_dimensions_sm_ab3: unibag._airbyte_raw_teams
teams_logo_dimensions_sm: unibag._airbyte_raw_teams
user_identifications_backside_dimensions_md_ab1: unibag._airbyte_raw_user_identifications
user_identifications_backside_dimensions_md_ab2: unibag._airbyte_raw_user_identifications
user_identifications_backside_dimensions_md_ab3: unibag._airbyte_raw_user_identifications
user_identifications_backside_dimensions_md: unibag._airbyte_raw_user_identifications
user_identifications_backside_dimensions_sm_ab1: unibag._airbyte_raw_user_identifications
user_identifications_backside_dimensions_sm_ab2: unibag._airbyte_raw_user_identifications
user_identifications_backside_dimensions_sm_ab3: unibag._airbyte_raw_user_identifications
user_identifications_backside_dimensions_sm: unibag._airbyte_raw_user_identifications
user_identifications__ontside_dimensions_md_ab1: unibag._airbyte_raw_user_identifications
user_identifications__ontside_dimensions_md_ab2: unibag._airbyte_raw_user_identifications
user_identifications__ontside_dimensions_md_ab3: unibag._airbyte_raw_user_identifications
user_identifications__ontside_dimensions_md: unibag._airbyte_raw_user_identifications
user_identifications__ontside_dimensions_sm_ab1: unibag._airbyte_raw_user_identifications
user_identifications__ontside_dimensions_sm_ab2: unibag._airbyte_raw_user_identifications
user_identifications__ontside_dimensions_sm_ab3: unibag._airbyte_raw_user_identifications
user_identifications__ontside_dimensions_sm: unibag._airbyte_raw_user_identifications
users_avatar_dimensions_md_ab1: unibag._airbyte_raw_users
users_avatar_dimensions_md_ab2: unibag._airbyte_raw_users
users_avatar_dimensions_md_ab3: unibag._airbyte_raw_users
users_avatar_dimensions_md: unibag._airbyte_raw_users
users_avatar_dimensions_sm_ab1: unibag._airbyte_raw_users
users_avatar_dimensions_sm_ab2: unibag._airbyte_raw_users
users_avatar_dimensions_sm_ab3: unibag._airbyte_raw_users
users_avatar_dimensions_sm: unibag._airbyte_raw_users
vouchers_logo_dimensions_md_ab1: unibag._airbyte_raw_vouchers
vouchers_logo_dimensions_md_ab2: unibag._airbyte_raw_vouchers
vouchers_logo_dimensions_md_ab3: unibag._airbyte_raw_vouchers
vouchers_logo_dimensions_md: unibag._airbyte_raw_vouchers
vouchers_logo_dimensions_sm_ab1: unibag._airbyte_raw_vouchers
vouchers_logo_dimensions_sm_ab2: unibag._airbyte_raw_vouchers
vouchers_logo_dimensions_sm_ab3: unibag._airbyte_raw_vouchers
vouchers_logo_dimensions_sm: unibag._airbyte_raw_vouchers
product_sku_info_inv__ory_location_location_ab1: unibag._airbyte_raw_product_sku
product_sku_info_inv__ory_location_location_ab2: unibag._airbyte_raw_product_sku
product_sku_info_inv__ory_location_location_ab3: unibag._airbyte_raw_product_sku
product_sku_info_inv__ory_location_location: unibag._airbyte_raw_product_sku
products_info_inventory_location_location_ab1: unibag._airbyte_raw_products
products_info_inventory_location_location_ab2: unibag._airbyte_raw_products
products_info_inventory_location_location_ab3: unibag._airbyte_raw_products
products_info_inventory_location_location: unibag._airbyte_raw_products

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,28 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
unique_key = '_airbyte_ab_id',
schema = "_airbyte_unibag",
tags = [ "top-level-intermediate" ]
) }}
-- SQL model to parse JSON blob stored in a single column and extract into separated field columns as described by the JSON Schema
-- depends_on: {{ source('unibag', '_airbyte_raw_brands') }}
select
{{ json_extract_scalar('_airbyte_data', ['_id'], ['_id']) }} as _id,
{{ json_extract_scalar('_airbyte_data', ['desc'], ['desc']) }} as {{ adapter.quote('desc') }},
{{ json_extract_scalar('_airbyte_data', ['logo'], ['logo']) }} as logo,
{{ json_extract_scalar('_airbyte_data', ['name'], ['name']) }} as {{ adapter.quote('name') }},
{{ json_extract_scalar('_airbyte_data', ['slug'], ['slug']) }} as slug,
{{ json_extract_scalar('_airbyte_data', ['active'], ['active']) }} as active,
{{ json_extract_array('_airbyte_data', ['photos'], ['photos']) }} as photos,
{{ json_extract_scalar('_airbyte_data', ['country'], ['country']) }} as country,
{{ json_extract_scalar('_airbyte_data', ['createdAt'], ['createdAt']) }} as createdat,
{{ json_extract_scalar('_airbyte_data', ['updatedAt'], ['updatedAt']) }} as updatedat,
{{ json_extract_scalar('_airbyte_data', ['searchString'], ['searchString']) }} as searchstring,
{{ json_extract_scalar('_airbyte_data', ['totalProduct'], ['totalProduct']) }} as totalproduct,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ source('unibag', '_airbyte_raw_brands') }} as table_alias
-- brands
where 1 = 1

View File

@ -0,0 +1,28 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
unique_key = '_airbyte_ab_id',
schema = "_airbyte_unibag",
tags = [ "top-level-intermediate" ]
) }}
-- SQL model to cast each column to its adequate SQL type converted from the JSON schema type
-- depends_on: {{ ref('brands_ab1') }}
select
cast(_id as {{ dbt_utils.type_string() }}) as _id,
cast({{ adapter.quote('desc') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('desc') }},
cast(logo as {{ dbt_utils.type_string() }}) as logo,
cast({{ adapter.quote('name') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('name') }},
cast(slug as {{ dbt_utils.type_string() }}) as slug,
{{ cast_to_boolean('active') }} as active,
photos,
cast(country as {{ dbt_utils.type_string() }}) as country,
cast(createdat as {{ dbt_utils.type_string() }}) as createdat,
cast(updatedat as {{ dbt_utils.type_string() }}) as updatedat,
cast(searchstring as {{ dbt_utils.type_string() }}) as searchstring,
cast(totalproduct as {{ dbt_utils.type_float() }}) as totalproduct,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('brands_ab1') }}
-- brands
where 1 = 1

View File

@ -0,0 +1,28 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
unique_key = '_airbyte_ab_id',
schema = "_airbyte_unibag",
tags = [ "top-level-intermediate" ]
) }}
-- SQL model to build a hash column based on the values of this record
-- depends_on: {{ ref('brands_ab2') }}
select
{{ dbt_utils.surrogate_key([
'_id',
adapter.quote('desc'),
'logo',
adapter.quote('name'),
'slug',
boolean_to_string('active'),
array_to_string('photos'),
'country',
'createdat',
'updatedat',
'searchstring',
'totalproduct',
]) }} as _airbyte_brands_hashid,
tmp.*
from {{ ref('brands_ab2') }} tmp
-- brands
where 1 = 1

View File

@ -12,7 +12,7 @@ select
{{ json_extract_scalar('_airbyte_data', ['user'], ['user']) }} as {{ adapter.quote('user') }},
{{ json_extract_scalar('_airbyte_data', ['value'], ['value']) }} as {{ adapter.quote('value') }},
{{ json_extract_scalar('_airbyte_data', ['action'], ['action']) }} as {{ adapter.quote('action') }},
{{ json_extract('table_alias', '_airbyte_data', ['options'], ['options']) }} as {{ adapter.quote('options') }},
{{ json_extract_scalar('_airbyte_data', ['options'], ['options']) }} as {{ adapter.quote('options') }},
{{ json_extract_scalar('_airbyte_data', ['category'], ['category']) }} as category,
{{ json_extract_scalar('_airbyte_data', ['targetId'], ['targetId']) }} as targetid,
{{ json_extract_scalar('_airbyte_data', ['createdAt'], ['createdAt']) }} as createdat,

View File

@ -12,7 +12,7 @@ select
cast({{ adapter.quote('user') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('user') }},
cast({{ adapter.quote('value') }} as {{ dbt_utils.type_float() }}) as {{ adapter.quote('value') }},
cast({{ adapter.quote('action') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('action') }},
cast({{ adapter.quote('options') }} as {{ type_json() }}) as {{ adapter.quote('options') }},
cast({{ adapter.quote('options') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('options') }},
cast(category as {{ dbt_utils.type_string() }}) as category,
cast(targetid as {{ dbt_utils.type_string() }}) as targetid,
cast(createdat as {{ dbt_utils.type_string() }}) as createdat,

View File

@ -13,7 +13,7 @@ select
adapter.quote('user'),
adapter.quote('value'),
adapter.quote('action'),
object_to_string(adapter.quote('options')),
adapter.quote('options'),
'category',
'targetid',
'createdat',

View File

@ -1,22 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to parse JSON blob stored in a single column and extract into separated field columns as described by the JSON Schema
-- depends_on: {{ ref('cash_flows') }}
select
_airbyte_cash_flows_hashid,
{{ json_extract_scalar(adapter.quote('options'), ['orderId'], ['orderId']) }} as orderid,
{{ json_extract_scalar(adapter.quote('options'), ['orderCode'], ['orderCode']) }} as ordercode,
{{ json_extract_scalar(adapter.quote('options'), ['giveGiftId'], ['giveGiftId']) }} as givegiftid,
{{ json_extract_scalar(adapter.quote('options'), ['giveGiftTitle'], ['giveGiftTitle']) }} as givegifttitle,
{{ json_extract_scalar(adapter.quote('options'), ['userGiveGiftId'], ['userGiveGiftId']) }} as usergivegiftid,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('cash_flows') }} as table_alias
-- options at cash-flows/options
where 1 = 1
and {{ adapter.quote('options') }} is not null

View File

@ -1,21 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to cast each column to its adequate SQL type converted from the JSON schema type
-- depends_on: {{ ref('cash_flows_options_ab1') }}
select
_airbyte_cash_flows_hashid,
cast(orderid as {{ dbt_utils.type_string() }}) as orderid,
cast(ordercode as {{ dbt_utils.type_string() }}) as ordercode,
cast(givegiftid as {{ dbt_utils.type_string() }}) as givegiftid,
cast(givegifttitle as {{ dbt_utils.type_string() }}) as givegifttitle,
cast(usergivegiftid as {{ dbt_utils.type_string() }}) as usergivegiftid,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('cash_flows_options_ab1') }}
-- options at cash-flows/options
where 1 = 1

View File

@ -1,21 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to build a hash column based on the values of this record
-- depends_on: {{ ref('cash_flows_options_ab2') }}
select
{{ dbt_utils.surrogate_key([
'_airbyte_cash_flows_hashid',
'orderid',
'ordercode',
'givegiftid',
'givegifttitle',
'usergivegiftid',
]) }} as _airbyte_options_hashid,
tmp.*
from {{ ref('cash_flows_options_ab2') }} tmp
-- options at cash-flows/options
where 1 = 1

View File

@ -8,15 +8,16 @@
-- depends_on: {{ source('unibag', '_airbyte_raw_customers') }}
select
{{ json_extract_scalar('_airbyte_data', ['_id'], ['_id']) }} as _id,
{{ json_extract('table_alias', '_airbyte_data', ['info'], ['info']) }} as info,
{{ json_extract_scalar('_airbyte_data', ['info'], ['info']) }} as info,
{{ json_extract_scalar('_airbyte_data', ['name'], ['name']) }} as {{ adapter.quote('name') }},
{{ json_extract_scalar('_airbyte_data', ['user'], ['user']) }} as {{ adapter.quote('user') }},
{{ json_extract_scalar('_airbyte_data', ['email'], ['email']) }} as email,
{{ json_extract_scalar('_airbyte_data', ['phone'], ['phone']) }} as phone,
{{ json_extract_scalar('_airbyte_data', ['source'], ['source']) }} as {{ adapter.quote('source') }},
{{ json_extract_array('_airbyte_data', ['location'], ['location']) }} as {{ adapter.quote('location') }},
{{ json_extract_scalar('_airbyte_data', ['createdAt'], ['createdAt']) }} as createdat,
{{ json_extract_scalar('_airbyte_data', ['isDeleted'], ['isDeleted']) }} as isdeleted,
{{ json_extract('table_alias', '_airbyte_data', ['statistic'], ['statistic']) }} as statistic,
{{ json_extract_scalar('_airbyte_data', ['statistic'], ['statistic']) }} as statistic,
{{ json_extract_scalar('_airbyte_data', ['updatedAt'], ['updatedAt']) }} as updatedat,
{{ json_extract_scalar('_airbyte_data', ['searchString'], ['searchString']) }} as searchstring,
_airbyte_ab_id,

View File

@ -8,15 +8,16 @@
-- depends_on: {{ ref('customers_ab1') }}
select
cast(_id as {{ dbt_utils.type_string() }}) as _id,
cast(info as {{ type_json() }}) as info,
cast(info as {{ dbt_utils.type_string() }}) as info,
cast({{ adapter.quote('name') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('name') }},
cast({{ adapter.quote('user') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('user') }},
cast(email as {{ dbt_utils.type_string() }}) as email,
cast(phone as {{ dbt_utils.type_string() }}) as phone,
cast({{ adapter.quote('source') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('source') }},
{{ adapter.quote('location') }},
cast(createdat as {{ dbt_utils.type_string() }}) as createdat,
{{ cast_to_boolean('isdeleted') }} as isdeleted,
cast(statistic as {{ type_json() }}) as statistic,
cast(statistic as {{ dbt_utils.type_string() }}) as statistic,
cast(updatedat as {{ dbt_utils.type_string() }}) as updatedat,
cast(searchstring as {{ dbt_utils.type_string() }}) as searchstring,
_airbyte_ab_id,

View File

@ -9,15 +9,16 @@
select
{{ dbt_utils.surrogate_key([
'_id',
object_to_string('info'),
'info',
adapter.quote('name'),
adapter.quote('user'),
'email',
'phone',
adapter.quote('source'),
array_to_string(adapter.quote('location')),
'createdat',
boolean_to_string('isdeleted'),
object_to_string('statistic'),
'statistic',
'updatedat',
'searchstring',
]) }} as _airbyte_customers_hashid,

View File

@ -1,22 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to parse JSON blob stored in a single column and extract into separated field columns as described by the JSON Schema
-- depends_on: {{ ref('customers') }}
select
_airbyte_customers_hashid,
{{ json_extract_scalar('info', ['name'], ['name']) }} as {{ adapter.quote('name') }},
{{ json_extract_scalar('info', ['email'], ['email']) }} as email,
{{ json_extract_scalar('info', ['address'], ['address']) }} as address,
{{ json_extract_scalar('info', ['companyName'], ['companyName']) }} as companyname,
{{ json_extract_scalar('info', ['taxIdentificationNumber'], ['taxIdentificationNumber']) }} as taxidentificationnumber,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('customers') }} as table_alias
-- info at customers/info
where 1 = 1
and info is not null

View File

@ -1,21 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to cast each column to its adequate SQL type converted from the JSON schema type
-- depends_on: {{ ref('customers_info_ab1') }}
select
_airbyte_customers_hashid,
cast({{ adapter.quote('name') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('name') }},
cast(email as {{ dbt_utils.type_string() }}) as email,
cast(address as {{ dbt_utils.type_string() }}) as address,
cast(companyname as {{ dbt_utils.type_string() }}) as companyname,
cast(taxidentificationnumber as {{ dbt_utils.type_string() }}) as taxidentificationnumber,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('customers_info_ab1') }}
-- info at customers/info
where 1 = 1

View File

@ -1,21 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to build a hash column based on the values of this record
-- depends_on: {{ ref('customers_info_ab2') }}
select
{{ dbt_utils.surrogate_key([
'_airbyte_customers_hashid',
adapter.quote('name'),
'email',
'address',
'companyname',
'taxidentificationnumber',
]) }} as _airbyte_info_hashid,
tmp.*
from {{ ref('customers_info_ab2') }} tmp
-- info at customers/info
where 1 = 1

View File

@ -1,22 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to parse JSON blob stored in a single column and extract into separated field columns as described by the JSON Schema
-- depends_on: {{ ref('customers') }}
select
_airbyte_customers_hashid,
{{ json_extract_scalar('statistic', ['expenseTotal'], ['expenseTotal']) }} as expensetotal,
{{ json_extract_scalar('statistic', ['transactionTotal_aibyte_transform'], ['transactionTotal_aibyte_transform']) }} as transactiontotal_aibyte_transform,
{{ json_extract_scalar('statistic', ['transactionPending_aibyte_transform'], ['transactionPending_aibyte_transform']) }} as transactionpending_aibyte_transform,
{{ json_extract_scalar('statistic', ['transactionSuccess_aibyte_transform'], ['transactionSuccess_aibyte_transform']) }} as transactionsuccess_aibyte_transform,
{{ json_extract_scalar('statistic', ['transactionRejected_aibyte_transform'], ['transactionRejected_aibyte_transform']) }} as transactionrejected_aibyte_transform,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('customers') }} as table_alias
-- statistic at customers/statistic
where 1 = 1
and statistic is not null

View File

@ -1,21 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to cast each column to its adequate SQL type converted from the JSON schema type
-- depends_on: {{ ref('customers_statistic_ab1') }}
select
_airbyte_customers_hashid,
cast(expensetotal as {{ dbt_utils.type_float() }}) as expensetotal,
cast(transactiontotal_aibyte_transform as {{ dbt_utils.type_string() }}) as transactiontotal_aibyte_transform,
cast(transactionpending_aibyte_transform as {{ dbt_utils.type_string() }}) as transactionpending_aibyte_transform,
cast(transactionsuccess_aibyte_transform as {{ dbt_utils.type_string() }}) as transactionsuccess_aibyte_transform,
cast(transactionrejected_aibyte_transform as {{ dbt_utils.type_string() }}) as transactionrejected_aibyte_transform,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('customers_statistic_ab1') }}
-- statistic at customers/statistic
where 1 = 1

View File

@ -1,21 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to build a hash column based on the values of this record
-- depends_on: {{ ref('customers_statistic_ab2') }}
select
{{ dbt_utils.surrogate_key([
'_airbyte_customers_hashid',
'expensetotal',
'transactiontotal_aibyte_transform',
'transactionpending_aibyte_transform',
'transactionsuccess_aibyte_transform',
'transactionrejected_aibyte_transform',
]) }} as _airbyte_statistic_hashid,
tmp.*
from {{ ref('customers_statistic_ab2') }} tmp
-- statistic at customers/statistic
where 1 = 1

View File

@ -13,7 +13,7 @@ select
{{ json_extract_scalar('_airbyte_data', ['user'], ['user']) }} as {{ adapter.quote('user') }},
{{ json_extract_scalar('_airbyte_data', ['event'], ['event']) }} as {{ adapter.quote('event') }},
{{ json_extract_scalar('_airbyte_data', ['status'], ['status']) }} as status,
{{ json_extract('table_alias', '_airbyte_data', ['options'], ['options']) }} as {{ adapter.quote('options') }},
{{ json_extract_scalar('_airbyte_data', ['options'], ['options']) }} as {{ adapter.quote('options') }},
{{ json_extract_scalar('_airbyte_data', ['createdAt'], ['createdAt']) }} as createdat,
{{ json_extract_scalar('_airbyte_data', ['updatedat'], ['updatedat']) }} as updatedat,
_airbyte_ab_id,

View File

@ -13,7 +13,7 @@ select
cast({{ adapter.quote('user') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('user') }},
cast({{ adapter.quote('event') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('event') }},
cast(status as {{ dbt_utils.type_string() }}) as status,
cast({{ adapter.quote('options') }} as {{ type_json() }}) as {{ adapter.quote('options') }},
cast({{ adapter.quote('options') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('options') }},
cast(createdat as {{ dbt_utils.type_string() }}) as createdat,
cast(updatedat as {{ dbt_utils.type_string() }}) as updatedat,
_airbyte_ab_id,

View File

@ -14,7 +14,7 @@ select
adapter.quote('user'),
adapter.quote('event'),
'status',
object_to_string(adapter.quote('options')),
adapter.quote('options'),
'createdat',
'updatedat',
]) }} as _airbyte_event_rewards_hashid,

View File

@ -1,23 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to parse JSON blob stored in a single column and extract into separated field columns as described by the JSON Schema
-- depends_on: {{ ref('event_rewards') }}
select
_airbyte_event_rewards_hashid,
{{ json_extract_scalar(adapter.quote('options'), ['order'], ['order']) }} as {{ adapter.quote('order') }},
{{ json_extract_scalar(adapter.quote('options'), ['invitee'], ['invitee']) }} as invitee,
{{ json_extract_scalar(adapter.quote('options'), ['percent'], ['percent']) }} as {{ adapter.quote('percent') }},
{{ json_extract_scalar(adapter.quote('options'), ['referral'], ['referral']) }} as referral,
{{ json_extract_scalar(adapter.quote('options'), ['minOrderValue'], ['minOrderValue']) }} as minordervalue,
{{ json_extract_scalar(adapter.quote('options'), ['minOrderToClaim'], ['minOrderToClaim']) }} as minordertoclaim,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('event_rewards') }} as table_alias
-- options at event-rewards/options
where 1 = 1
and {{ adapter.quote('options') }} is not null

View File

@ -1,22 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to cast each column to its adequate SQL type converted from the JSON schema type
-- depends_on: {{ ref('event_rewards_options_ab1') }}
select
_airbyte_event_rewards_hashid,
cast({{ adapter.quote('order') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('order') }},
cast(invitee as {{ dbt_utils.type_string() }}) as invitee,
cast({{ adapter.quote('percent') }} as {{ dbt_utils.type_float() }}) as {{ adapter.quote('percent') }},
cast(referral as {{ dbt_utils.type_string() }}) as referral,
cast(minordervalue as {{ dbt_utils.type_float() }}) as minordervalue,
cast(minordertoclaim as {{ dbt_utils.type_float() }}) as minordertoclaim,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('event_rewards_options_ab1') }}
-- options at event-rewards/options
where 1 = 1

View File

@ -1,22 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to build a hash column based on the values of this record
-- depends_on: {{ ref('event_rewards_options_ab2') }}
select
{{ dbt_utils.surrogate_key([
'_airbyte_event_rewards_hashid',
adapter.quote('order'),
'invitee',
adapter.quote('percent'),
'referral',
'minordervalue',
'minordertoclaim',
]) }} as _airbyte_options_hashid,
tmp.*
from {{ ref('event_rewards_options_ab2') }} tmp
-- options at event-rewards/options
where 1 = 1

View File

@ -8,20 +8,21 @@
-- depends_on: {{ source('unibag', '_airbyte_raw_events') }}
select
{{ json_extract_scalar('_airbyte_data', ['_id'], ['_id']) }} as _id,
{{ json_extract_scalar('_airbyte_data', ['code'], ['code']) }} as code,
{{ json_extract_scalar('_airbyte_data', ['desc'], ['desc']) }} as {{ adapter.quote('desc') }},
{{ json_extract('table_alias', '_airbyte_data', ['icon'], ['icon']) }} as icon,
{{ json_extract_scalar('_airbyte_data', ['icon'], ['icon']) }} as icon,
{{ json_extract_scalar('_airbyte_data', ['name'], ['name']) }} as {{ adapter.quote('name') }},
{{ json_extract_scalar('_airbyte_data', ['type'], ['type']) }} as {{ adapter.quote('type') }},
{{ json_extract('table_alias', '_airbyte_data', ['cover'], ['cover']) }} as cover,
{{ json_extract_scalar('_airbyte_data', ['cover'], ['cover']) }} as cover,
{{ json_extract_scalar('_airbyte_data', ['endAt'], ['endAt']) }} as endat,
{{ json_extract_scalar('_airbyte_data', ['active'], ['active']) }} as active,
{{ json_extract('table_alias', '_airbyte_data', ['notice'], ['notice']) }} as notice,
{{ json_extract_scalar('_airbyte_data', ['notice'], ['notice']) }} as notice,
{{ json_extract_scalar('_airbyte_data', ['screen'], ['screen']) }} as screen,
{{ json_extract_scalar('_airbyte_data', ['article'], ['article']) }} as article,
{{ json_extract('table_alias', '_airbyte_data', ['options'], ['options']) }} as {{ adapter.quote('options') }},
{{ json_extract_scalar('_airbyte_data', ['options'], ['options']) }} as {{ adapter.quote('options') }},
{{ json_extract_scalar('_airbyte_data', ['startAt'], ['startAt']) }} as startat,
{{ json_extract('table_alias', '_airbyte_data', ['segments'], ['segments']) }} as segments,
{{ json_extract_scalar('_airbyte_data', ['segments'], ['segments']) }} as segments,
{{ json_extract_scalar('_airbyte_data', ['createdAt'], ['createdAt']) }} as createdat,
{{ json_extract_scalar('_airbyte_data', ['groupType'], ['groupType']) }} as grouptype,
{{ json_extract_array('_airbyte_data', ['suppliers'], ['suppliers']) }} as suppliers,
{{ json_extract_scalar('_airbyte_data', ['updatedAt'], ['updatedAt']) }} as updatedat,
{{ json_extract_array('_airbyte_data', ['information'], ['information']) }} as information,

View File

@ -8,20 +8,21 @@
-- depends_on: {{ ref('events_ab1') }}
select
cast(_id as {{ dbt_utils.type_string() }}) as _id,
cast(code as {{ dbt_utils.type_string() }}) as code,
cast({{ adapter.quote('desc') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('desc') }},
cast(icon as {{ type_json() }}) as icon,
cast(icon as {{ dbt_utils.type_string() }}) as icon,
cast({{ adapter.quote('name') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('name') }},
cast({{ adapter.quote('type') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('type') }},
cast(cover as {{ type_json() }}) as cover,
cast(cover as {{ dbt_utils.type_string() }}) as cover,
cast(endat as {{ dbt_utils.type_string() }}) as endat,
{{ cast_to_boolean('active') }} as active,
cast(notice as {{ type_json() }}) as notice,
cast(notice as {{ dbt_utils.type_string() }}) as notice,
cast(screen as {{ dbt_utils.type_string() }}) as screen,
cast(article as {{ dbt_utils.type_string() }}) as article,
cast({{ adapter.quote('options') }} as {{ type_json() }}) as {{ adapter.quote('options') }},
cast({{ adapter.quote('options') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('options') }},
cast(startat as {{ dbt_utils.type_string() }}) as startat,
cast(segments as {{ type_json() }}) as segments,
cast(segments as {{ dbt_utils.type_string() }}) as segments,
cast(createdat as {{ dbt_utils.type_string() }}) as createdat,
cast(grouptype as {{ dbt_utils.type_string() }}) as grouptype,
suppliers,
cast(updatedat as {{ dbt_utils.type_string() }}) as updatedat,
information,

View File

@ -9,20 +9,21 @@
select
{{ dbt_utils.surrogate_key([
'_id',
'code',
adapter.quote('desc'),
object_to_string('icon'),
'icon',
adapter.quote('name'),
adapter.quote('type'),
object_to_string('cover'),
'cover',
'endat',
boolean_to_string('active'),
object_to_string('notice'),
'notice',
'screen',
'article',
object_to_string(adapter.quote('options')),
adapter.quote('options'),
'startat',
object_to_string('segments'),
'segments',
'createdat',
'grouptype',
array_to_string('suppliers'),
'updatedat',
array_to_string('information'),

View File

@ -1,20 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to parse JSON blob stored in a single column and extract into separated field columns as described by the JSON Schema
-- depends_on: {{ ref('events') }}
select
_airbyte_events_hashid,
{{ json_extract_scalar('cover', ['_id'], ['_id']) }} as _id,
{{ json_extract_scalar('cover', ['name'], ['name']) }} as {{ adapter.quote('name') }},
{{ json_extract('table_alias', 'cover', ['dimensions'], ['dimensions']) }} as dimensions,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('events') }} as table_alias
-- cover at events/cover
where 1 = 1
and cover is not null

View File

@ -1,19 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to cast each column to its adequate SQL type converted from the JSON schema type
-- depends_on: {{ ref('events_cover_ab1') }}
select
_airbyte_events_hashid,
cast(_id as {{ dbt_utils.type_string() }}) as _id,
cast({{ adapter.quote('name') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('name') }},
cast(dimensions as {{ type_json() }}) as dimensions,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('events_cover_ab1') }}
-- cover at events/cover
where 1 = 1

View File

@ -1,19 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to build a hash column based on the values of this record
-- depends_on: {{ ref('events_cover_ab2') }}
select
{{ dbt_utils.surrogate_key([
'_airbyte_events_hashid',
'_id',
adapter.quote('name'),
object_to_string('dimensions'),
]) }} as _airbyte_cover_hashid,
tmp.*
from {{ ref('events_cover_ab2') }} tmp
-- cover at events/cover
where 1 = 1

View File

@ -1,19 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to parse JSON blob stored in a single column and extract into separated field columns as described by the JSON Schema
-- depends_on: {{ ref('events_cover') }}
select
_airbyte_cover_hashid,
{{ json_extract('table_alias', 'dimensions', ['md'], ['md']) }} as md,
{{ json_extract('table_alias', 'dimensions', ['sm'], ['sm']) }} as sm,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('events_cover') }} as table_alias
-- dimensions at events/cover/dimensions
where 1 = 1
and dimensions is not null

View File

@ -1,18 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to cast each column to its adequate SQL type converted from the JSON schema type
-- depends_on: {{ ref('events_cover_dimensions_ab1') }}
select
_airbyte_cover_hashid,
cast(md as {{ type_json() }}) as md,
cast(sm as {{ type_json() }}) as sm,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('events_cover_dimensions_ab1') }}
-- dimensions at events/cover/dimensions
where 1 = 1

View File

@ -1,18 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to build a hash column based on the values of this record
-- depends_on: {{ ref('events_cover_dimensions_ab2') }}
select
{{ dbt_utils.surrogate_key([
'_airbyte_cover_hashid',
object_to_string('md'),
object_to_string('sm'),
]) }} as _airbyte_dimensions_hashid,
tmp.*
from {{ ref('events_cover_dimensions_ab2') }} tmp
-- dimensions at events/cover/dimensions
where 1 = 1

View File

@ -1,20 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to parse JSON blob stored in a single column and extract into separated field columns as described by the JSON Schema
-- depends_on: {{ ref('events_cover_dimensions') }}
select
_airbyte_dimensions_hashid,
{{ json_extract_scalar('md', ['url'], ['url']) }} as url,
{{ json_extract_scalar('md', ['width'], ['width']) }} as width,
{{ json_extract_scalar('md', ['height'], ['height']) }} as height,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('events_cover_dimensions') }} as table_alias
-- md at events/cover/dimensions/md
where 1 = 1
and md is not null

View File

@ -1,19 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to cast each column to its adequate SQL type converted from the JSON schema type
-- depends_on: {{ ref('events_cover_dimensions_md_ab1') }}
select
_airbyte_dimensions_hashid,
cast(url as {{ dbt_utils.type_string() }}) as url,
cast(width as {{ dbt_utils.type_float() }}) as width,
cast(height as {{ dbt_utils.type_float() }}) as height,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('events_cover_dimensions_md_ab1') }}
-- md at events/cover/dimensions/md
where 1 = 1

View File

@ -1,19 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to build a hash column based on the values of this record
-- depends_on: {{ ref('events_cover_dimensions_md_ab2') }}
select
{{ dbt_utils.surrogate_key([
'_airbyte_dimensions_hashid',
'url',
'width',
'height',
]) }} as _airbyte_md_hashid,
tmp.*
from {{ ref('events_cover_dimensions_md_ab2') }} tmp
-- md at events/cover/dimensions/md
where 1 = 1

View File

@ -1,20 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to parse JSON blob stored in a single column and extract into separated field columns as described by the JSON Schema
-- depends_on: {{ ref('events_cover_dimensions') }}
select
_airbyte_dimensions_hashid,
{{ json_extract_scalar('sm', ['url'], ['url']) }} as url,
{{ json_extract_scalar('sm', ['width'], ['width']) }} as width,
{{ json_extract_scalar('sm', ['height'], ['height']) }} as height,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('events_cover_dimensions') }} as table_alias
-- sm at events/cover/dimensions/sm
where 1 = 1
and sm is not null

View File

@ -1,19 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to cast each column to its adequate SQL type converted from the JSON schema type
-- depends_on: {{ ref('events_cover_dimensions_sm_ab1') }}
select
_airbyte_dimensions_hashid,
cast(url as {{ dbt_utils.type_string() }}) as url,
cast(width as {{ dbt_utils.type_float() }}) as width,
cast(height as {{ dbt_utils.type_float() }}) as height,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('events_cover_dimensions_sm_ab1') }}
-- sm at events/cover/dimensions/sm
where 1 = 1

View File

@ -1,19 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to build a hash column based on the values of this record
-- depends_on: {{ ref('events_cover_dimensions_sm_ab2') }}
select
{{ dbt_utils.surrogate_key([
'_airbyte_dimensions_hashid',
'url',
'width',
'height',
]) }} as _airbyte_sm_hashid,
tmp.*
from {{ ref('events_cover_dimensions_sm_ab2') }} tmp
-- sm at events/cover/dimensions/sm
where 1 = 1

View File

@ -1,20 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to parse JSON blob stored in a single column and extract into separated field columns as described by the JSON Schema
-- depends_on: {{ ref('events') }}
select
_airbyte_events_hashid,
{{ json_extract_scalar('icon', ['_id'], ['_id']) }} as _id,
{{ json_extract_scalar('icon', ['name'], ['name']) }} as {{ adapter.quote('name') }},
{{ json_extract('table_alias', 'icon', ['dimensions'], ['dimensions']) }} as dimensions,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('events') }} as table_alias
-- icon at events/icon
where 1 = 1
and icon is not null

View File

@ -1,19 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to cast each column to its adequate SQL type converted from the JSON schema type
-- depends_on: {{ ref('events_icon_ab1') }}
select
_airbyte_events_hashid,
cast(_id as {{ dbt_utils.type_string() }}) as _id,
cast({{ adapter.quote('name') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('name') }},
cast(dimensions as {{ type_json() }}) as dimensions,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('events_icon_ab1') }}
-- icon at events/icon
where 1 = 1

View File

@ -1,19 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to build a hash column based on the values of this record
-- depends_on: {{ ref('events_icon_ab2') }}
select
{{ dbt_utils.surrogate_key([
'_airbyte_events_hashid',
'_id',
adapter.quote('name'),
object_to_string('dimensions'),
]) }} as _airbyte_icon_hashid,
tmp.*
from {{ ref('events_icon_ab2') }} tmp
-- icon at events/icon
where 1 = 1

View File

@ -1,19 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to parse JSON blob stored in a single column and extract into separated field columns as described by the JSON Schema
-- depends_on: {{ ref('events_icon') }}
select
_airbyte_icon_hashid,
{{ json_extract('table_alias', 'dimensions', ['md'], ['md']) }} as md,
{{ json_extract('table_alias', 'dimensions', ['sm'], ['sm']) }} as sm,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('events_icon') }} as table_alias
-- dimensions at events/icon/dimensions
where 1 = 1
and dimensions is not null

View File

@ -1,18 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to cast each column to its adequate SQL type converted from the JSON schema type
-- depends_on: {{ ref('events_icon_dimensions_ab1') }}
select
_airbyte_icon_hashid,
cast(md as {{ type_json() }}) as md,
cast(sm as {{ type_json() }}) as sm,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('events_icon_dimensions_ab1') }}
-- dimensions at events/icon/dimensions
where 1 = 1

View File

@ -1,18 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to build a hash column based on the values of this record
-- depends_on: {{ ref('events_icon_dimensions_ab2') }}
select
{{ dbt_utils.surrogate_key([
'_airbyte_icon_hashid',
object_to_string('md'),
object_to_string('sm'),
]) }} as _airbyte_dimensions_hashid,
tmp.*
from {{ ref('events_icon_dimensions_ab2') }} tmp
-- dimensions at events/icon/dimensions
where 1 = 1

View File

@ -1,20 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to parse JSON blob stored in a single column and extract into separated field columns as described by the JSON Schema
-- depends_on: {{ ref('events_icon_dimensions') }}
select
_airbyte_dimensions_hashid,
{{ json_extract_scalar('md', ['url'], ['url']) }} as url,
{{ json_extract_scalar('md', ['width'], ['width']) }} as width,
{{ json_extract_scalar('md', ['height'], ['height']) }} as height,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('events_icon_dimensions') }} as table_alias
-- md at events/icon/dimensions/md
where 1 = 1
and md is not null

View File

@ -1,19 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to cast each column to its adequate SQL type converted from the JSON schema type
-- depends_on: {{ ref('events_icon_dimensions_md_ab1') }}
select
_airbyte_dimensions_hashid,
cast(url as {{ dbt_utils.type_string() }}) as url,
cast(width as {{ dbt_utils.type_float() }}) as width,
cast(height as {{ dbt_utils.type_float() }}) as height,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('events_icon_dimensions_md_ab1') }}
-- md at events/icon/dimensions/md
where 1 = 1

View File

@ -1,19 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to build a hash column based on the values of this record
-- depends_on: {{ ref('events_icon_dimensions_md_ab2') }}
select
{{ dbt_utils.surrogate_key([
'_airbyte_dimensions_hashid',
'url',
'width',
'height',
]) }} as _airbyte_md_hashid,
tmp.*
from {{ ref('events_icon_dimensions_md_ab2') }} tmp
-- md at events/icon/dimensions/md
where 1 = 1

View File

@ -1,20 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to parse JSON blob stored in a single column and extract into separated field columns as described by the JSON Schema
-- depends_on: {{ ref('events_icon_dimensions') }}
select
_airbyte_dimensions_hashid,
{{ json_extract_scalar('sm', ['url'], ['url']) }} as url,
{{ json_extract_scalar('sm', ['width'], ['width']) }} as width,
{{ json_extract_scalar('sm', ['height'], ['height']) }} as height,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('events_icon_dimensions') }} as table_alias
-- sm at events/icon/dimensions/sm
where 1 = 1
and sm is not null

View File

@ -1,19 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to cast each column to its adequate SQL type converted from the JSON schema type
-- depends_on: {{ ref('events_icon_dimensions_sm_ab1') }}
select
_airbyte_dimensions_hashid,
cast(url as {{ dbt_utils.type_string() }}) as url,
cast(width as {{ dbt_utils.type_float() }}) as width,
cast(height as {{ dbt_utils.type_float() }}) as height,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('events_icon_dimensions_sm_ab1') }}
-- sm at events/icon/dimensions/sm
where 1 = 1

View File

@ -1,19 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to build a hash column based on the values of this record
-- depends_on: {{ ref('events_icon_dimensions_sm_ab2') }}
select
{{ dbt_utils.surrogate_key([
'_airbyte_dimensions_hashid',
'url',
'width',
'height',
]) }} as _airbyte_sm_hashid,
tmp.*
from {{ ref('events_icon_dimensions_sm_ab2') }} tmp
-- sm at events/icon/dimensions/sm
where 1 = 1

View File

@ -1,19 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to parse JSON blob stored in a single column and extract into separated field columns as described by the JSON Schema
-- depends_on: {{ ref('events') }}
select
_airbyte_events_hashid,
{{ json_extract_scalar('notice', ['label'], ['label']) }} as {{ adapter.quote('label') }},
{{ json_extract_scalar('notice', ['value'], ['value']) }} as {{ adapter.quote('value') }},
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('events') }} as table_alias
-- notice at events/notice
where 1 = 1
and notice is not null

View File

@ -1,18 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to cast each column to its adequate SQL type converted from the JSON schema type
-- depends_on: {{ ref('events_notice_ab1') }}
select
_airbyte_events_hashid,
cast({{ adapter.quote('label') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('label') }},
cast({{ adapter.quote('value') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('value') }},
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('events_notice_ab1') }}
-- notice at events/notice
where 1 = 1

View File

@ -1,18 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to build a hash column based on the values of this record
-- depends_on: {{ ref('events_notice_ab2') }}
select
{{ dbt_utils.surrogate_key([
'_airbyte_events_hashid',
adapter.quote('label'),
adapter.quote('value'),
]) }} as _airbyte_notice_hashid,
tmp.*
from {{ ref('events_notice_ab2') }} tmp
-- notice at events/notice
where 1 = 1

View File

@ -1,23 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to parse JSON blob stored in a single column and extract into separated field columns as described by the JSON Schema
-- depends_on: {{ ref('events') }}
select
_airbyte_events_hashid,
{{ json_extract_scalar(adapter.quote('options'), ['cash'], ['cash']) }} as cash,
{{ json_extract_scalar(adapter.quote('options'), ['percent'], ['percent']) }} as {{ adapter.quote('percent') }},
{{ json_extract_scalar(adapter.quote('options'), ['validInDays'], ['validInDays']) }} as validindays,
{{ json_extract_scalar(adapter.quote('options'), ['minOrderValue'], ['minOrderValue']) }} as minordervalue,
{{ json_extract_scalar(adapter.quote('options'), ['minOrderToClaim'], ['minOrderToClaim']) }} as minordertoclaim,
{{ json_extract_scalar(adapter.quote('options'), ['userCreatedBeforeDate'], ['userCreatedBeforeDate']) }} as usercreatedbeforedate,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('events') }} as table_alias
-- options at events/options
where 1 = 1
and {{ adapter.quote('options') }} is not null

View File

@ -1,22 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to cast each column to its adequate SQL type converted from the JSON schema type
-- depends_on: {{ ref('events_options_ab1') }}
select
_airbyte_events_hashid,
cast(cash as {{ dbt_utils.type_float() }}) as cash,
cast({{ adapter.quote('percent') }} as {{ dbt_utils.type_float() }}) as {{ adapter.quote('percent') }},
cast(validindays as {{ dbt_utils.type_float() }}) as validindays,
cast(minordervalue as {{ dbt_utils.type_float() }}) as minordervalue,
cast(minordertoclaim as {{ dbt_utils.type_float() }}) as minordertoclaim,
cast(usercreatedbeforedate as {{ dbt_utils.type_string() }}) as usercreatedbeforedate,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('events_options_ab1') }}
-- options at events/options
where 1 = 1

View File

@ -1,22 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to build a hash column based on the values of this record
-- depends_on: {{ ref('events_options_ab2') }}
select
{{ dbt_utils.surrogate_key([
'_airbyte_events_hashid',
'cash',
adapter.quote('percent'),
'validindays',
'minordervalue',
'minordertoclaim',
'usercreatedbeforedate',
]) }} as _airbyte_options_hashid,
tmp.*
from {{ ref('events_options_ab2') }} tmp
-- options at events/options
where 1 = 1

View File

@ -1,21 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to parse JSON blob stored in a single column and extract into separated field columns as described by the JSON Schema
-- depends_on: {{ ref('events') }}
select
_airbyte_events_hashid,
{{ json_extract_array('segments', ['segments'], ['segments']) }} as segments,
{{ json_extract_scalar('segments', ['userSegment'], ['userSegment']) }} as usersegment,
{{ json_extract('table_alias', 'segments', ['lastMonthSales'], ['lastMonthSales']) }} as lastmonthsales,
{{ json_extract('table_alias', 'segments', ['highestMonthlySales'], ['highestMonthlySales']) }} as highestmonthlysales,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('events') }} as table_alias
-- segments at events/segments
where 1 = 1
and segments is not null

View File

@ -1,20 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to cast each column to its adequate SQL type converted from the JSON schema type
-- depends_on: {{ ref('events_segments_ab1') }}
select
_airbyte_events_hashid,
segments,
cast(usersegment as {{ dbt_utils.type_string() }}) as usersegment,
cast(lastmonthsales as {{ type_json() }}) as lastmonthsales,
cast(highestmonthlysales as {{ type_json() }}) as highestmonthlysales,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('events_segments_ab1') }}
-- segments at events/segments
where 1 = 1

View File

@ -1,20 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to build a hash column based on the values of this record
-- depends_on: {{ ref('events_segments_ab2') }}
select
{{ dbt_utils.surrogate_key([
'_airbyte_events_hashid',
array_to_string('segments'),
'usersegment',
object_to_string('lastmonthsales'),
object_to_string('highestmonthlysales'),
]) }} as _airbyte_segments_hashid,
tmp.*
from {{ ref('events_segments_ab2') }} tmp
-- segments at events/segments
where 1 = 1

View File

@ -1,20 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to parse JSON blob stored in a single column and extract into separated field columns as described by the JSON Schema
-- depends_on: {{ ref('events_segments') }}
select
_airbyte_segments_hashid,
{{ json_extract_scalar('highestmonthlysales', ['to'], ['to']) }} as {{ adapter.quote('to') }},
{{ json_extract_scalar('highestmonthlysales', ['from'], ['from']) }} as {{ adapter.quote('from') }},
{{ json_extract_scalar('highestmonthlysales', ['active'], ['active']) }} as active,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('events_segments') }} as table_alias
-- highestmonthlysales at events/segments/highestMonthlySales
where 1 = 1
and highestmonthlysales is not null

View File

@ -1,19 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to cast each column to its adequate SQL type converted from the JSON schema type
-- depends_on: {{ ref('events_segments_highestmonthlysales_ab1') }}
select
_airbyte_segments_hashid,
cast({{ adapter.quote('to') }} as {{ dbt_utils.type_float() }}) as {{ adapter.quote('to') }},
cast({{ adapter.quote('from') }} as {{ dbt_utils.type_float() }}) as {{ adapter.quote('from') }},
{{ cast_to_boolean('active') }} as active,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('events_segments_highestmonthlysales_ab1') }}
-- highestmonthlysales at events/segments/highestMonthlySales
where 1 = 1

View File

@ -1,19 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to build a hash column based on the values of this record
-- depends_on: {{ ref('events_segments_highestmonthlysales_ab2') }}
select
{{ dbt_utils.surrogate_key([
'_airbyte_segments_hashid',
adapter.quote('to'),
adapter.quote('from'),
boolean_to_string('active'),
]) }} as _airbyte_highestmonthlysales_hashid,
tmp.*
from {{ ref('events_segments_highestmonthlysales_ab2') }} tmp
-- highestmonthlysales at events/segments/highestMonthlySales
where 1 = 1

View File

@ -1,20 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to parse JSON blob stored in a single column and extract into separated field columns as described by the JSON Schema
-- depends_on: {{ ref('events_segments') }}
select
_airbyte_segments_hashid,
{{ json_extract_scalar('lastmonthsales', ['to'], ['to']) }} as {{ adapter.quote('to') }},
{{ json_extract_scalar('lastmonthsales', ['from'], ['from']) }} as {{ adapter.quote('from') }},
{{ json_extract_scalar('lastmonthsales', ['active'], ['active']) }} as active,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('events_segments') }} as table_alias
-- lastmonthsales at events/segments/lastMonthSales
where 1 = 1
and lastmonthsales is not null

View File

@ -1,19 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to cast each column to its adequate SQL type converted from the JSON schema type
-- depends_on: {{ ref('events_segments_lastmonthsales_ab1') }}
select
_airbyte_segments_hashid,
cast({{ adapter.quote('to') }} as {{ dbt_utils.type_float() }}) as {{ adapter.quote('to') }},
cast({{ adapter.quote('from') }} as {{ dbt_utils.type_float() }}) as {{ adapter.quote('from') }},
{{ cast_to_boolean('active') }} as active,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('events_segments_lastmonthsales_ab1') }}
-- lastmonthsales at events/segments/lastMonthSales
where 1 = 1

View File

@ -1,19 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to build a hash column based on the values of this record
-- depends_on: {{ ref('events_segments_lastmonthsales_ab2') }}
select
{{ dbt_utils.surrogate_key([
'_airbyte_segments_hashid',
adapter.quote('to'),
adapter.quote('from'),
boolean_to_string('active'),
]) }} as _airbyte_lastmonthsales_hashid,
tmp.*
from {{ ref('events_segments_lastmonthsales_ab2') }} tmp
-- lastmonthsales at events/segments/lastMonthSales
where 1 = 1

View File

@ -0,0 +1,25 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
unique_key = '_airbyte_ab_id',
schema = "_airbyte_unibag",
tags = [ "top-level-intermediate" ]
) }}
-- SQL model to parse JSON blob stored in a single column and extract into separated field columns as described by the JSON Schema
-- depends_on: {{ source('unibag', '_airbyte_raw_give_gifts') }}
select
{{ json_extract_scalar('_airbyte_data', ['_id'], ['_id']) }} as _id,
{{ json_extract_scalar('_airbyte_data', ['title'], ['title']) }} as title,
{{ json_extract_scalar('_airbyte_data', ['status'], ['status']) }} as status,
{{ json_extract_scalar('_airbyte_data', ['content'], ['content']) }} as {{ adapter.quote('content') }},
{{ json_extract_scalar('_airbyte_data', ['createdAt'], ['createdAt']) }} as createdat,
{{ json_extract_scalar('_airbyte_data', ['createdBy'], ['createdBy']) }} as createdby,
{{ json_extract_scalar('_airbyte_data', ['updatedAt'], ['updatedAt']) }} as updatedat,
{{ json_extract_scalar('_airbyte_data', ['searchString'], ['searchString']) }} as searchstring,
{{ json_extract_scalar('_airbyte_data', ['lastChangeUsersAt'], ['lastChangeUsersAt']) }} as lastchangeusersat,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ source('unibag', '_airbyte_raw_give_gifts') }} as table_alias
-- give_gifts
where 1 = 1

View File

@ -0,0 +1,25 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
unique_key = '_airbyte_ab_id',
schema = "_airbyte_unibag",
tags = [ "top-level-intermediate" ]
) }}
-- SQL model to cast each column to its adequate SQL type converted from the JSON schema type
-- depends_on: {{ ref('give_gifts_ab1') }}
select
cast(_id as {{ dbt_utils.type_string() }}) as _id,
cast(title as {{ dbt_utils.type_string() }}) as title,
cast(status as {{ dbt_utils.type_string() }}) as status,
cast({{ adapter.quote('content') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('content') }},
cast(createdat as {{ dbt_utils.type_string() }}) as createdat,
cast(createdby as {{ dbt_utils.type_string() }}) as createdby,
cast(updatedat as {{ dbt_utils.type_string() }}) as updatedat,
cast(searchstring as {{ dbt_utils.type_string() }}) as searchstring,
cast(lastchangeusersat as {{ dbt_utils.type_string() }}) as lastchangeusersat,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('give_gifts_ab1') }}
-- give_gifts
where 1 = 1

View File

@ -0,0 +1,25 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
unique_key = '_airbyte_ab_id',
schema = "_airbyte_unibag",
tags = [ "top-level-intermediate" ]
) }}
-- SQL model to build a hash column based on the values of this record
-- depends_on: {{ ref('give_gifts_ab2') }}
select
{{ dbt_utils.surrogate_key([
'_id',
'title',
'status',
adapter.quote('content'),
'createdat',
'createdby',
'updatedat',
'searchstring',
'lastchangeusersat',
]) }} as _airbyte_give_gifts_hashid,
tmp.*
from {{ ref('give_gifts_ab2') }} tmp
-- give_gifts
where 1 = 1

View File

@ -7,21 +7,22 @@
-- SQL model to parse JSON blob stored in a single column and extract into separated field columns as described by the JSON Schema
-- depends_on: {{ source('unibag', '_airbyte_raw_inventories') }}
select
{{ json_extract_scalar('_airbyte_data', ['id'], ['id']) }} as {{ adapter.quote('id') }},
{{ json_extract_scalar('_airbyte_data', ['_id'], ['_id']) }} as _id,
{{ json_extract_scalar('_airbyte_data', ['code'], ['code']) }} as code,
{{ json_extract_scalar('_airbyte_data', ['name'], ['name']) }} as {{ adapter.quote('name') }},
{{ json_extract_scalar('_airbyte_data', ['slug'], ['slug']) }} as slug,
{{ json_extract_scalar('_airbyte_data', ['active'], ['active']) }} as active,
{{ json_extract('table_alias', '_airbyte_data', ['contact'], ['contact']) }} as contact,
{{ json_extract('table_alias', '_airbyte_data', ['partner'], ['partner']) }} as partner,
{{ json_extract_scalar('_airbyte_data', ['contact'], ['contact']) }} as contact,
{{ json_extract_scalar('_airbyte_data', ['partner'], ['partner']) }} as partner,
{{ json_extract_scalar('_airbyte_data', ['checksum'], ['checksum']) }} as checksum,
{{ json_extract('table_alias', '_airbyte_data', ['location'], ['location']) }} as {{ adapter.quote('location') }},
{{ json_extract('table_alias', '_airbyte_data', ['supplier'], ['supplier']) }} as supplier,
{{ json_extract_scalar('_airbyte_data', ['location'], ['location']) }} as {{ adapter.quote('location') }},
{{ json_extract_scalar('_airbyte_data', ['supplier'], ['supplier']) }} as supplier,
{{ json_extract_scalar('_airbyte_data', ['createdAt'], ['createdAt']) }} as createdat,
{{ json_extract_scalar('_airbyte_data', ['updatedAt'], ['updatedAt']) }} as updatedat,
{{ json_extract_scalar('_airbyte_data', ['minimumValue'], ['minimumValue']) }} as minimumvalue,
{{ json_extract_scalar('_airbyte_data', ['searchString'], ['searchString']) }} as searchstring,
{{ json_extract('table_alias', '_airbyte_data', ['paymentMethods'], ['paymentMethods']) }} as paymentmethods,
{{ json_extract_scalar('_airbyte_data', ['paymentMethods'], ['paymentMethods']) }} as paymentmethods,
{{ json_extract_scalar('_airbyte_data', ['canIssueInvoice'], ['canIssueInvoice']) }} as canissueinvoice,
{{ json_extract_array('_airbyte_data', ['deliveryMethods'], ['deliveryMethods']) }} as deliverymethods,
{{ json_extract_scalar('_airbyte_data', ['canAutoSendEmail'], ['canAutoSendEmail']) }} as canautosendemail,

View File

@ -7,21 +7,22 @@
-- SQL model to cast each column to its adequate SQL type converted from the JSON schema type
-- depends_on: {{ ref('inventories_ab1') }}
select
cast({{ adapter.quote('id') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('id') }},
cast(_id as {{ dbt_utils.type_string() }}) as _id,
cast(code as {{ dbt_utils.type_float() }}) as code,
cast({{ adapter.quote('name') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('name') }},
cast(slug as {{ dbt_utils.type_string() }}) as slug,
{{ cast_to_boolean('active') }} as active,
cast(contact as {{ type_json() }}) as contact,
cast(partner as {{ type_json() }}) as partner,
cast(contact as {{ dbt_utils.type_string() }}) as contact,
cast(partner as {{ dbt_utils.type_string() }}) as partner,
cast(checksum as {{ dbt_utils.type_string() }}) as checksum,
cast({{ adapter.quote('location') }} as {{ type_json() }}) as {{ adapter.quote('location') }},
cast(supplier as {{ type_json() }}) as supplier,
cast({{ adapter.quote('location') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('location') }},
cast(supplier as {{ dbt_utils.type_string() }}) as supplier,
cast(createdat as {{ dbt_utils.type_string() }}) as createdat,
cast(updatedat as {{ dbt_utils.type_string() }}) as updatedat,
cast(minimumvalue as {{ dbt_utils.type_float() }}) as minimumvalue,
cast(searchstring as {{ dbt_utils.type_string() }}) as searchstring,
cast(paymentmethods as {{ type_json() }}) as paymentmethods,
cast(paymentmethods as {{ dbt_utils.type_string() }}) as paymentmethods,
{{ cast_to_boolean('canissueinvoice') }} as canissueinvoice,
deliverymethods,
{{ cast_to_boolean('canautosendemail') }} as canautosendemail,

View File

@ -8,21 +8,22 @@
-- depends_on: {{ ref('inventories_ab2') }}
select
{{ dbt_utils.surrogate_key([
adapter.quote('id'),
'_id',
'code',
adapter.quote('name'),
'slug',
boolean_to_string('active'),
object_to_string('contact'),
object_to_string('partner'),
'contact',
'partner',
'checksum',
object_to_string(adapter.quote('location')),
object_to_string('supplier'),
adapter.quote('location'),
'supplier',
'createdat',
'updatedat',
'minimumvalue',
'searchstring',
object_to_string('paymentmethods'),
'paymentmethods',
boolean_to_string('canissueinvoice'),
array_to_string('deliverymethods'),
boolean_to_string('canautosendemail'),

View File

@ -1,21 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to parse JSON blob stored in a single column and extract into separated field columns as described by the JSON Schema
-- depends_on: {{ ref('inventories') }}
select
_airbyte_inventories_hashid,
{{ json_extract_scalar('contact', ['name'], ['name']) }} as {{ adapter.quote('name') }},
{{ json_extract_scalar('contact', ['email'], ['email']) }} as email,
{{ json_extract_scalar('contact', ['phone'], ['phone']) }} as phone,
{{ json_extract_scalar('contact', ['address'], ['address']) }} as address,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('inventories') }} as table_alias
-- contact at inventories/contact
where 1 = 1
and contact is not null

View File

@ -1,20 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to cast each column to its adequate SQL type converted from the JSON schema type
-- depends_on: {{ ref('inventories_contact_ab1') }}
select
_airbyte_inventories_hashid,
cast({{ adapter.quote('name') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('name') }},
cast(email as {{ dbt_utils.type_string() }}) as email,
cast(phone as {{ dbt_utils.type_string() }}) as phone,
cast(address as {{ dbt_utils.type_string() }}) as address,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('inventories_contact_ab1') }}
-- contact at inventories/contact
where 1 = 1

View File

@ -1,20 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to build a hash column based on the values of this record
-- depends_on: {{ ref('inventories_contact_ab2') }}
select
{{ dbt_utils.surrogate_key([
'_airbyte_inventories_hashid',
adapter.quote('name'),
'email',
'phone',
'address',
]) }} as _airbyte_contact_hashid,
tmp.*
from {{ ref('inventories_contact_ab2') }} tmp
-- contact at inventories/contact
where 1 = 1

View File

@ -1,22 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to parse JSON blob stored in a single column and extract into separated field columns as described by the JSON Schema
-- depends_on: {{ ref('inventories') }}
select
_airbyte_inventories_hashid,
{{ json_extract_scalar(adapter.quote('location'), ['ward'], ['ward']) }} as ward,
{{ json_extract_scalar(adapter.quote('location'), ['address'], ['address']) }} as address,
{{ json_extract_scalar(adapter.quote('location'), ['district'], ['district']) }} as district,
{{ json_extract('table_alias', adapter.quote('location'), ['location'], ['location']) }} as {{ adapter.quote('location') }},
{{ json_extract_scalar(adapter.quote('location'), ['province'], ['province']) }} as province,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('inventories') }} as table_alias
-- location at inventories/location
where 1 = 1
and {{ adapter.quote('location') }} is not null

View File

@ -1,21 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to cast each column to its adequate SQL type converted from the JSON schema type
-- depends_on: {{ ref('inventories_location_ab1') }}
select
_airbyte_inventories_hashid,
cast(ward as {{ dbt_utils.type_string() }}) as ward,
cast(address as {{ dbt_utils.type_string() }}) as address,
cast(district as {{ dbt_utils.type_string() }}) as district,
cast({{ adapter.quote('location') }} as {{ type_json() }}) as {{ adapter.quote('location') }},
cast(province as {{ dbt_utils.type_string() }}) as province,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('inventories_location_ab1') }}
-- location at inventories/location
where 1 = 1

View File

@ -1,21 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to build a hash column based on the values of this record
-- depends_on: {{ ref('inventories_location_ab2') }}
select
{{ dbt_utils.surrogate_key([
'_airbyte_inventories_hashid',
'ward',
'address',
'district',
object_to_string(adapter.quote('location')),
'province',
]) }} as _airbyte_location_hashid,
tmp.*
from {{ ref('inventories_location_ab2') }} tmp
-- location at inventories/location
where 1 = 1

View File

@ -1,19 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to parse JSON blob stored in a single column and extract into separated field columns as described by the JSON Schema
-- depends_on: {{ ref('inventories_location') }}
select
_airbyte_location_hashid,
{{ json_extract_scalar(adapter.quote('location'), ['type'], ['type']) }} as {{ adapter.quote('type') }},
{{ json_extract_array(adapter.quote('location'), ['coordinates'], ['coordinates']) }} as coordinates,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('inventories_location') }} as table_alias
-- location at inventories/location/location
where 1 = 1
and {{ adapter.quote('location') }} is not null

View File

@ -1,18 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to cast each column to its adequate SQL type converted from the JSON schema type
-- depends_on: {{ ref('inventories_location_location_ab1') }}
select
_airbyte_location_hashid,
cast({{ adapter.quote('type') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('type') }},
coordinates,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('inventories_location_location_ab1') }}
-- location at inventories/location/location
where 1 = 1

View File

@ -1,18 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to build a hash column based on the values of this record
-- depends_on: {{ ref('inventories_location_location_ab2') }}
select
{{ dbt_utils.surrogate_key([
'_airbyte_location_hashid',
adapter.quote('type'),
array_to_string('coordinates'),
]) }} as _airbyte_location_3_hashid,
tmp.*
from {{ ref('inventories_location_location_ab2') }} tmp
-- location at inventories/location/location
where 1 = 1

View File

@ -1,19 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to parse JSON blob stored in a single column and extract into separated field columns as described by the JSON Schema
-- depends_on: {{ ref('inventories') }}
select
_airbyte_inventories_hashid,
{{ json_extract_scalar('partner', ['code'], ['code']) }} as code,
{{ json_extract_scalar('partner', ['identityCode'], ['identityCode']) }} as identitycode,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('inventories') }} as table_alias
-- partner at inventories/partner
where 1 = 1
and partner is not null

View File

@ -1,18 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to cast each column to its adequate SQL type converted from the JSON schema type
-- depends_on: {{ ref('inventories_partner_ab1') }}
select
_airbyte_inventories_hashid,
cast(code as {{ dbt_utils.type_string() }}) as code,
cast(identitycode as {{ dbt_utils.type_string() }}) as identitycode,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('inventories_partner_ab1') }}
-- partner at inventories/partner
where 1 = 1

View File

@ -1,18 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to build a hash column based on the values of this record
-- depends_on: {{ ref('inventories_partner_ab2') }}
select
{{ dbt_utils.surrogate_key([
'_airbyte_inventories_hashid',
'code',
'identitycode',
]) }} as _airbyte_partner_hashid,
tmp.*
from {{ ref('inventories_partner_ab2') }} tmp
-- partner at inventories/partner
where 1 = 1

View File

@ -1,19 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to parse JSON blob stored in a single column and extract into separated field columns as described by the JSON Schema
-- depends_on: {{ ref('inventories') }}
select
_airbyte_inventories_hashid,
{{ json_extract_scalar('paymentmethods', ['cod'], ['cod']) }} as cod,
{{ json_extract_scalar('paymentmethods', ['bankTransfer'], ['bankTransfer']) }} as banktransfer,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('inventories') }} as table_alias
-- paymentmethods at inventories/paymentMethods
where 1 = 1
and paymentmethods is not null

View File

@ -1,18 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to cast each column to its adequate SQL type converted from the JSON schema type
-- depends_on: {{ ref('inventories_paymentmethods_ab1') }}
select
_airbyte_inventories_hashid,
{{ cast_to_boolean('cod') }} as cod,
{{ cast_to_boolean('banktransfer') }} as banktransfer,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('inventories_paymentmethods_ab1') }}
-- paymentmethods at inventories/paymentMethods
where 1 = 1

View File

@ -1,18 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to build a hash column based on the values of this record
-- depends_on: {{ ref('inventories_paymentmethods_ab2') }}
select
{{ dbt_utils.surrogate_key([
'_airbyte_inventories_hashid',
boolean_to_string('cod'),
boolean_to_string('banktransfer'),
]) }} as _airbyte_paymentmethods_hashid,
tmp.*
from {{ ref('inventories_paymentmethods_ab2') }} tmp
-- paymentmethods at inventories/paymentMethods
where 1 = 1

View File

@ -1,20 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to parse JSON blob stored in a single column and extract into separated field columns as described by the JSON Schema
-- depends_on: {{ ref('inventories') }}
select
_airbyte_inventories_hashid,
{{ json_extract_scalar('supplier', ['_id'], ['_id']) }} as _id,
{{ json_extract_scalar('supplier', ['name'], ['name']) }} as {{ adapter.quote('name') }},
{{ json_extract_scalar('supplier', ['searchString'], ['searchString']) }} as searchstring,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('inventories') }} as table_alias
-- supplier at inventories/supplier
where 1 = 1
and supplier is not null

View File

@ -1,19 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to cast each column to its adequate SQL type converted from the JSON schema type
-- depends_on: {{ ref('inventories_supplier_ab1') }}
select
_airbyte_inventories_hashid,
cast(_id as {{ dbt_utils.type_string() }}) as _id,
cast({{ adapter.quote('name') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('name') }},
cast(searchstring as {{ dbt_utils.type_string() }}) as searchstring,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('inventories_supplier_ab1') }}
-- supplier at inventories/supplier
where 1 = 1

View File

@ -1,19 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to build a hash column based on the values of this record
-- depends_on: {{ ref('inventories_supplier_ab2') }}
select
{{ dbt_utils.surrogate_key([
'_airbyte_inventories_hashid',
'_id',
adapter.quote('name'),
'searchstring',
]) }} as _airbyte_supplier_hashid,
tmp.*
from {{ ref('inventories_supplier_ab2') }} tmp
-- supplier at inventories/supplier
where 1 = 1

View File

@ -16,8 +16,10 @@ select
{{ json_extract_scalar('_airbyte_data', ['active'], ['active']) }} as active,
{{ json_extract_scalar('_airbyte_data', ['createdAt'], ['createdAt']) }} as createdat,
{{ json_extract_scalar('_airbyte_data', ['updatedAt'], ['updatedAt']) }} as updatedat,
{{ json_extract_scalar('_airbyte_data', ['updatedat'], ['updatedat']) }} as updatedat_1,
{{ json_extract_scalar('_airbyte_data', ['transaction'], ['transaction']) }} as {{ adapter.quote('transaction') }},
{{ json_extract_scalar('_airbyte_data', ['bonusPercent'], ['bonusPercent']) }} as bonuspercent,
{{ json_extract_scalar('_airbyte_data', ['bonuspercent'], ['bonuspercent']) }} as bonuspercent_1,
{{ json_extract_scalar('_airbyte_data', ['transactionMinValue'], ['transactionMinValue']) }} as transactionminvalue,
_airbyte_ab_id,
_airbyte_emitted_at,

View File

@ -16,8 +16,10 @@ select
{{ cast_to_boolean('active') }} as active,
cast(createdat as {{ dbt_utils.type_string() }}) as createdat,
cast(updatedat as {{ dbt_utils.type_string() }}) as updatedat,
cast(updatedat_1 as {{ dbt_utils.type_string() }}) as updatedat_1,
cast({{ adapter.quote('transaction') }} as {{ dbt_utils.type_float() }}) as {{ adapter.quote('transaction') }},
cast(bonuspercent as {{ dbt_utils.type_float() }}) as bonuspercent,
cast(bonuspercent_1 as {{ dbt_utils.type_float() }}) as bonuspercent_1,
cast(transactionminvalue as {{ dbt_utils.type_float() }}) as transactionminvalue,
_airbyte_ab_id,
_airbyte_emitted_at,

View File

@ -17,8 +17,10 @@ select
boolean_to_string('active'),
'createdat',
'updatedat',
'updatedat_1',
adapter.quote('transaction'),
'bonuspercent',
'bonuspercent_1',
'transactionminvalue',
]) }} as _airbyte_membership_hashid,
tmp.*

View File

@ -8,8 +8,8 @@
-- depends_on: {{ source('unibag', '_airbyte_raw_membership_histories') }}
select
{{ json_extract_scalar('_airbyte_data', ['_id'], ['_id']) }} as _id,
{{ json_extract('table_alias', '_airbyte_data', ['new'], ['new']) }} as {{ adapter.quote('new') }},
{{ json_extract('table_alias', '_airbyte_data', ['old'], ['old']) }} as {{ adapter.quote('old') }},
{{ json_extract_scalar('_airbyte_data', ['new'], ['new']) }} as {{ adapter.quote('new') }},
{{ json_extract_scalar('_airbyte_data', ['old'], ['old']) }} as {{ adapter.quote('old') }},
{{ json_extract_scalar('_airbyte_data', ['type'], ['type']) }} as {{ adapter.quote('type') }},
{{ json_extract_scalar('_airbyte_data', ['user'], ['user']) }} as {{ adapter.quote('user') }},
{{ json_extract_scalar('_airbyte_data', ['createdAt'], ['createdAt']) }} as createdat,

View File

@ -8,8 +8,8 @@
-- depends_on: {{ ref('membership_histories_ab1') }}
select
cast(_id as {{ dbt_utils.type_string() }}) as _id,
cast({{ adapter.quote('new') }} as {{ type_json() }}) as {{ adapter.quote('new') }},
cast({{ adapter.quote('old') }} as {{ type_json() }}) as {{ adapter.quote('old') }},
cast({{ adapter.quote('new') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('new') }},
cast({{ adapter.quote('old') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('old') }},
cast({{ adapter.quote('type') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('type') }},
cast({{ adapter.quote('user') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('user') }},
cast(createdat as {{ dbt_utils.type_string() }}) as createdat,

View File

@ -9,8 +9,8 @@
select
{{ dbt_utils.surrogate_key([
'_id',
object_to_string(adapter.quote('new')),
object_to_string(adapter.quote('old')),
adapter.quote('new'),
adapter.quote('old'),
adapter.quote('type'),
adapter.quote('user'),
'createdat',

View File

@ -1,24 +0,0 @@
{{ config(
indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}],
schema = "_airbyte_unibag",
tags = [ "nested-intermediate" ]
) }}
-- SQL model to parse JSON blob stored in a single column and extract into separated field columns as described by the JSON Schema
-- depends_on: {{ ref('membership_histories') }}
select
_airbyte_membership_histories_hashid,
{{ json_extract_scalar(adapter.quote('new'), ['name'], ['name']) }} as {{ adapter.quote('name') }},
{{ json_extract_scalar(adapter.quote('new'), ['level'], ['level']) }} as {{ adapter.quote('level') }},
{{ json_extract('table_alias', adapter.quote('new'), ['condition'], ['condition']) }} as {{ adapter.quote('condition') }},
{{ json_extract_scalar(adapter.quote('new'), ['statistic'], ['statistic']) }} as statistic,
{{ json_extract_scalar(adapter.quote('new'), ['transaction'], ['transaction']) }} as {{ adapter.quote('transaction') }},
{{ json_extract_scalar(adapter.quote('new'), ['bonusPercent'], ['bonusPercent']) }} as bonuspercent,
{{ json_extract_scalar(adapter.quote('new'), ['transactionMinValue'], ['transactionMinValue']) }} as transactionminvalue,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('membership_histories') }} as table_alias
-- new at membership-histories/new
where 1 = 1
and {{ adapter.quote('new') }} is not null

Some files were not shown because too many files have changed in this diff Show More