This commit is contained in:
Ubuntu 2022-05-10 21:30:53 +07:00
parent 947967b851
commit e305bb2baa
684 changed files with 14162 additions and 395 deletions

View File

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

View File

@ -141,6 +141,10 @@ vars:
referrals_ab2: unibag._airbyte_raw_referrals referrals_ab2: unibag._airbyte_raw_referrals
referrals_ab3: unibag._airbyte_raw_referrals referrals_ab3: unibag._airbyte_raw_referrals
referrals: unibag._airbyte_raw_referrals referrals: unibag._airbyte_raw_referrals
session_deliveries_ab1: unibag._airbyte_raw_session_deliveries
session_deliveries_ab2: unibag._airbyte_raw_session_deliveries
session_deliveries_ab3: unibag._airbyte_raw_session_deliveries
session_deliveries: unibag._airbyte_raw_session_deliveries
social_post_views_ab1: unibag._airbyte_raw_social_post_views social_post_views_ab1: unibag._airbyte_raw_social_post_views
social_post_views_ab2: unibag._airbyte_raw_social_post_views social_post_views_ab2: unibag._airbyte_raw_social_post_views
social_post_views_ab3: unibag._airbyte_raw_social_post_views social_post_views_ab3: unibag._airbyte_raw_social_post_views
@ -189,3 +193,599 @@ vars:
wards_ab2: unibag._airbyte_raw_wards wards_ab2: unibag._airbyte_raw_wards
wards_ab3: unibag._airbyte_raw_wards wards_ab3: unibag._airbyte_raw_wards
wards: 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

@ -33,7 +33,7 @@
{%- endmacro -%} {%- endmacro -%}
{%- macro sqlserver__type_json() -%} {%- macro sqlserver__type_json() -%}
VARCHAR(max) NVARCHAR(max)
{%- endmacro -%} {%- endmacro -%}
{% macro clickhouse__type_json() %} {% macro clickhouse__type_json() %}
@ -52,7 +52,7 @@
{%- endmacro -%} {%- endmacro -%}
{% macro sqlserver__type_string() %} {% macro sqlserver__type_string() %}
VARCHAR(max) NVARCHAR(max)
{%- endmacro -%} {%- endmacro -%}
{%- macro clickhouse__type_string() -%} {%- macro clickhouse__type_string() -%}
@ -154,7 +154,7 @@
{%- macro sqlserver__type_timestamp_with_timezone() -%} {%- macro sqlserver__type_timestamp_with_timezone() -%}
{#-- in TSQL timestamp is really datetime or datetime2 --#} {#-- in TSQL timestamp is really datetime or datetime2 --#}
{#-- https://docs.microsoft.com/en-us/sql/t-sql/functions/date-and-time-data-types-and-functions-transact-sql?view=sql-server-ver15#DateandTimeDataTypes --#} {#-- https://docs.microsoft.com/en-us/sql/t-sql/functions/date-and-time-data-types-and-functions-transact-sql?view=sql-server-ver15#DateandTimeDataTypes --#}
datetime datetime2
{%- endmacro -%} {%- endmacro -%}
{% macro clickhouse__type_timestamp_with_timezone() %} {% macro clickhouse__type_timestamp_with_timezone() %}

View File

@ -12,7 +12,7 @@ select
{{ json_extract_scalar('_airbyte_data', ['user'], ['user']) }} as {{ adapter.quote('user') }}, {{ 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', ['value'], ['value']) }} as {{ adapter.quote('value') }},
{{ json_extract_scalar('_airbyte_data', ['action'], ['action']) }} as {{ adapter.quote('action') }}, {{ json_extract_scalar('_airbyte_data', ['action'], ['action']) }} as {{ adapter.quote('action') }},
{{ json_extract_scalar('_airbyte_data', ['options'], ['options']) }} as {{ adapter.quote('options') }}, {{ json_extract('table_alias', '_airbyte_data', ['options'], ['options']) }} as {{ adapter.quote('options') }},
{{ json_extract_scalar('_airbyte_data', ['category'], ['category']) }} as category, {{ json_extract_scalar('_airbyte_data', ['category'], ['category']) }} as category,
{{ json_extract_scalar('_airbyte_data', ['targetId'], ['targetId']) }} as targetid, {{ json_extract_scalar('_airbyte_data', ['targetId'], ['targetId']) }} as targetid,
{{ json_extract_scalar('_airbyte_data', ['createdAt'], ['createdAt']) }} as createdat, {{ 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('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('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('action') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('action') }},
cast({{ adapter.quote('options') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('options') }}, cast({{ adapter.quote('options') }} as {{ type_json() }}) as {{ adapter.quote('options') }},
cast(category as {{ dbt_utils.type_string() }}) as category, cast(category as {{ dbt_utils.type_string() }}) as category,
cast(targetid as {{ dbt_utils.type_string() }}) as targetid, cast(targetid as {{ dbt_utils.type_string() }}) as targetid,
cast(createdat as {{ dbt_utils.type_string() }}) as createdat, cast(createdat as {{ dbt_utils.type_string() }}) as createdat,

View File

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

View File

@ -0,0 +1,22 @@
{{ 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

@ -0,0 +1,21 @@
{{ 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

@ -0,0 +1,21 @@
{{ 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,16 +8,15 @@
-- depends_on: {{ source('unibag', '_airbyte_raw_customers') }} -- depends_on: {{ source('unibag', '_airbyte_raw_customers') }}
select select
{{ json_extract_scalar('_airbyte_data', ['_id'], ['_id']) }} as _id, {{ json_extract_scalar('_airbyte_data', ['_id'], ['_id']) }} as _id,
{{ json_extract_scalar('_airbyte_data', ['info'], ['info']) }} as info, {{ json_extract('table_alias', '_airbyte_data', ['info'], ['info']) }} as info,
{{ json_extract_scalar('_airbyte_data', ['name'], ['name']) }} as {{ adapter.quote('name') }}, {{ 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', ['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', ['phone'], ['phone']) }} as phone,
{{ json_extract_scalar('_airbyte_data', ['source'], ['source']) }} as {{ adapter.quote('source') }}, {{ json_extract_scalar('_airbyte_data', ['source'], ['source']) }} as {{ adapter.quote('source') }},
{{ json_extract_array('_airbyte_data', ['location'], ['location']) }} as {{ adapter.quote('location') }}, {{ 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', ['createdAt'], ['createdAt']) }} as createdat,
{{ json_extract_scalar('_airbyte_data', ['isDeleted'], ['isDeleted']) }} as isdeleted, {{ json_extract_scalar('_airbyte_data', ['isDeleted'], ['isDeleted']) }} as isdeleted,
{{ json_extract_scalar('_airbyte_data', ['statistic'], ['statistic']) }} as statistic, {{ json_extract('table_alias', '_airbyte_data', ['statistic'], ['statistic']) }} as statistic,
{{ json_extract_scalar('_airbyte_data', ['updatedAt'], ['updatedAt']) }} as updatedat, {{ json_extract_scalar('_airbyte_data', ['updatedAt'], ['updatedAt']) }} as updatedat,
{{ json_extract_scalar('_airbyte_data', ['searchString'], ['searchString']) }} as searchstring, {{ json_extract_scalar('_airbyte_data', ['searchString'], ['searchString']) }} as searchstring,
_airbyte_ab_id, _airbyte_ab_id,

View File

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

View File

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

View File

@ -0,0 +1,22 @@
{{ 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

@ -0,0 +1,21 @@
{{ 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

@ -0,0 +1,21 @@
{{ 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

@ -0,0 +1,22 @@
{{ 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

@ -0,0 +1,21 @@
{{ 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

@ -0,0 +1,21 @@
{{ 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', ['user'], ['user']) }} as {{ adapter.quote('user') }},
{{ json_extract_scalar('_airbyte_data', ['event'], ['event']) }} as {{ adapter.quote('event') }}, {{ json_extract_scalar('_airbyte_data', ['event'], ['event']) }} as {{ adapter.quote('event') }},
{{ json_extract_scalar('_airbyte_data', ['status'], ['status']) }} as status, {{ json_extract_scalar('_airbyte_data', ['status'], ['status']) }} as status,
{{ json_extract_scalar('_airbyte_data', ['options'], ['options']) }} as {{ adapter.quote('options') }}, {{ json_extract('table_alias', '_airbyte_data', ['options'], ['options']) }} as {{ adapter.quote('options') }},
{{ json_extract_scalar('_airbyte_data', ['createdAt'], ['createdAt']) }} as createdat, {{ 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,
_airbyte_ab_id, _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('user') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('user') }},
cast({{ adapter.quote('event') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('event') }}, cast({{ adapter.quote('event') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('event') }},
cast(status as {{ dbt_utils.type_string() }}) as status, cast(status as {{ dbt_utils.type_string() }}) as status,
cast({{ adapter.quote('options') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('options') }}, cast({{ adapter.quote('options') }} as {{ type_json() }}) as {{ adapter.quote('options') }},
cast(createdat as {{ dbt_utils.type_string() }}) as createdat, cast(createdat as {{ dbt_utils.type_string() }}) as createdat,
cast(updatedat as {{ dbt_utils.type_string() }}) as updatedat, cast(updatedat as {{ dbt_utils.type_string() }}) as updatedat,
_airbyte_ab_id, _airbyte_ab_id,

View File

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

View File

@ -0,0 +1,23 @@
{{ 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

@ -0,0 +1,22 @@
{{ 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

@ -0,0 +1,22 @@
{{ 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,21 +8,20 @@
-- depends_on: {{ source('unibag', '_airbyte_raw_events') }} -- depends_on: {{ source('unibag', '_airbyte_raw_events') }}
select select
{{ json_extract_scalar('_airbyte_data', ['_id'], ['_id']) }} as _id, {{ 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_scalar('_airbyte_data', ['desc'], ['desc']) }} as {{ adapter.quote('desc') }},
{{ json_extract_scalar('_airbyte_data', ['icon'], ['icon']) }} as icon, {{ json_extract('table_alias', '_airbyte_data', ['icon'], ['icon']) }} as icon,
{{ json_extract_scalar('_airbyte_data', ['name'], ['name']) }} as {{ adapter.quote('name') }}, {{ json_extract_scalar('_airbyte_data', ['name'], ['name']) }} as {{ adapter.quote('name') }},
{{ json_extract_scalar('_airbyte_data', ['type'], ['type']) }} as {{ adapter.quote('type') }}, {{ json_extract_scalar('_airbyte_data', ['type'], ['type']) }} as {{ adapter.quote('type') }},
{{ json_extract_scalar('_airbyte_data', ['cover'], ['cover']) }} as cover, {{ json_extract('table_alias', '_airbyte_data', ['cover'], ['cover']) }} as cover,
{{ json_extract_scalar('_airbyte_data', ['endAt'], ['endAt']) }} as endat, {{ json_extract_scalar('_airbyte_data', ['endAt'], ['endAt']) }} as endat,
{{ json_extract_scalar('_airbyte_data', ['active'], ['active']) }} as active, {{ json_extract_scalar('_airbyte_data', ['active'], ['active']) }} as active,
{{ json_extract_scalar('_airbyte_data', ['notice'], ['notice']) }} as notice, {{ json_extract('table_alias', '_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_scalar('_airbyte_data', ['article'], ['article']) }} as article,
{{ json_extract_scalar('_airbyte_data', ['options'], ['options']) }} as {{ adapter.quote('options') }}, {{ json_extract('table_alias', '_airbyte_data', ['options'], ['options']) }} as {{ adapter.quote('options') }},
{{ json_extract_scalar('_airbyte_data', ['startAt'], ['startAt']) }} as startat, {{ json_extract_scalar('_airbyte_data', ['startAt'], ['startAt']) }} as startat,
{{ json_extract_scalar('_airbyte_data', ['segments'], ['segments']) }} as segments, {{ json_extract('table_alias', '_airbyte_data', ['segments'], ['segments']) }} as segments,
{{ json_extract_scalar('_airbyte_data', ['createdAt'], ['createdAt']) }} as createdat, {{ 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_array('_airbyte_data', ['suppliers'], ['suppliers']) }} as suppliers,
{{ json_extract_scalar('_airbyte_data', ['updatedAt'], ['updatedAt']) }} as updatedat, {{ json_extract_scalar('_airbyte_data', ['updatedAt'], ['updatedAt']) }} as updatedat,
{{ json_extract_array('_airbyte_data', ['information'], ['information']) }} as information, {{ json_extract_array('_airbyte_data', ['information'], ['information']) }} as information,

View File

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

View File

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

View File

@ -0,0 +1,20 @@
{{ 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

@ -0,0 +1,19 @@
{{ 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

@ -0,0 +1,19 @@
{{ 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

@ -0,0 +1,19 @@
{{ 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

@ -0,0 +1,18 @@
{{ 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

@ -0,0 +1,18 @@
{{ 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

@ -0,0 +1,20 @@
{{ 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

@ -0,0 +1,19 @@
{{ 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

@ -0,0 +1,19 @@
{{ 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

@ -0,0 +1,20 @@
{{ 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

@ -0,0 +1,19 @@
{{ 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

@ -0,0 +1,19 @@
{{ 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

@ -0,0 +1,20 @@
{{ 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

@ -0,0 +1,19 @@
{{ 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

@ -0,0 +1,19 @@
{{ 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

@ -0,0 +1,19 @@
{{ 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

@ -0,0 +1,18 @@
{{ 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

@ -0,0 +1,18 @@
{{ 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

@ -0,0 +1,20 @@
{{ 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

@ -0,0 +1,19 @@
{{ 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

@ -0,0 +1,19 @@
{{ 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

@ -0,0 +1,20 @@
{{ 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

@ -0,0 +1,19 @@
{{ 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

@ -0,0 +1,19 @@
{{ 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

@ -0,0 +1,19 @@
{{ 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

@ -0,0 +1,18 @@
{{ 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

@ -0,0 +1,18 @@
{{ 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

@ -0,0 +1,23 @@
{{ 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

@ -0,0 +1,22 @@
{{ 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

@ -0,0 +1,22 @@
{{ 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

@ -0,0 +1,21 @@
{{ 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

@ -0,0 +1,20 @@
{{ 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

@ -0,0 +1,20 @@
{{ 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

@ -0,0 +1,20 @@
{{ 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

@ -0,0 +1,19 @@
{{ 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

@ -0,0 +1,19 @@
{{ 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

@ -0,0 +1,20 @@
{{ 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

@ -0,0 +1,19 @@
{{ 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

@ -0,0 +1,19 @@
{{ 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

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

View File

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

View File

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

View File

@ -0,0 +1,21 @@
{{ 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

@ -0,0 +1,20 @@
{{ 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

@ -0,0 +1,20 @@
{{ 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

@ -0,0 +1,22 @@
{{ 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

@ -0,0 +1,21 @@
{{ 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

@ -0,0 +1,21 @@
{{ 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

@ -0,0 +1,19 @@
{{ 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

@ -0,0 +1,18 @@
{{ 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

@ -0,0 +1,18 @@
{{ 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

@ -0,0 +1,19 @@
{{ 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

@ -0,0 +1,18 @@
{{ 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

@ -0,0 +1,18 @@
{{ 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

@ -0,0 +1,19 @@
{{ 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

@ -0,0 +1,18 @@
{{ 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

@ -0,0 +1,18 @@
{{ 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

@ -0,0 +1,20 @@
{{ 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

@ -0,0 +1,19 @@
{{ 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

@ -0,0 +1,19 @@
{{ 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,10 +16,8 @@ select
{{ json_extract_scalar('_airbyte_data', ['active'], ['active']) }} as active, {{ json_extract_scalar('_airbyte_data', ['active'], ['active']) }} as active,
{{ json_extract_scalar('_airbyte_data', ['createdAt'], ['createdAt']) }} as createdat, {{ 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,
{{ 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', ['transaction'], ['transaction']) }} as {{ adapter.quote('transaction') }},
{{ json_extract_scalar('_airbyte_data', ['bonusPercent'], ['bonusPercent']) }} as bonuspercent, {{ 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, {{ json_extract_scalar('_airbyte_data', ['transactionMinValue'], ['transactionMinValue']) }} as transactionminvalue,
_airbyte_ab_id, _airbyte_ab_id,
_airbyte_emitted_at, _airbyte_emitted_at,

View File

@ -16,10 +16,8 @@ select
{{ cast_to_boolean('active') }} as active, {{ cast_to_boolean('active') }} as active,
cast(createdat as {{ dbt_utils.type_string() }}) as createdat, cast(createdat as {{ dbt_utils.type_string() }}) as createdat,
cast(updatedat as {{ dbt_utils.type_string() }}) as updatedat, 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({{ adapter.quote('transaction') }} as {{ dbt_utils.type_float() }}) as {{ adapter.quote('transaction') }},
cast(bonuspercent as {{ dbt_utils.type_float() }}) as bonuspercent, 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, cast(transactionminvalue as {{ dbt_utils.type_float() }}) as transactionminvalue,
_airbyte_ab_id, _airbyte_ab_id,
_airbyte_emitted_at, _airbyte_emitted_at,

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,24 @@
{{ 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

View File

@ -0,0 +1,23 @@
{{ 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('membership_histories_new_ab1') }}
select
_airbyte_membership_histories_hashid,
cast({{ adapter.quote('name') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('name') }},
cast({{ adapter.quote('level') }} as {{ dbt_utils.type_float() }}) as {{ adapter.quote('level') }},
cast({{ adapter.quote('condition') }} as {{ type_json() }}) as {{ adapter.quote('condition') }},
cast(statistic as {{ dbt_utils.type_string() }}) as statistic,
cast({{ adapter.quote('transaction') }} as {{ dbt_utils.type_float() }}) as {{ adapter.quote('transaction') }},
cast(bonuspercent as {{ dbt_utils.type_float() }}) as bonuspercent,
cast(transactionminvalue as {{ dbt_utils.type_float() }}) as transactionminvalue,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('membership_histories_new_ab1') }}
-- new at membership-histories/new
where 1 = 1

View File

@ -0,0 +1,23 @@
{{ 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('membership_histories_new_ab2') }}
select
{{ dbt_utils.surrogate_key([
'_airbyte_membership_histories_hashid',
adapter.quote('name'),
adapter.quote('level'),
object_to_string(adapter.quote('condition')),
'statistic',
adapter.quote('transaction'),
'bonuspercent',
'transactionminvalue',
]) }} as _airbyte_new_hashid,
tmp.*
from {{ ref('membership_histories_new_ab2') }} tmp
-- new at membership-histories/new
where 1 = 1

View File

@ -0,0 +1,22 @@
{{ 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_new') }}
select
_airbyte_new_hashid,
{{ json_extract_scalar(adapter.quote('condition'), ['name'], ['name']) }} as {{ adapter.quote('name') }},
{{ json_extract_scalar(adapter.quote('condition'), ['sales'], ['sales']) }} as sales,
{{ json_extract_scalar(adapter.quote('condition'), ['transaction'], ['transaction']) }} as {{ adapter.quote('transaction') }},
{{ json_extract_scalar(adapter.quote('condition'), ['bonusPercent'], ['bonusPercent']) }} as bonuspercent,
{{ json_extract_scalar(adapter.quote('condition'), ['transactionMinValue'], ['transactionMinValue']) }} as transactionminvalue,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('membership_histories_new') }} as table_alias
-- condition at membership-histories/new/condition
where 1 = 1
and {{ adapter.quote('condition') }} is not null

View File

@ -0,0 +1,21 @@
{{ 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('membership_histories_new_condition_ab1') }}
select
_airbyte_new_hashid,
cast({{ adapter.quote('name') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('name') }},
cast(sales as {{ dbt_utils.type_float() }}) as sales,
cast({{ adapter.quote('transaction') }} as {{ dbt_utils.type_float() }}) as {{ adapter.quote('transaction') }},
cast(bonuspercent as {{ dbt_utils.type_float() }}) as bonuspercent,
cast(transactionminvalue as {{ dbt_utils.type_float() }}) as transactionminvalue,
_airbyte_ab_id,
_airbyte_emitted_at,
{{ current_timestamp() }} as _airbyte_normalized_at
from {{ ref('membership_histories_new_condition_ab1') }}
-- condition at membership-histories/new/condition
where 1 = 1

View File

@ -0,0 +1,21 @@
{{ 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('membership_histories_new_condition_ab2') }}
select
{{ dbt_utils.surrogate_key([
'_airbyte_new_hashid',
adapter.quote('name'),
'sales',
adapter.quote('transaction'),
'bonuspercent',
'transactionminvalue',
]) }} as _airbyte_condition_hashid,
tmp.*
from {{ ref('membership_histories_new_condition_ab2') }} tmp
-- condition at membership-histories/new/condition
where 1 = 1

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