From e305bb2baaac072fe56ec083aedf3883bb192975 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Tue, 10 May 2022 21:30:53 +0700 Subject: [PATCH] update --- Makefile | 2 +- dbt_project.yml | 600 ++++++++++++++++++ destination_catalog.json | 2 +- macros/cross_db_utils/datatypes.sql | 6 +- .../airbyte_ctes/unibag/cash_flows_ab1.sql | 2 +- .../airbyte_ctes/unibag/cash_flows_ab2.sql | 2 +- .../airbyte_ctes/unibag/cash_flows_ab3.sql | 2 +- .../unibag/cash_flows_options_ab1.sql | 22 + .../unibag/cash_flows_options_ab2.sql | 21 + .../unibag/cash_flows_options_ab3.sql | 21 + .../airbyte_ctes/unibag/customers_ab1.sql | 5 +- .../airbyte_ctes/unibag/customers_ab2.sql | 5 +- .../airbyte_ctes/unibag/customers_ab3.sql | 5 +- .../unibag/customers_info_ab1.sql | 22 + .../unibag/customers_info_ab2.sql | 21 + .../unibag/customers_info_ab3.sql | 21 + .../unibag/customers_statistic_ab1.sql | 22 + .../unibag/customers_statistic_ab2.sql | 21 + .../unibag/customers_statistic_ab3.sql | 21 + .../airbyte_ctes/unibag/event_rewards_ab1.sql | 2 +- .../airbyte_ctes/unibag/event_rewards_ab2.sql | 2 +- .../airbyte_ctes/unibag/event_rewards_ab3.sql | 2 +- .../unibag/event_rewards_options_ab1.sql | 23 + .../unibag/event_rewards_options_ab2.sql | 22 + .../unibag/event_rewards_options_ab3.sql | 22 + .../airbyte_ctes/unibag/events_ab1.sql | 13 +- .../airbyte_ctes/unibag/events_ab2.sql | 13 +- .../airbyte_ctes/unibag/events_ab3.sql | 13 +- .../airbyte_ctes/unibag/events_cover_ab1.sql | 20 + .../airbyte_ctes/unibag/events_cover_ab2.sql | 19 + .../airbyte_ctes/unibag/events_cover_ab3.sql | 19 + .../unibag/events_cover_dimensions_ab1.sql | 19 + .../unibag/events_cover_dimensions_ab2.sql | 18 + .../unibag/events_cover_dimensions_ab3.sql | 18 + .../unibag/events_cover_dimensions_md_ab1.sql | 20 + .../unibag/events_cover_dimensions_md_ab2.sql | 19 + .../unibag/events_cover_dimensions_md_ab3.sql | 19 + .../unibag/events_cover_dimensions_sm_ab1.sql | 20 + .../unibag/events_cover_dimensions_sm_ab2.sql | 19 + .../unibag/events_cover_dimensions_sm_ab3.sql | 19 + .../airbyte_ctes/unibag/events_icon_ab1.sql | 20 + .../airbyte_ctes/unibag/events_icon_ab2.sql | 19 + .../airbyte_ctes/unibag/events_icon_ab3.sql | 19 + .../unibag/events_icon_dimensions_ab1.sql | 19 + .../unibag/events_icon_dimensions_ab2.sql | 18 + .../unibag/events_icon_dimensions_ab3.sql | 18 + .../unibag/events_icon_dimensions_md_ab1.sql | 20 + .../unibag/events_icon_dimensions_md_ab2.sql | 19 + .../unibag/events_icon_dimensions_md_ab3.sql | 19 + .../unibag/events_icon_dimensions_sm_ab1.sql | 20 + .../unibag/events_icon_dimensions_sm_ab2.sql | 19 + .../unibag/events_icon_dimensions_sm_ab3.sql | 19 + .../airbyte_ctes/unibag/events_notice_ab1.sql | 19 + .../airbyte_ctes/unibag/events_notice_ab2.sql | 18 + .../airbyte_ctes/unibag/events_notice_ab3.sql | 18 + .../unibag/events_options_ab1.sql | 23 + .../unibag/events_options_ab2.sql | 22 + .../unibag/events_options_ab3.sql | 22 + .../unibag/events_segments_ab1.sql | 21 + .../unibag/events_segments_ab2.sql | 20 + .../unibag/events_segments_ab3.sql | 20 + ...vents_segments_highestmonthlysales_ab1.sql | 20 + ...vents_segments_highestmonthlysales_ab2.sql | 19 + ...vents_segments_highestmonthlysales_ab3.sql | 19 + .../events_segments_lastmonthsales_ab1.sql | 20 + .../events_segments_lastmonthsales_ab2.sql | 19 + .../events_segments_lastmonthsales_ab3.sql | 19 + .../airbyte_ctes/unibag/inventories_ab1.sql | 11 +- .../airbyte_ctes/unibag/inventories_ab2.sql | 11 +- .../airbyte_ctes/unibag/inventories_ab3.sql | 11 +- .../unibag/inventories_contact_ab1.sql | 21 + .../unibag/inventories_contact_ab2.sql | 20 + .../unibag/inventories_contact_ab3.sql | 20 + .../unibag/inventories_location_ab1.sql | 22 + .../unibag/inventories_location_ab2.sql | 21 + .../unibag/inventories_location_ab3.sql | 21 + .../inventories_location_location_ab1.sql | 19 + .../inventories_location_location_ab2.sql | 18 + .../inventories_location_location_ab3.sql | 18 + .../unibag/inventories_partner_ab1.sql | 19 + .../unibag/inventories_partner_ab2.sql | 18 + .../unibag/inventories_partner_ab3.sql | 18 + .../unibag/inventories_paymentmethods_ab1.sql | 19 + .../unibag/inventories_paymentmethods_ab2.sql | 18 + .../unibag/inventories_paymentmethods_ab3.sql | 18 + .../unibag/inventories_supplier_ab1.sql | 20 + .../unibag/inventories_supplier_ab2.sql | 19 + .../unibag/inventories_supplier_ab3.sql | 19 + .../airbyte_ctes/unibag/membership_ab1.sql | 2 - .../airbyte_ctes/unibag/membership_ab2.sql | 2 - .../airbyte_ctes/unibag/membership_ab3.sql | 2 - .../unibag/membership_histories_ab1.sql | 4 +- .../unibag/membership_histories_ab2.sql | 4 +- .../unibag/membership_histories_ab3.sql | 4 +- .../unibag/membership_histories_new_ab1.sql | 24 + .../unibag/membership_histories_new_ab2.sql | 23 + .../unibag/membership_histories_new_ab3.sql | 23 + ...membership_histories_new_condition_ab1.sql | 22 + ...membership_histories_new_condition_ab2.sql | 21 + ...membership_histories_new_condition_ab3.sql | 21 + .../unibag/membership_histories_old_ab1.sql | 24 + .../unibag/membership_histories_old_ab2.sql | 23 + .../unibag/membership_histories_old_ab3.sql | 23 + ...membership_histories_old_condition_ab1.sql | 22 + ...membership_histories_old_condition_ab2.sql | 21 + ...membership_histories_old_condition_ab3.sql | 21 + ...membership_histories_old_statistic_ab1.sql | 19 + ...membership_histories_old_statistic_ab2.sql | 18 + ...membership_histories_old_statistic_ab3.sql | 18 + .../unibag/membership_orders_ab1.sql | 1 - .../unibag/membership_orders_ab2.sql | 1 - .../unibag/membership_orders_ab3.sql | 1 - .../unibag/order_deliveries_ab1.sql | 12 +- .../unibag/order_deliveries_ab2.sql | 12 +- .../unibag/order_deliveries_ab3.sql | 12 +- .../unibag/order_deliveries_customer_ab1.sql | 20 + .../unibag/order_deliveries_customer_ab2.sql | 19 + .../unibag/order_deliveries_customer_ab3.sql | 19 + .../unibag/order_deliveries_delivery_ab1.sql | 30 + .../unibag/order_deliveries_delivery_ab2.sql | 29 + .../unibag/order_deliveries_delivery_ab3.sql | 29 + .../order_deliveries_delivery_feeship_ab1.sql | 21 + .../order_deliveries_delivery_feeship_ab2.sql | 20 + .../order_deliveries_delivery_feeship_ab3.sql | 20 + .../unibag/order_deliveries_location_ab1.sql | 23 + .../unibag/order_deliveries_location_ab2.sql | 22 + .../unibag/order_deliveries_location_ab3.sql | 22 + .../unibag/order_deliveries_promotion_ab1.sql | 21 + .../unibag/order_deliveries_promotion_ab2.sql | 20 + .../unibag/order_deliveries_promotion_ab3.sql | 20 + .../order_deliveries_trackingtime_ab1.sql | 20 + .../order_deliveries_trackingtime_ab2.sql | 19 + .../order_deliveries_trackingtime_ab3.sql | 19 + .../unibag/order_deliveries_weight_ab1.sql | 22 + .../unibag/order_deliveries_weight_ab2.sql | 21 + .../unibag/order_deliveries_weight_ab3.sql | 21 + .../unibag/order_histories_ab1.sql | 2 +- .../unibag/order_histories_ab2.sql | 2 +- .../unibag/order_histories_ab3.sql | 2 +- .../airbyte_ctes/unibag/order_items_ab1.sql | 17 +- .../airbyte_ctes/unibag/order_items_ab2.sql | 17 +- .../airbyte_ctes/unibag/order_items_ab3.sql | 17 +- .../unibag/order_items_price_ab1.sql | 29 + .../unibag/order_items_price_ab2.sql | 28 + .../unibag/order_items_price_ab3.sql | 28 + .../unibag/order_items_sku_ab1.sql | 25 + .../unibag/order_items_sku_ab2.sql | 24 + .../unibag/order_items_sku_ab3.sql | 24 + .../airbyte_ctes/unibag/orders_ab1.sql | 39 +- .../airbyte_ctes/unibag/orders_ab2.sql | 39 +- .../airbyte_ctes/unibag/orders_ab3.sql | 39 +- .../unibag/orders_delivery_ab1.sql | 40 ++ .../unibag/orders_delivery_ab2.sql | 39 ++ .../unibag/orders_delivery_ab3.sql | 39 ++ .../unibag/orders_delivery_feeship_ab1.sql | 21 + .../unibag/orders_delivery_feeship_ab2.sql | 20 + .../unibag/orders_delivery_feeship_ab3.sql | 20 + .../unibag/orders_delivery_location_ab1.sql | 23 + .../unibag/orders_delivery_location_ab2.sql | 22 + .../unibag/orders_delivery_location_ab3.sql | 22 + .../unibag/orders_delivery_weight_ab1.sql | 22 + .../unibag/orders_delivery_weight_ab2.sql | 21 + .../unibag/orders_delivery_weight_ab3.sql | 21 + .../unibag/orders_inventory_ab1.sql | 21 + .../unibag/orders_inventory_ab2.sql | 20 + .../unibag/orders_inventory_ab3.sql | 20 + .../unibag/orders_payment_ab1.sql | 20 + .../unibag/orders_payment_ab2.sql | 19 + .../unibag/orders_payment_ab3.sql | 19 + .../airbyte_ctes/unibag/orders_price_ab1.sql | 31 + .../airbyte_ctes/unibag/orders_price_ab2.sql | 30 + .../airbyte_ctes/unibag/orders_price_ab3.sql | 30 + .../unibag/orders_promotion_ab1.sql | 21 + .../unibag/orders_promotion_ab2.sql | 20 + .../unibag/orders_promotion_ab3.sql | 20 + .../unibag/orders_sendemail_ab1.sql | 18 + .../unibag/orders_sendemail_ab2.sql | 17 + .../unibag/orders_sendemail_ab3.sql | 17 + .../unibag/orders_supplier_ab1.sql | 20 + .../unibag/orders_supplier_ab2.sql | 19 + .../unibag/orders_supplier_ab3.sql | 19 + .../unibag/orders_useragent_ab1.sql | 20 + .../unibag/orders_useragent_ab2.sql | 19 + .../unibag/orders_useragent_ab3.sql | 19 + .../unibag/product_categories_ab1.sql | 3 +- .../unibag/product_categories_ab2.sql | 3 +- .../unibag/product_categories_ab3.sql | 3 +- .../unibag/product_categories_icon_ab1.sql | 20 + .../unibag/product_categories_icon_ab2.sql | 19 + .../unibag/product_categories_icon_ab3.sql | 19 + ...product_categories_icon_dimensions_ab1.sql | 19 + ...product_categories_icon_dimensions_ab2.sql | 18 + ...product_categories_icon_dimensions_ab3.sql | 18 + ...duct_categories_icon_dimensions_md_ab1.sql | 20 + ...duct_categories_icon_dimensions_md_ab2.sql | 19 + ...duct_categories_icon_dimensions_md_ab3.sql | 19 + ...duct_categories_icon_dimensions_sm_ab1.sql | 20 + ...duct_categories_icon_dimensions_sm_ab2.sql | 19 + ...duct_categories_icon_dimensions_sm_ab3.sql | 19 + .../product_categories_statistic_ab1.sql | 23 + .../product_categories_statistic_ab2.sql | 22 + .../product_categories_statistic_ab3.sql | 22 + .../airbyte_ctes/unibag/product_sku_ab1.sql | 13 +- .../airbyte_ctes/unibag/product_sku_ab2.sql | 13 +- .../airbyte_ctes/unibag/product_sku_ab3.sql | 13 +- .../unibag/product_sku_info_ab1.sql | 22 + .../unibag/product_sku_info_ab2.sql | 21 + .../unibag/product_sku_info_ab3.sql | 21 + .../unibag/product_sku_info_category_ab1.sql | 21 + .../unibag/product_sku_info_category_ab2.sql | 20 + .../unibag/product_sku_info_category_ab3.sql | 20 + ...ku_info_inv__ory_location_location_ab1.sql | 19 + ...ku_info_inv__ory_location_location_ab2.sql | 18 + ...ku_info_inv__ory_location_location_ab3.sql | 18 + .../unibag/product_sku_info_inventory_ab1.sql | 22 + .../unibag/product_sku_info_inventory_ab2.sql | 21 + .../unibag/product_sku_info_inventory_ab3.sql | 21 + ...roduct_sku_info_inventory_location_ab1.sql | 22 + ...roduct_sku_info_inventory_location_ab2.sql | 21 + ...roduct_sku_info_inventory_location_ab3.sql | 21 + .../unibag/product_sku_info_supplier_ab1.sql | 21 + .../unibag/product_sku_info_supplier_ab2.sql | 20 + .../unibag/product_sku_info_supplier_ab3.sql | 20 + .../unibag/product_sku_price_ab1.sql | 24 + .../unibag/product_sku_price_ab2.sql | 23 + .../unibag/product_sku_price_ab3.sql | 23 + .../unibag/product_sku_pricepercent_ab1.sql | 19 + .../unibag/product_sku_pricepercent_ab2.sql | 18 + .../unibag/product_sku_pricepercent_ab3.sql | 18 + .../unibag/product_sku_statistic_ab1.sql | 25 + .../unibag/product_sku_statistic_ab2.sql | 24 + .../unibag/product_sku_statistic_ab3.sql | 24 + .../unibag/product_sku_versions_ab1.sql | 6 +- .../unibag/product_sku_versions_ab2.sql | 6 +- .../unibag/product_sku_versions_ab3.sql | 6 +- .../unibag/product_sku_versions_info_ab1.sql | 22 + .../unibag/product_sku_versions_info_ab2.sql | 21 + .../unibag/product_sku_versions_info_ab3.sql | 21 + ...product_sku_versions_info_category_ab1.sql | 20 + ...product_sku_versions_info_category_ab2.sql | 19 + ...product_sku_versions_info_category_ab3.sql | 19 + ...roduct_sku_versions_info_inventory_ab1.sql | 21 + ...roduct_sku_versions_info_inventory_ab2.sql | 20 + ...roduct_sku_versions_info_inventory_ab3.sql | 20 + ...product_sku_versions_info_supplier_ab1.sql | 20 + ...product_sku_versions_info_supplier_ab2.sql | 19 + ...product_sku_versions_info_supplier_ab3.sql | 19 + .../unibag/product_sku_versions_price_ab1.sql | 22 + .../unibag/product_sku_versions_price_ab2.sql | 21 + .../unibag/product_sku_versions_price_ab3.sql | 21 + .../product_sku_versions_statistic_ab1.sql | 25 + .../product_sku_versions_statistic_ab2.sql | 24 + .../product_sku_versions_statistic_ab3.sql | 24 + .../airbyte_ctes/unibag/products_ab1.sql | 20 +- .../airbyte_ctes/unibag/products_ab2.sql | 20 +- .../airbyte_ctes/unibag/products_ab3.sql | 20 +- .../airbyte_ctes/unibag/products_info_ab1.sql | 21 + .../airbyte_ctes/unibag/products_info_ab2.sql | 20 + .../airbyte_ctes/unibag/products_info_ab3.sql | 20 + .../unibag/products_info_category_ab1.sql | 21 + .../unibag/products_info_category_ab2.sql | 20 + .../unibag/products_info_category_ab3.sql | 20 + .../unibag/products_info_inventory_ab1.sql | 22 + .../unibag/products_info_inventory_ab2.sql | 21 + .../unibag/products_info_inventory_ab3.sql | 21 + .../products_info_inventory_location_ab1.sql | 23 + .../products_info_inventory_location_ab2.sql | 22 + .../products_info_inventory_location_ab3.sql | 22 + ...s_info_inventory_location_location_ab1.sql | 19 + ...s_info_inventory_location_location_ab2.sql | 18 + ...s_info_inventory_location_location_ab3.sql | 18 + .../unibag/products_info_supplier_ab1.sql | 21 + .../unibag/products_info_supplier_ab2.sql | 20 + .../unibag/products_info_supplier_ab3.sql | 20 + .../unibag/products_order_ab1.sql | 22 + .../unibag/products_order_ab2.sql | 21 + .../unibag/products_order_ab3.sql | 21 + .../unibag/products_price_ab1.sql | 24 + .../unibag/products_price_ab2.sql | 23 + .../unibag/products_price_ab3.sql | 23 + .../unibag/products_pricepercent_ab1.sql | 24 + .../unibag/products_pricepercent_ab2.sql | 23 + .../unibag/products_pricepercent_ab3.sql | 23 + .../unibag/products_reviewstatistic_ab1.sql | 31 + .../unibag/products_reviewstatistic_ab2.sql | 30 + .../unibag/products_reviewstatistic_ab3.sql | 30 + .../unibag/products_score_ab1.sql | 21 + .../unibag/products_score_ab2.sql | 20 + .../unibag/products_score_ab3.sql | 20 + .../unibag/products_sharestatistic_ab1.sql | 22 + .../unibag/products_sharestatistic_ab2.sql | 21 + .../unibag/products_sharestatistic_ab3.sql | 21 + .../unibag/products_statistic_ab1.sql | 39 ++ .../unibag/products_statistic_ab2.sql | 38 ++ .../unibag/products_statistic_ab3.sql | 38 ++ .../unibag/promotion_orders_ab1.sql | 5 +- .../unibag/promotion_orders_ab2.sql | 5 +- .../unibag/promotion_orders_ab3.sql | 5 +- .../unibag/promotion_orders_supplier_ab1.sql | 20 + .../unibag/promotion_orders_supplier_ab2.sql | 19 + .../unibag/promotion_orders_supplier_ab3.sql | 19 + .../airbyte_ctes/unibag/promotions_ab1.sql | 13 +- .../airbyte_ctes/unibag/promotions_ab2.sql | 13 +- .../airbyte_ctes/unibag/promotions_ab3.sql | 13 +- .../unibag/promotions_applyfor_ab1.sql | 21 + .../unibag/promotions_applyfor_ab2.sql | 20 + .../unibag/promotions_applyfor_ab3.sql | 20 + .../promotions_conditionforuser_ab1.sql | 20 + .../promotions_conditionforuser_ab2.sql | 19 + .../promotions_conditionforuser_ab3.sql | 19 + .../unibag/promotions_options_ab1.sql | 21 + .../unibag/promotions_options_ab2.sql | 20 + .../unibag/promotions_options_ab3.sql | 20 + .../unibag/promotions_options_bonus_ab1.sql | 19 + .../unibag/promotions_options_bonus_ab2.sql | 18 + .../unibag/promotions_options_bonus_ab3.sql | 18 + .../unibag/promotions_statistic_ab1.sql | 30 + .../unibag/promotions_statistic_ab2.sql | 29 + .../unibag/promotions_statistic_ab3.sql | 29 + .../promotions_suppliercommission_ab1.sql | 19 + .../promotions_suppliercommission_ab2.sql | 18 + .../promotions_suppliercommission_ab3.sql | 18 + .../unibag/session_deliveries_ab1.sql | 31 + .../unibag/session_deliveries_ab2.sql | 31 + .../unibag/session_deliveries_ab3.sql | 31 + .../session_deliveries_customer_ab1.sql | 20 + .../session_deliveries_customer_ab2.sql | 19 + .../session_deliveries_customer_ab3.sql | 19 + .../session_deliveries_delivery_ab1.sql | 33 + .../session_deliveries_delivery_ab2.sql | 32 + .../session_deliveries_delivery_ab3.sql | 32 + ...ession_deliveries_delivery_feeship_ab1.sql | 21 + ...ession_deliveries_delivery_feeship_ab2.sql | 20 + ...ession_deliveries_delivery_feeship_ab3.sql | 20 + .../session_deliveries_location_ab1.sql | 23 + .../session_deliveries_location_ab2.sql | 22 + .../session_deliveries_location_ab3.sql | 22 + .../session_deliveries_promotion_ab1.sql | 21 + .../session_deliveries_promotion_ab2.sql | 20 + .../session_deliveries_promotion_ab3.sql | 20 + .../unibag/session_deliveries_request_ab1.sql | 27 + .../unibag/session_deliveries_request_ab2.sql | 26 + .../unibag/session_deliveries_request_ab3.sql | 26 + .../session_deliveries_request_from_ab1.sql | 19 + .../session_deliveries_request_from_ab2.sql | 18 + .../session_deliveries_request_from_ab3.sql | 18 + .../session_deliveries_request_to_ab1.sql | 20 + .../session_deliveries_request_to_ab2.sql | 19 + .../session_deliveries_request_to_ab3.sql | 19 + ...ion_deliveries_request_to_location_ab1.sql | 21 + ...ion_deliveries_request_to_location_ab2.sql | 20 + ...ion_deliveries_request_to_location_ab3.sql | 20 + .../airbyte_ctes/unibag/social_posts_ab1.sql | 4 +- .../airbyte_ctes/unibag/social_posts_ab2.sql | 4 +- .../airbyte_ctes/unibag/social_posts_ab3.sql | 4 +- .../social_posts_sharestatistic_ab1.sql | 22 + .../social_posts_sharestatistic_ab2.sql | 21 + .../social_posts_sharestatistic_ab3.sql | 21 + .../unibag/social_posts_statistic_ab1.sql | 23 + .../unibag/social_posts_statistic_ab2.sql | 22 + .../unibag/social_posts_statistic_ab3.sql | 22 + .../airbyte_ctes/unibag/suppliers_ab1.sql | 12 +- .../airbyte_ctes/unibag/suppliers_ab2.sql | 12 +- .../airbyte_ctes/unibag/suppliers_ab3.sql | 12 +- .../unibag/suppliers_balance_ab1.sql | 26 + .../unibag/suppliers_balance_ab2.sql | 25 + .../unibag/suppliers_balance_ab3.sql | 25 + .../unibag/suppliers_bank_ab1.sql | 21 + .../unibag/suppliers_bank_ab2.sql | 20 + .../unibag/suppliers_bank_ab3.sql | 20 + .../unibag/suppliers_location_ab1.sql | 23 + .../unibag/suppliers_location_ab2.sql | 22 + .../unibag/suppliers_location_ab3.sql | 22 + .../unibag/suppliers_logo_ab1.sql | 20 + .../unibag/suppliers_logo_ab2.sql | 19 + .../unibag/suppliers_logo_ab3.sql | 19 + .../unibag/suppliers_logo_dimensions_ab1.sql | 19 + .../unibag/suppliers_logo_dimensions_ab2.sql | 18 + .../unibag/suppliers_logo_dimensions_ab3.sql | 18 + .../suppliers_logo_dimensions_md_ab1.sql | 20 + .../suppliers_logo_dimensions_md_ab2.sql | 19 + .../suppliers_logo_dimensions_md_ab3.sql | 19 + .../suppliers_logo_dimensions_sm_ab1.sql | 20 + .../suppliers_logo_dimensions_sm_ab2.sql | 19 + .../suppliers_logo_dimensions_sm_ab3.sql | 19 + .../unibag/suppliers_reviewstatistic_ab1.sql | 31 + .../unibag/suppliers_reviewstatistic_ab2.sql | 30 + .../unibag/suppliers_reviewstatistic_ab3.sql | 30 + .../unibag/suppliers_statistic_ab1.sql | 29 + .../unibag/suppliers_statistic_ab2.sql | 28 + .../unibag/suppliers_statistic_ab3.sql | 28 + .../unibag/team_activities_ab1.sql | 2 +- .../unibag/team_activities_ab2.sql | 2 +- .../unibag/team_activities_ab3.sql | 2 +- .../unibag/team_activities_options_ab1.sql | 19 + .../unibag/team_activities_options_ab2.sql | 18 + .../unibag/team_activities_options_ab3.sql | 18 + .../airbyte_ctes/unibag/team_members_ab1.sql | 5 +- .../airbyte_ctes/unibag/team_members_ab2.sql | 5 +- .../airbyte_ctes/unibag/team_members_ab3.sql | 5 +- .../unibag/team_members_statistic_ab1.sql | 37 ++ .../unibag/team_members_statistic_ab2.sql | 36 ++ .../unibag/team_members_statistic_ab3.sql | 36 ++ .../team_members_statisticmonth_ab1.sql | 35 + .../team_members_statisticmonth_ab2.sql | 34 + .../team_members_statisticmonth_ab3.sql | 34 + .../airbyte_ctes/unibag/teams_ab1.sql | 9 +- .../airbyte_ctes/unibag/teams_ab2.sql | 9 +- .../airbyte_ctes/unibag/teams_ab3.sql | 9 +- .../unibag/teams_information_ab1.sql | 18 + .../unibag/teams_information_ab2.sql | 17 + .../unibag/teams_information_ab3.sql | 17 + .../airbyte_ctes/unibag/teams_level_ab1.sql | 27 + .../airbyte_ctes/unibag/teams_level_ab2.sql | 26 + .../airbyte_ctes/unibag/teams_level_ab3.sql | 26 + .../airbyte_ctes/unibag/teams_logo_ab1.sql | 20 + .../airbyte_ctes/unibag/teams_logo_ab2.sql | 19 + .../airbyte_ctes/unibag/teams_logo_ab3.sql | 19 + .../unibag/teams_logo_dimensions_ab1.sql | 19 + .../unibag/teams_logo_dimensions_ab2.sql | 18 + .../unibag/teams_logo_dimensions_ab3.sql | 18 + .../unibag/teams_logo_dimensions_md_ab1.sql | 20 + .../unibag/teams_logo_dimensions_md_ab2.sql | 19 + .../unibag/teams_logo_dimensions_md_ab3.sql | 19 + .../unibag/teams_logo_dimensions_sm_ab1.sql | 20 + .../unibag/teams_logo_dimensions_sm_ab2.sql | 19 + .../unibag/teams_logo_dimensions_sm_ab3.sql | 19 + .../unibag/teams_statistic_ab1.sql | 41 ++ .../unibag/teams_statistic_ab2.sql | 40 ++ .../unibag/teams_statistic_ab3.sql | 40 ++ ...tifications__ation_addressentities_ab1.sql | 21 + ...tifications__ation_addressentities_ab2.sql | 20 + ...tifications__ation_addressentities_ab3.sql | 20 + ...tifications__ontside_dimensions_md_ab1.sql | 20 + ...tifications__ontside_dimensions_md_ab2.sql | 19 + ...tifications__ontside_dimensions_md_ab3.sql | 19 + ...tifications__ontside_dimensions_sm_ab1.sql | 20 + ...tifications__ontside_dimensions_sm_ab2.sql | 19 + ...tifications__ontside_dimensions_sm_ab3.sql | 19 + .../unibag/user_identifications_ab1.sql | 7 +- .../unibag/user_identifications_ab2.sql | 7 +- .../unibag/user_identifications_ab3.sql | 7 +- .../user_identifications_backside_ab1.sql | 20 + .../user_identifications_backside_ab2.sql | 19 + .../user_identifications_backside_ab3.sql | 19 + ...dentifications_backside_dimensions_ab1.sql | 19 + ...dentifications_backside_dimensions_ab2.sql | 18 + ...dentifications_backside_dimensions_ab3.sql | 18 + ...tifications_backside_dimensions_md_ab1.sql | 20 + ...tifications_backside_dimensions_md_ab2.sql | 19 + ...tifications_backside_dimensions_md_ab3.sql | 19 + ...tifications_backside_dimensions_sm_ab1.sql | 20 + ...tifications_backside_dimensions_sm_ab2.sql | 19 + ...tifications_backside_dimensions_sm_ab3.sql | 19 + ..._identifications_detectinformation_ab1.sql | 37 ++ ..._identifications_detectinformation_ab2.sql | 36 ++ ..._identifications_detectinformation_ab3.sql | 36 ++ .../user_identifications_frontside_ab1.sql | 20 + .../user_identifications_frontside_ab2.sql | 19 + .../user_identifications_frontside_ab3.sql | 19 + ...entifications_frontside_dimensions_ab1.sql | 19 + ...entifications_frontside_dimensions_ab2.sql | 18 + ...entifications_frontside_dimensions_ab3.sql | 18 + .../airbyte_ctes/unibag/users_ab1.sql | 25 +- .../airbyte_ctes/unibag/users_ab2.sql | 25 +- .../airbyte_ctes/unibag/users_ab3.sql | 25 +- .../airbyte_ctes/unibag/users_avatar_ab1.sql | 20 + .../airbyte_ctes/unibag/users_avatar_ab2.sql | 19 + .../airbyte_ctes/unibag/users_avatar_ab3.sql | 19 + .../unibag/users_avatar_dimensions_ab1.sql | 19 + .../unibag/users_avatar_dimensions_ab2.sql | 18 + .../unibag/users_avatar_dimensions_ab3.sql | 18 + .../unibag/users_avatar_dimensions_md_ab1.sql | 20 + .../unibag/users_avatar_dimensions_md_ab2.sql | 19 + .../unibag/users_avatar_dimensions_md_ab3.sql | 19 + .../unibag/users_avatar_dimensions_sm_ab1.sql | 20 + .../unibag/users_avatar_dimensions_sm_ab2.sql | 19 + .../unibag/users_avatar_dimensions_sm_ab3.sql | 19 + .../airbyte_ctes/unibag/users_email_ab1.sql | 20 + .../airbyte_ctes/unibag/users_email_ab2.sql | 19 + .../airbyte_ctes/unibag/users_email_ab3.sql | 19 + .../unibag/users_facebook_ab1.sql | 23 + .../unibag/users_facebook_ab2.sql | 22 + .../unibag/users_facebook_ab3.sql | 22 + .../unibag/users_identification_ab1.sql | 22 + .../unibag/users_identification_ab2.sql | 21 + .../unibag/users_identification_ab3.sql | 21 + .../airbyte_ctes/unibag/users_info_ab1.sql | 20 + .../airbyte_ctes/unibag/users_info_ab2.sql | 19 + .../airbyte_ctes/unibag/users_info_ab3.sql | 19 + .../unibag/users_membership_ab1.sql | 22 + .../unibag/users_membership_ab2.sql | 21 + .../unibag/users_membership_ab3.sql | 21 + .../airbyte_ctes/unibag/users_phone_ab1.sql | 22 + .../airbyte_ctes/unibag/users_phone_ab2.sql | 21 + .../airbyte_ctes/unibag/users_phone_ab3.sql | 21 + .../unibag/users_referral_ab1.sql | 21 + .../unibag/users_referral_ab2.sql | 20 + .../unibag/users_referral_ab3.sql | 20 + .../unibag/users_statistic_ab1.sql | 73 +++ .../unibag/users_statistic_ab2.sql | 72 +++ .../unibag/users_statistic_ab3.sql | 72 +++ .../airbyte_ctes/unibag/users_team_ab1.sql | 20 + .../airbyte_ctes/unibag/users_team_ab2.sql | 19 + .../airbyte_ctes/unibag/users_team_ab3.sql | 19 + .../airbyte_ctes/unibag/users_zalo_ab1.sql | 21 + .../airbyte_ctes/unibag/users_zalo_ab2.sql | 20 + .../airbyte_ctes/unibag/users_zalo_ab3.sql | 20 + .../airbyte_ctes/unibag/vouchers_ab1.sql | 6 +- .../airbyte_ctes/unibag/vouchers_ab2.sql | 6 +- .../airbyte_ctes/unibag/vouchers_ab3.sql | 6 +- .../unibag/vouchers_applyfor_ab1.sql | 21 + .../unibag/vouchers_applyfor_ab2.sql | 20 + .../unibag/vouchers_applyfor_ab3.sql | 20 + .../airbyte_ctes/unibag/vouchers_logo_ab1.sql | 20 + .../airbyte_ctes/unibag/vouchers_logo_ab2.sql | 19 + .../airbyte_ctes/unibag/vouchers_logo_ab3.sql | 19 + .../unibag/vouchers_logo_dimensions_ab1.sql | 19 + .../unibag/vouchers_logo_dimensions_ab2.sql | 18 + .../unibag/vouchers_logo_dimensions_ab3.sql | 18 + .../vouchers_logo_dimensions_md_ab1.sql | 20 + .../vouchers_logo_dimensions_md_ab2.sql | 19 + .../vouchers_logo_dimensions_md_ab3.sql | 19 + .../vouchers_logo_dimensions_sm_ab1.sql | 20 + .../vouchers_logo_dimensions_sm_ab2.sql | 19 + .../vouchers_logo_dimensions_sm_ab3.sql | 19 + .../unibag/vouchers_options_ab1.sql | 20 + .../unibag/vouchers_options_ab2.sql | 19 + .../unibag/vouchers_options_ab3.sql | 19 + .../unibag/vouchers_options_bonus_ab1.sql | 19 + .../unibag/vouchers_options_bonus_ab2.sql | 18 + .../unibag/vouchers_options_bonus_ab3.sql | 18 + .../unibag/cash_flows_options.sql | 22 + .../airbyte_tables/unibag/customers_info.sql | 22 + .../unibag/customers_statistic.sql | 22 + .../unibag/event_rewards_options.sql | 23 + .../airbyte_tables/unibag/events_cover.sql | 20 + .../unibag/events_cover_dimensions.sql | 19 + .../unibag/events_cover_dimensions_md.sql | 20 + .../unibag/events_cover_dimensions_sm.sql | 20 + .../airbyte_tables/unibag/events_icon.sql | 20 + .../unibag/events_icon_dimensions.sql | 19 + .../unibag/events_icon_dimensions_md.sql | 20 + .../unibag/events_icon_dimensions_sm.sql | 20 + .../airbyte_tables/unibag/events_notice.sql | 19 + .../airbyte_tables/unibag/events_options.sql | 23 + .../airbyte_tables/unibag/events_segments.sql | 21 + .../events_segments_highestmonthlysales.sql | 20 + .../unibag/events_segments_lastmonthsales.sql | 20 + .../unibag/inventories_contact.sql | 21 + .../unibag/inventories_location.sql | 22 + .../unibag/inventories_location_location.sql | 19 + .../unibag/inventories_partner.sql | 19 + .../unibag/inventories_paymentmethods.sql | 19 + .../unibag/inventories_supplier.sql | 20 + .../unibag/membership_histories_new.sql | 24 + .../membership_histories_new_condition.sql | 22 + .../unibag/membership_histories_old.sql | 24 + .../membership_histories_old_condition.sql | 22 + .../membership_histories_old_statistic.sql | 19 + .../unibag/order_deliveries_customer.sql | 20 + .../unibag/order_deliveries_delivery.sql | 30 + .../order_deliveries_delivery_feeship.sql | 21 + .../unibag/order_deliveries_location.sql | 23 + .../unibag/order_deliveries_promotion.sql | 21 + .../unibag/order_deliveries_trackingtime.sql | 20 + .../unibag/order_deliveries_weight.sql | 22 + .../unibag/order_items_price.sql | 29 + .../airbyte_tables/unibag/order_items_sku.sql | 25 + .../airbyte_tables/unibag/orders_delivery.sql | 40 ++ .../unibag/orders_delivery_feeship.sql | 21 + .../unibag/orders_delivery_location.sql | 23 + .../unibag/orders_delivery_weight.sql | 22 + .../unibag/orders_inventory.sql | 21 + .../airbyte_tables/unibag/orders_payment.sql | 20 + .../airbyte_tables/unibag/orders_price.sql | 31 + .../unibag/orders_promotion.sql | 21 + .../unibag/orders_sendemail.sql | 18 + .../airbyte_tables/unibag/orders_supplier.sql | 20 + .../unibag/orders_useragent.sql | 20 + .../unibag/product_categories_icon.sql | 20 + .../product_categories_icon_dimensions.sql | 19 + .../product_categories_icon_dimensions_md.sql | 20 + .../product_categories_icon_dimensions_sm.sql | 20 + .../unibag/product_categories_statistic.sql | 23 + .../airbyte_tables/unibag/product_sku.sql | 1 + .../unibag/product_sku_info.sql | 22 + .../unibag/product_sku_info_category.sql | 21 + ...ct_sku_info_inv__ory_location_location.sql | 19 + .../unibag/product_sku_info_inventory.sql | 22 + .../product_sku_info_inventory_location.sql | 22 + .../unibag/product_sku_info_supplier.sql | 21 + .../unibag/product_sku_price.sql | 24 + .../unibag/product_sku_pricepercent.sql | 19 + .../unibag/product_sku_statistic.sql | 25 + .../unibag/product_sku_versions_info.sql | 22 + .../product_sku_versions_info_category.sql | 20 + .../product_sku_versions_info_inventory.sql | 21 + .../product_sku_versions_info_supplier.sql | 20 + .../unibag/product_sku_versions_price.sql | 22 + .../unibag/product_sku_versions_statistic.sql | 25 + .../airbyte_tables/unibag/products_info.sql | 21 + .../unibag/products_info_category.sql | 21 + .../unibag/products_info_inventory.sql | 22 + .../products_info_inventory_location.sql | 23 + ...ducts_info_inventory_location_location.sql | 19 + .../unibag/products_info_supplier.sql | 21 + .../airbyte_tables/unibag/products_order.sql | 22 + .../airbyte_tables/unibag/products_price.sql | 24 + .../unibag/products_pricepercent.sql | 24 + .../unibag/products_reviewstatistic.sql | 31 + .../airbyte_tables/unibag/products_score.sql | 21 + .../unibag/products_sharestatistic.sql | 22 + .../unibag/products_statistic.sql | 39 ++ .../unibag/promotion_orders_supplier.sql | 20 + .../unibag/promotions_applyfor.sql | 21 + .../unibag/promotions_conditionforuser.sql | 20 + .../unibag/promotions_options.sql | 21 + .../unibag/promotions_options_bonus.sql | 19 + .../unibag/promotions_statistic.sql | 30 + .../unibag/promotions_suppliercommission.sql | 19 + .../unibag/session_deliveries.sql | 34 + .../unibag/session_deliveries_customer.sql | 20 + .../unibag/session_deliveries_delivery.sql | 33 + .../session_deliveries_delivery_feeship.sql | 21 + .../unibag/session_deliveries_location.sql | 23 + .../unibag/session_deliveries_promotion.sql | 21 + .../unibag/session_deliveries_request.sql | 27 + .../session_deliveries_request_from.sql | 19 + .../unibag/session_deliveries_request_to.sql | 20 + ...session_deliveries_request_to_location.sql | 21 + .../unibag/social_posts_sharestatistic.sql | 22 + .../unibag/social_posts_statistic.sql | 23 + .../unibag/suppliers_balance.sql | 26 + .../airbyte_tables/unibag/suppliers_bank.sql | 21 + .../unibag/suppliers_location.sql | 23 + .../airbyte_tables/unibag/suppliers_logo.sql | 20 + .../unibag/suppliers_logo_dimensions.sql | 19 + .../unibag/suppliers_logo_dimensions_md.sql | 20 + .../unibag/suppliers_logo_dimensions_sm.sql | 20 + .../unibag/suppliers_reviewstatistic.sql | 31 + .../unibag/suppliers_statistic.sql | 29 + .../unibag/team_activities_options.sql | 19 + .../unibag/team_members_statistic.sql | 37 ++ .../unibag/team_members_statisticmonth.sql | 35 + .../unibag/teams_information.sql | 18 + .../airbyte_tables/unibag/teams_level.sql | 27 + .../airbyte_tables/unibag/teams_logo.sql | 20 + .../unibag/teams_logo_dimensions.sql | 19 + .../unibag/teams_logo_dimensions_md.sql | 20 + .../unibag/teams_logo_dimensions_sm.sql | 20 + .../airbyte_tables/unibag/teams_statistic.sql | 41 ++ ...identifications__ation_addressentities.sql | 21 + ...identifications__ontside_dimensions_md.sql | 20 + ...identifications__ontside_dimensions_sm.sql | 20 + .../unibag/user_identifications_backside.sql | 20 + ...er_identifications_backside_dimensions.sql | 19 + ...identifications_backside_dimensions_md.sql | 20 + ...identifications_backside_dimensions_sm.sql | 20 + ...user_identifications_detectinformation.sql | 37 ++ .../unibag/user_identifications_frontside.sql | 20 + ...r_identifications_frontside_dimensions.sql | 19 + .../airbyte_tables/unibag/users_avatar.sql | 20 + .../unibag/users_avatar_dimensions.sql | 19 + .../unibag/users_avatar_dimensions_md.sql | 20 + .../unibag/users_avatar_dimensions_sm.sql | 20 + .../airbyte_tables/unibag/users_email.sql | 20 + .../airbyte_tables/unibag/users_facebook.sql | 23 + .../unibag/users_identification.sql | 22 + .../airbyte_tables/unibag/users_info.sql | 20 + .../unibag/users_membership.sql | 22 + .../airbyte_tables/unibag/users_phone.sql | 22 + .../airbyte_tables/unibag/users_referral.sql | 21 + .../airbyte_tables/unibag/users_statistic.sql | 73 +++ .../airbyte_tables/unibag/users_team.sql | 20 + .../airbyte_tables/unibag/users_zalo.sql | 21 + .../unibag/vouchers_applyfor.sql | 21 + .../airbyte_tables/unibag/vouchers_logo.sql | 20 + .../unibag/vouchers_logo_dimensions.sql | 19 + .../unibag/vouchers_logo_dimensions_md.sql | 20 + .../unibag/vouchers_logo_dimensions_sm.sql | 20 + .../unibag/vouchers_options.sql | 20 + .../unibag/vouchers_options_bonus.sql | 19 + models/generated/sources.yml | 1 + 684 files changed, 14162 insertions(+), 395 deletions(-) create mode 100644 models/generated/airbyte_ctes/unibag/cash_flows_options_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/cash_flows_options_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/cash_flows_options_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/customers_info_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/customers_info_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/customers_info_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/customers_statistic_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/customers_statistic_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/customers_statistic_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/event_rewards_options_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/event_rewards_options_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/event_rewards_options_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/events_cover_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/events_cover_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/events_cover_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/events_cover_dimensions_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/events_cover_dimensions_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/events_cover_dimensions_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/events_cover_dimensions_md_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/events_cover_dimensions_md_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/events_cover_dimensions_md_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/events_cover_dimensions_sm_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/events_cover_dimensions_sm_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/events_cover_dimensions_sm_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/events_icon_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/events_icon_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/events_icon_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/events_icon_dimensions_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/events_icon_dimensions_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/events_icon_dimensions_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/events_icon_dimensions_md_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/events_icon_dimensions_md_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/events_icon_dimensions_md_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/events_icon_dimensions_sm_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/events_icon_dimensions_sm_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/events_icon_dimensions_sm_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/events_notice_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/events_notice_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/events_notice_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/events_options_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/events_options_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/events_options_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/events_segments_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/events_segments_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/events_segments_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/events_segments_highestmonthlysales_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/events_segments_highestmonthlysales_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/events_segments_highestmonthlysales_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/events_segments_lastmonthsales_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/events_segments_lastmonthsales_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/events_segments_lastmonthsales_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/inventories_contact_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/inventories_contact_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/inventories_contact_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/inventories_location_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/inventories_location_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/inventories_location_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/inventories_location_location_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/inventories_location_location_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/inventories_location_location_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/inventories_partner_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/inventories_partner_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/inventories_partner_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/inventories_paymentmethods_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/inventories_paymentmethods_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/inventories_paymentmethods_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/inventories_supplier_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/inventories_supplier_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/inventories_supplier_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/membership_histories_new_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/membership_histories_new_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/membership_histories_new_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/membership_histories_new_condition_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/membership_histories_new_condition_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/membership_histories_new_condition_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/membership_histories_old_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/membership_histories_old_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/membership_histories_old_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/membership_histories_old_condition_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/membership_histories_old_condition_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/membership_histories_old_condition_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/membership_histories_old_statistic_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/membership_histories_old_statistic_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/membership_histories_old_statistic_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/order_deliveries_customer_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/order_deliveries_customer_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/order_deliveries_customer_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/order_deliveries_delivery_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/order_deliveries_delivery_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/order_deliveries_delivery_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/order_deliveries_delivery_feeship_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/order_deliveries_delivery_feeship_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/order_deliveries_delivery_feeship_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/order_deliveries_location_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/order_deliveries_location_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/order_deliveries_location_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/order_deliveries_promotion_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/order_deliveries_promotion_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/order_deliveries_promotion_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/order_deliveries_trackingtime_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/order_deliveries_trackingtime_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/order_deliveries_trackingtime_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/order_deliveries_weight_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/order_deliveries_weight_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/order_deliveries_weight_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/order_items_price_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/order_items_price_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/order_items_price_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/order_items_sku_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/order_items_sku_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/order_items_sku_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/orders_delivery_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/orders_delivery_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/orders_delivery_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/orders_delivery_feeship_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/orders_delivery_feeship_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/orders_delivery_feeship_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/orders_delivery_location_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/orders_delivery_location_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/orders_delivery_location_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/orders_delivery_weight_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/orders_delivery_weight_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/orders_delivery_weight_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/orders_inventory_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/orders_inventory_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/orders_inventory_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/orders_payment_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/orders_payment_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/orders_payment_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/orders_price_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/orders_price_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/orders_price_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/orders_promotion_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/orders_promotion_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/orders_promotion_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/orders_sendemail_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/orders_sendemail_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/orders_sendemail_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/orders_supplier_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/orders_supplier_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/orders_supplier_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/orders_useragent_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/orders_useragent_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/orders_useragent_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_categories_icon_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_categories_icon_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_categories_icon_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_categories_icon_dimensions_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_categories_icon_dimensions_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_categories_icon_dimensions_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_categories_icon_dimensions_md_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_categories_icon_dimensions_md_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_categories_icon_dimensions_md_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_categories_icon_dimensions_sm_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_categories_icon_dimensions_sm_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_categories_icon_dimensions_sm_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_categories_statistic_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_categories_statistic_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_categories_statistic_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_sku_info_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_sku_info_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_sku_info_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_sku_info_category_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_sku_info_category_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_sku_info_category_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_sku_info_inv__ory_location_location_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_sku_info_inv__ory_location_location_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_sku_info_inv__ory_location_location_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_sku_info_inventory_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_sku_info_inventory_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_sku_info_inventory_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_sku_info_inventory_location_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_sku_info_inventory_location_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_sku_info_inventory_location_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_sku_info_supplier_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_sku_info_supplier_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_sku_info_supplier_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_sku_price_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_sku_price_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_sku_price_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_sku_pricepercent_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_sku_pricepercent_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_sku_pricepercent_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_sku_statistic_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_sku_statistic_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_sku_statistic_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_sku_versions_info_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_sku_versions_info_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_sku_versions_info_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_sku_versions_info_category_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_sku_versions_info_category_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_sku_versions_info_category_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_sku_versions_info_inventory_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_sku_versions_info_inventory_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_sku_versions_info_inventory_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_sku_versions_info_supplier_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_sku_versions_info_supplier_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_sku_versions_info_supplier_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_sku_versions_price_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_sku_versions_price_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_sku_versions_price_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_sku_versions_statistic_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_sku_versions_statistic_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/product_sku_versions_statistic_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/products_info_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/products_info_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/products_info_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/products_info_category_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/products_info_category_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/products_info_category_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/products_info_inventory_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/products_info_inventory_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/products_info_inventory_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/products_info_inventory_location_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/products_info_inventory_location_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/products_info_inventory_location_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/products_info_inventory_location_location_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/products_info_inventory_location_location_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/products_info_inventory_location_location_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/products_info_supplier_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/products_info_supplier_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/products_info_supplier_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/products_order_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/products_order_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/products_order_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/products_price_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/products_price_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/products_price_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/products_pricepercent_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/products_pricepercent_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/products_pricepercent_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/products_reviewstatistic_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/products_reviewstatistic_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/products_reviewstatistic_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/products_score_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/products_score_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/products_score_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/products_sharestatistic_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/products_sharestatistic_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/products_sharestatistic_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/products_statistic_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/products_statistic_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/products_statistic_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/promotion_orders_supplier_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/promotion_orders_supplier_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/promotion_orders_supplier_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/promotions_applyfor_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/promotions_applyfor_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/promotions_applyfor_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/promotions_conditionforuser_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/promotions_conditionforuser_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/promotions_conditionforuser_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/promotions_options_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/promotions_options_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/promotions_options_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/promotions_options_bonus_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/promotions_options_bonus_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/promotions_options_bonus_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/promotions_statistic_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/promotions_statistic_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/promotions_statistic_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/promotions_suppliercommission_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/promotions_suppliercommission_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/promotions_suppliercommission_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/session_deliveries_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/session_deliveries_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/session_deliveries_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/session_deliveries_customer_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/session_deliveries_customer_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/session_deliveries_customer_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/session_deliveries_delivery_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/session_deliveries_delivery_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/session_deliveries_delivery_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/session_deliveries_delivery_feeship_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/session_deliveries_delivery_feeship_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/session_deliveries_delivery_feeship_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/session_deliveries_location_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/session_deliveries_location_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/session_deliveries_location_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/session_deliveries_promotion_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/session_deliveries_promotion_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/session_deliveries_promotion_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/session_deliveries_request_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/session_deliveries_request_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/session_deliveries_request_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/session_deliveries_request_from_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/session_deliveries_request_from_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/session_deliveries_request_from_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/session_deliveries_request_to_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/session_deliveries_request_to_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/session_deliveries_request_to_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/session_deliveries_request_to_location_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/session_deliveries_request_to_location_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/session_deliveries_request_to_location_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/social_posts_sharestatistic_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/social_posts_sharestatistic_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/social_posts_sharestatistic_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/social_posts_statistic_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/social_posts_statistic_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/social_posts_statistic_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/suppliers_balance_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/suppliers_balance_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/suppliers_balance_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/suppliers_bank_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/suppliers_bank_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/suppliers_bank_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/suppliers_location_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/suppliers_location_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/suppliers_location_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/suppliers_logo_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/suppliers_logo_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/suppliers_logo_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/suppliers_logo_dimensions_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/suppliers_logo_dimensions_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/suppliers_logo_dimensions_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/suppliers_logo_dimensions_md_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/suppliers_logo_dimensions_md_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/suppliers_logo_dimensions_md_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/suppliers_logo_dimensions_sm_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/suppliers_logo_dimensions_sm_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/suppliers_logo_dimensions_sm_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/suppliers_reviewstatistic_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/suppliers_reviewstatistic_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/suppliers_reviewstatistic_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/suppliers_statistic_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/suppliers_statistic_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/suppliers_statistic_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/team_activities_options_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/team_activities_options_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/team_activities_options_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/team_members_statistic_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/team_members_statistic_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/team_members_statistic_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/team_members_statisticmonth_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/team_members_statisticmonth_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/team_members_statisticmonth_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/teams_information_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/teams_information_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/teams_information_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/teams_level_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/teams_level_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/teams_level_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/teams_logo_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/teams_logo_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/teams_logo_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/teams_logo_dimensions_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/teams_logo_dimensions_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/teams_logo_dimensions_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/teams_logo_dimensions_md_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/teams_logo_dimensions_md_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/teams_logo_dimensions_md_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/teams_logo_dimensions_sm_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/teams_logo_dimensions_sm_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/teams_logo_dimensions_sm_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/teams_statistic_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/teams_statistic_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/teams_statistic_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/user_identifications__ation_addressentities_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/user_identifications__ation_addressentities_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/user_identifications__ation_addressentities_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/user_identifications__ontside_dimensions_md_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/user_identifications__ontside_dimensions_md_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/user_identifications__ontside_dimensions_md_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/user_identifications__ontside_dimensions_sm_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/user_identifications__ontside_dimensions_sm_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/user_identifications__ontside_dimensions_sm_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/user_identifications_backside_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/user_identifications_backside_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/user_identifications_backside_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/user_identifications_backside_dimensions_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/user_identifications_backside_dimensions_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/user_identifications_backside_dimensions_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/user_identifications_backside_dimensions_md_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/user_identifications_backside_dimensions_md_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/user_identifications_backside_dimensions_md_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/user_identifications_backside_dimensions_sm_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/user_identifications_backside_dimensions_sm_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/user_identifications_backside_dimensions_sm_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/user_identifications_detectinformation_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/user_identifications_detectinformation_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/user_identifications_detectinformation_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/user_identifications_frontside_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/user_identifications_frontside_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/user_identifications_frontside_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/user_identifications_frontside_dimensions_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/user_identifications_frontside_dimensions_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/user_identifications_frontside_dimensions_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/users_avatar_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/users_avatar_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/users_avatar_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/users_avatar_dimensions_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/users_avatar_dimensions_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/users_avatar_dimensions_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/users_avatar_dimensions_md_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/users_avatar_dimensions_md_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/users_avatar_dimensions_md_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/users_avatar_dimensions_sm_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/users_avatar_dimensions_sm_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/users_avatar_dimensions_sm_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/users_email_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/users_email_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/users_email_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/users_facebook_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/users_facebook_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/users_facebook_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/users_identification_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/users_identification_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/users_identification_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/users_info_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/users_info_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/users_info_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/users_membership_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/users_membership_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/users_membership_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/users_phone_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/users_phone_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/users_phone_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/users_referral_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/users_referral_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/users_referral_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/users_statistic_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/users_statistic_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/users_statistic_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/users_team_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/users_team_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/users_team_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/users_zalo_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/users_zalo_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/users_zalo_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/vouchers_applyfor_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/vouchers_applyfor_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/vouchers_applyfor_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/vouchers_logo_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/vouchers_logo_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/vouchers_logo_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/vouchers_logo_dimensions_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/vouchers_logo_dimensions_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/vouchers_logo_dimensions_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/vouchers_logo_dimensions_md_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/vouchers_logo_dimensions_md_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/vouchers_logo_dimensions_md_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/vouchers_logo_dimensions_sm_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/vouchers_logo_dimensions_sm_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/vouchers_logo_dimensions_sm_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/vouchers_options_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/vouchers_options_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/vouchers_options_ab3.sql create mode 100644 models/generated/airbyte_ctes/unibag/vouchers_options_bonus_ab1.sql create mode 100644 models/generated/airbyte_ctes/unibag/vouchers_options_bonus_ab2.sql create mode 100644 models/generated/airbyte_ctes/unibag/vouchers_options_bonus_ab3.sql create mode 100644 models/generated/airbyte_tables/unibag/cash_flows_options.sql create mode 100644 models/generated/airbyte_tables/unibag/customers_info.sql create mode 100644 models/generated/airbyte_tables/unibag/customers_statistic.sql create mode 100644 models/generated/airbyte_tables/unibag/event_rewards_options.sql create mode 100644 models/generated/airbyte_tables/unibag/events_cover.sql create mode 100644 models/generated/airbyte_tables/unibag/events_cover_dimensions.sql create mode 100644 models/generated/airbyte_tables/unibag/events_cover_dimensions_md.sql create mode 100644 models/generated/airbyte_tables/unibag/events_cover_dimensions_sm.sql create mode 100644 models/generated/airbyte_tables/unibag/events_icon.sql create mode 100644 models/generated/airbyte_tables/unibag/events_icon_dimensions.sql create mode 100644 models/generated/airbyte_tables/unibag/events_icon_dimensions_md.sql create mode 100644 models/generated/airbyte_tables/unibag/events_icon_dimensions_sm.sql create mode 100644 models/generated/airbyte_tables/unibag/events_notice.sql create mode 100644 models/generated/airbyte_tables/unibag/events_options.sql create mode 100644 models/generated/airbyte_tables/unibag/events_segments.sql create mode 100644 models/generated/airbyte_tables/unibag/events_segments_highestmonthlysales.sql create mode 100644 models/generated/airbyte_tables/unibag/events_segments_lastmonthsales.sql create mode 100644 models/generated/airbyte_tables/unibag/inventories_contact.sql create mode 100644 models/generated/airbyte_tables/unibag/inventories_location.sql create mode 100644 models/generated/airbyte_tables/unibag/inventories_location_location.sql create mode 100644 models/generated/airbyte_tables/unibag/inventories_partner.sql create mode 100644 models/generated/airbyte_tables/unibag/inventories_paymentmethods.sql create mode 100644 models/generated/airbyte_tables/unibag/inventories_supplier.sql create mode 100644 models/generated/airbyte_tables/unibag/membership_histories_new.sql create mode 100644 models/generated/airbyte_tables/unibag/membership_histories_new_condition.sql create mode 100644 models/generated/airbyte_tables/unibag/membership_histories_old.sql create mode 100644 models/generated/airbyte_tables/unibag/membership_histories_old_condition.sql create mode 100644 models/generated/airbyte_tables/unibag/membership_histories_old_statistic.sql create mode 100644 models/generated/airbyte_tables/unibag/order_deliveries_customer.sql create mode 100644 models/generated/airbyte_tables/unibag/order_deliveries_delivery.sql create mode 100644 models/generated/airbyte_tables/unibag/order_deliveries_delivery_feeship.sql create mode 100644 models/generated/airbyte_tables/unibag/order_deliveries_location.sql create mode 100644 models/generated/airbyte_tables/unibag/order_deliveries_promotion.sql create mode 100644 models/generated/airbyte_tables/unibag/order_deliveries_trackingtime.sql create mode 100644 models/generated/airbyte_tables/unibag/order_deliveries_weight.sql create mode 100644 models/generated/airbyte_tables/unibag/order_items_price.sql create mode 100644 models/generated/airbyte_tables/unibag/order_items_sku.sql create mode 100644 models/generated/airbyte_tables/unibag/orders_delivery.sql create mode 100644 models/generated/airbyte_tables/unibag/orders_delivery_feeship.sql create mode 100644 models/generated/airbyte_tables/unibag/orders_delivery_location.sql create mode 100644 models/generated/airbyte_tables/unibag/orders_delivery_weight.sql create mode 100644 models/generated/airbyte_tables/unibag/orders_inventory.sql create mode 100644 models/generated/airbyte_tables/unibag/orders_payment.sql create mode 100644 models/generated/airbyte_tables/unibag/orders_price.sql create mode 100644 models/generated/airbyte_tables/unibag/orders_promotion.sql create mode 100644 models/generated/airbyte_tables/unibag/orders_sendemail.sql create mode 100644 models/generated/airbyte_tables/unibag/orders_supplier.sql create mode 100644 models/generated/airbyte_tables/unibag/orders_useragent.sql create mode 100644 models/generated/airbyte_tables/unibag/product_categories_icon.sql create mode 100644 models/generated/airbyte_tables/unibag/product_categories_icon_dimensions.sql create mode 100644 models/generated/airbyte_tables/unibag/product_categories_icon_dimensions_md.sql create mode 100644 models/generated/airbyte_tables/unibag/product_categories_icon_dimensions_sm.sql create mode 100644 models/generated/airbyte_tables/unibag/product_categories_statistic.sql create mode 100644 models/generated/airbyte_tables/unibag/product_sku_info.sql create mode 100644 models/generated/airbyte_tables/unibag/product_sku_info_category.sql create mode 100644 models/generated/airbyte_tables/unibag/product_sku_info_inv__ory_location_location.sql create mode 100644 models/generated/airbyte_tables/unibag/product_sku_info_inventory.sql create mode 100644 models/generated/airbyte_tables/unibag/product_sku_info_inventory_location.sql create mode 100644 models/generated/airbyte_tables/unibag/product_sku_info_supplier.sql create mode 100644 models/generated/airbyte_tables/unibag/product_sku_price.sql create mode 100644 models/generated/airbyte_tables/unibag/product_sku_pricepercent.sql create mode 100644 models/generated/airbyte_tables/unibag/product_sku_statistic.sql create mode 100644 models/generated/airbyte_tables/unibag/product_sku_versions_info.sql create mode 100644 models/generated/airbyte_tables/unibag/product_sku_versions_info_category.sql create mode 100644 models/generated/airbyte_tables/unibag/product_sku_versions_info_inventory.sql create mode 100644 models/generated/airbyte_tables/unibag/product_sku_versions_info_supplier.sql create mode 100644 models/generated/airbyte_tables/unibag/product_sku_versions_price.sql create mode 100644 models/generated/airbyte_tables/unibag/product_sku_versions_statistic.sql create mode 100644 models/generated/airbyte_tables/unibag/products_info.sql create mode 100644 models/generated/airbyte_tables/unibag/products_info_category.sql create mode 100644 models/generated/airbyte_tables/unibag/products_info_inventory.sql create mode 100644 models/generated/airbyte_tables/unibag/products_info_inventory_location.sql create mode 100644 models/generated/airbyte_tables/unibag/products_info_inventory_location_location.sql create mode 100644 models/generated/airbyte_tables/unibag/products_info_supplier.sql create mode 100644 models/generated/airbyte_tables/unibag/products_order.sql create mode 100644 models/generated/airbyte_tables/unibag/products_price.sql create mode 100644 models/generated/airbyte_tables/unibag/products_pricepercent.sql create mode 100644 models/generated/airbyte_tables/unibag/products_reviewstatistic.sql create mode 100644 models/generated/airbyte_tables/unibag/products_score.sql create mode 100644 models/generated/airbyte_tables/unibag/products_sharestatistic.sql create mode 100644 models/generated/airbyte_tables/unibag/products_statistic.sql create mode 100644 models/generated/airbyte_tables/unibag/promotion_orders_supplier.sql create mode 100644 models/generated/airbyte_tables/unibag/promotions_applyfor.sql create mode 100644 models/generated/airbyte_tables/unibag/promotions_conditionforuser.sql create mode 100644 models/generated/airbyte_tables/unibag/promotions_options.sql create mode 100644 models/generated/airbyte_tables/unibag/promotions_options_bonus.sql create mode 100644 models/generated/airbyte_tables/unibag/promotions_statistic.sql create mode 100644 models/generated/airbyte_tables/unibag/promotions_suppliercommission.sql create mode 100644 models/generated/airbyte_tables/unibag/session_deliveries.sql create mode 100644 models/generated/airbyte_tables/unibag/session_deliveries_customer.sql create mode 100644 models/generated/airbyte_tables/unibag/session_deliveries_delivery.sql create mode 100644 models/generated/airbyte_tables/unibag/session_deliveries_delivery_feeship.sql create mode 100644 models/generated/airbyte_tables/unibag/session_deliveries_location.sql create mode 100644 models/generated/airbyte_tables/unibag/session_deliveries_promotion.sql create mode 100644 models/generated/airbyte_tables/unibag/session_deliveries_request.sql create mode 100644 models/generated/airbyte_tables/unibag/session_deliveries_request_from.sql create mode 100644 models/generated/airbyte_tables/unibag/session_deliveries_request_to.sql create mode 100644 models/generated/airbyte_tables/unibag/session_deliveries_request_to_location.sql create mode 100644 models/generated/airbyte_tables/unibag/social_posts_sharestatistic.sql create mode 100644 models/generated/airbyte_tables/unibag/social_posts_statistic.sql create mode 100644 models/generated/airbyte_tables/unibag/suppliers_balance.sql create mode 100644 models/generated/airbyte_tables/unibag/suppliers_bank.sql create mode 100644 models/generated/airbyte_tables/unibag/suppliers_location.sql create mode 100644 models/generated/airbyte_tables/unibag/suppliers_logo.sql create mode 100644 models/generated/airbyte_tables/unibag/suppliers_logo_dimensions.sql create mode 100644 models/generated/airbyte_tables/unibag/suppliers_logo_dimensions_md.sql create mode 100644 models/generated/airbyte_tables/unibag/suppliers_logo_dimensions_sm.sql create mode 100644 models/generated/airbyte_tables/unibag/suppliers_reviewstatistic.sql create mode 100644 models/generated/airbyte_tables/unibag/suppliers_statistic.sql create mode 100644 models/generated/airbyte_tables/unibag/team_activities_options.sql create mode 100644 models/generated/airbyte_tables/unibag/team_members_statistic.sql create mode 100644 models/generated/airbyte_tables/unibag/team_members_statisticmonth.sql create mode 100644 models/generated/airbyte_tables/unibag/teams_information.sql create mode 100644 models/generated/airbyte_tables/unibag/teams_level.sql create mode 100644 models/generated/airbyte_tables/unibag/teams_logo.sql create mode 100644 models/generated/airbyte_tables/unibag/teams_logo_dimensions.sql create mode 100644 models/generated/airbyte_tables/unibag/teams_logo_dimensions_md.sql create mode 100644 models/generated/airbyte_tables/unibag/teams_logo_dimensions_sm.sql create mode 100644 models/generated/airbyte_tables/unibag/teams_statistic.sql create mode 100644 models/generated/airbyte_tables/unibag/user_identifications__ation_addressentities.sql create mode 100644 models/generated/airbyte_tables/unibag/user_identifications__ontside_dimensions_md.sql create mode 100644 models/generated/airbyte_tables/unibag/user_identifications__ontside_dimensions_sm.sql create mode 100644 models/generated/airbyte_tables/unibag/user_identifications_backside.sql create mode 100644 models/generated/airbyte_tables/unibag/user_identifications_backside_dimensions.sql create mode 100644 models/generated/airbyte_tables/unibag/user_identifications_backside_dimensions_md.sql create mode 100644 models/generated/airbyte_tables/unibag/user_identifications_backside_dimensions_sm.sql create mode 100644 models/generated/airbyte_tables/unibag/user_identifications_detectinformation.sql create mode 100644 models/generated/airbyte_tables/unibag/user_identifications_frontside.sql create mode 100644 models/generated/airbyte_tables/unibag/user_identifications_frontside_dimensions.sql create mode 100644 models/generated/airbyte_tables/unibag/users_avatar.sql create mode 100644 models/generated/airbyte_tables/unibag/users_avatar_dimensions.sql create mode 100644 models/generated/airbyte_tables/unibag/users_avatar_dimensions_md.sql create mode 100644 models/generated/airbyte_tables/unibag/users_avatar_dimensions_sm.sql create mode 100644 models/generated/airbyte_tables/unibag/users_email.sql create mode 100644 models/generated/airbyte_tables/unibag/users_facebook.sql create mode 100644 models/generated/airbyte_tables/unibag/users_identification.sql create mode 100644 models/generated/airbyte_tables/unibag/users_info.sql create mode 100644 models/generated/airbyte_tables/unibag/users_membership.sql create mode 100644 models/generated/airbyte_tables/unibag/users_phone.sql create mode 100644 models/generated/airbyte_tables/unibag/users_referral.sql create mode 100644 models/generated/airbyte_tables/unibag/users_statistic.sql create mode 100644 models/generated/airbyte_tables/unibag/users_team.sql create mode 100644 models/generated/airbyte_tables/unibag/users_zalo.sql create mode 100644 models/generated/airbyte_tables/unibag/vouchers_applyfor.sql create mode 100644 models/generated/airbyte_tables/unibag/vouchers_logo.sql create mode 100644 models/generated/airbyte_tables/unibag/vouchers_logo_dimensions.sql create mode 100644 models/generated/airbyte_tables/unibag/vouchers_logo_dimensions_md.sql create mode 100644 models/generated/airbyte_tables/unibag/vouchers_logo_dimensions_sm.sql create mode 100644 models/generated/airbyte_tables/unibag/vouchers_options.sql create mode 100644 models/generated/airbyte_tables/unibag/vouchers_options_bonus.sql diff --git a/Makefile b/Makefile index 01621ed..613db74 100644 --- a/Makefile +++ b/Makefile @@ -6,5 +6,5 @@ push: run: dbt deps --profiles-dir=. --project-dir=. #dbt run --profiles-dir=. --project-dir=. --full-refresh - dbt run --profiles-dir=. --project-dir=. --full-refresh --select tracking_product_shares + dbt run --profiles-dir=. --project-dir=. --full-refresh --select session_deliveries diff --git a/dbt_project.yml b/dbt_project.yml index f213b50..9e38a5b 100755 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -141,6 +141,10 @@ vars: referrals_ab2: unibag._airbyte_raw_referrals referrals_ab3: 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_ab2: 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_ab3: unibag._airbyte_raw_wards wards: unibag._airbyte_raw_wards + cash_flows_options_ab1: unibag._airbyte_raw_cash_flows + cash_flows_options_ab2: unibag._airbyte_raw_cash_flows + cash_flows_options_ab3: unibag._airbyte_raw_cash_flows + cash_flows_options: unibag._airbyte_raw_cash_flows + customers_info_ab1: unibag._airbyte_raw_customers + customers_info_ab2: unibag._airbyte_raw_customers + customers_info_ab3: unibag._airbyte_raw_customers + customers_info: unibag._airbyte_raw_customers + customers_statistic_ab1: unibag._airbyte_raw_customers + customers_statistic_ab2: unibag._airbyte_raw_customers + customers_statistic_ab3: unibag._airbyte_raw_customers + customers_statistic: unibag._airbyte_raw_customers + event_rewards_options_ab1: unibag._airbyte_raw_event_rewards + event_rewards_options_ab2: unibag._airbyte_raw_event_rewards + event_rewards_options_ab3: unibag._airbyte_raw_event_rewards + event_rewards_options: unibag._airbyte_raw_event_rewards + events_icon_ab1: unibag._airbyte_raw_events + events_icon_ab2: unibag._airbyte_raw_events + events_icon_ab3: unibag._airbyte_raw_events + events_icon: unibag._airbyte_raw_events + events_cover_ab1: unibag._airbyte_raw_events + events_cover_ab2: unibag._airbyte_raw_events + events_cover_ab3: unibag._airbyte_raw_events + events_cover: unibag._airbyte_raw_events + events_notice_ab1: unibag._airbyte_raw_events + events_notice_ab2: unibag._airbyte_raw_events + events_notice_ab3: unibag._airbyte_raw_events + events_notice: unibag._airbyte_raw_events + events_options_ab1: unibag._airbyte_raw_events + events_options_ab2: unibag._airbyte_raw_events + events_options_ab3: unibag._airbyte_raw_events + events_options: unibag._airbyte_raw_events + events_segments_ab1: unibag._airbyte_raw_events + events_segments_ab2: unibag._airbyte_raw_events + events_segments_ab3: unibag._airbyte_raw_events + events_segments: unibag._airbyte_raw_events + inventories_contact_ab1: unibag._airbyte_raw_inventories + inventories_contact_ab2: unibag._airbyte_raw_inventories + inventories_contact_ab3: unibag._airbyte_raw_inventories + inventories_contact: unibag._airbyte_raw_inventories + inventories_partner_ab1: unibag._airbyte_raw_inventories + inventories_partner_ab2: unibag._airbyte_raw_inventories + inventories_partner_ab3: unibag._airbyte_raw_inventories + inventories_partner: unibag._airbyte_raw_inventories + inventories_location_ab1: unibag._airbyte_raw_inventories + inventories_location_ab2: unibag._airbyte_raw_inventories + inventories_location_ab3: unibag._airbyte_raw_inventories + inventories_location: unibag._airbyte_raw_inventories + inventories_supplier_ab1: unibag._airbyte_raw_inventories + inventories_supplier_ab2: unibag._airbyte_raw_inventories + inventories_supplier_ab3: unibag._airbyte_raw_inventories + inventories_supplier: unibag._airbyte_raw_inventories + inventories_paymentmethods_ab1: unibag._airbyte_raw_inventories + inventories_paymentmethods_ab2: unibag._airbyte_raw_inventories + inventories_paymentmethods_ab3: unibag._airbyte_raw_inventories + inventories_paymentmethods: unibag._airbyte_raw_inventories + membership_histories_new_ab1: unibag._airbyte_raw_membership_histories + membership_histories_new_ab2: unibag._airbyte_raw_membership_histories + membership_histories_new_ab3: unibag._airbyte_raw_membership_histories + membership_histories_new: unibag._airbyte_raw_membership_histories + membership_histories_old_ab1: unibag._airbyte_raw_membership_histories + membership_histories_old_ab2: unibag._airbyte_raw_membership_histories + membership_histories_old_ab3: unibag._airbyte_raw_membership_histories + membership_histories_old: unibag._airbyte_raw_membership_histories + order_deliveries_weight_ab1: unibag._airbyte_raw_order_deliveries + order_deliveries_weight_ab2: unibag._airbyte_raw_order_deliveries + order_deliveries_weight_ab3: unibag._airbyte_raw_order_deliveries + order_deliveries_weight: unibag._airbyte_raw_order_deliveries + order_deliveries_customer_ab1: unibag._airbyte_raw_order_deliveries + order_deliveries_customer_ab2: unibag._airbyte_raw_order_deliveries + order_deliveries_customer_ab3: unibag._airbyte_raw_order_deliveries + order_deliveries_customer: unibag._airbyte_raw_order_deliveries + order_deliveries_delivery_ab1: unibag._airbyte_raw_order_deliveries + order_deliveries_delivery_ab2: unibag._airbyte_raw_order_deliveries + order_deliveries_delivery_ab3: unibag._airbyte_raw_order_deliveries + order_deliveries_delivery: unibag._airbyte_raw_order_deliveries + order_deliveries_location_ab1: unibag._airbyte_raw_order_deliveries + order_deliveries_location_ab2: unibag._airbyte_raw_order_deliveries + order_deliveries_location_ab3: unibag._airbyte_raw_order_deliveries + order_deliveries_location: unibag._airbyte_raw_order_deliveries + order_deliveries_promotion_ab1: unibag._airbyte_raw_order_deliveries + order_deliveries_promotion_ab2: unibag._airbyte_raw_order_deliveries + order_deliveries_promotion_ab3: unibag._airbyte_raw_order_deliveries + order_deliveries_promotion: unibag._airbyte_raw_order_deliveries + order_deliveries_trackingtime_ab1: unibag._airbyte_raw_order_deliveries + order_deliveries_trackingtime_ab2: unibag._airbyte_raw_order_deliveries + order_deliveries_trackingtime_ab3: unibag._airbyte_raw_order_deliveries + order_deliveries_trackingtime: unibag._airbyte_raw_order_deliveries + order_items_sku_ab1: unibag._airbyte_raw_order_items + order_items_sku_ab2: unibag._airbyte_raw_order_items + order_items_sku_ab3: unibag._airbyte_raw_order_items + order_items_sku: unibag._airbyte_raw_order_items + order_items_price_ab1: unibag._airbyte_raw_order_items + order_items_price_ab2: unibag._airbyte_raw_order_items + order_items_price_ab3: unibag._airbyte_raw_order_items + order_items_price: unibag._airbyte_raw_order_items + orders_price_ab1: unibag._airbyte_raw_orders + orders_price_ab2: unibag._airbyte_raw_orders + orders_price_ab3: unibag._airbyte_raw_orders + orders_price: unibag._airbyte_raw_orders + orders_payment_ab1: unibag._airbyte_raw_orders + orders_payment_ab2: unibag._airbyte_raw_orders + orders_payment_ab3: unibag._airbyte_raw_orders + orders_payment: unibag._airbyte_raw_orders + orders_delivery_ab1: unibag._airbyte_raw_orders + orders_delivery_ab2: unibag._airbyte_raw_orders + orders_delivery_ab3: unibag._airbyte_raw_orders + orders_delivery: unibag._airbyte_raw_orders + orders_supplier_ab1: unibag._airbyte_raw_orders + orders_supplier_ab2: unibag._airbyte_raw_orders + orders_supplier_ab3: unibag._airbyte_raw_orders + orders_supplier: unibag._airbyte_raw_orders + orders_inventory_ab1: unibag._airbyte_raw_orders + orders_inventory_ab2: unibag._airbyte_raw_orders + orders_inventory_ab3: unibag._airbyte_raw_orders + orders_inventory: unibag._airbyte_raw_orders + orders_promotion_ab1: unibag._airbyte_raw_orders + orders_promotion_ab2: unibag._airbyte_raw_orders + orders_promotion_ab3: unibag._airbyte_raw_orders + orders_promotion: unibag._airbyte_raw_orders + orders_sendemail_ab1: unibag._airbyte_raw_orders + orders_sendemail_ab2: unibag._airbyte_raw_orders + orders_sendemail_ab3: unibag._airbyte_raw_orders + orders_sendemail: unibag._airbyte_raw_orders + orders_useragent_ab1: unibag._airbyte_raw_orders + orders_useragent_ab2: unibag._airbyte_raw_orders + orders_useragent_ab3: unibag._airbyte_raw_orders + orders_useragent: unibag._airbyte_raw_orders + product_categories_icon_ab1: unibag._airbyte_raw_product_categories + product_categories_icon_ab2: unibag._airbyte_raw_product_categories + product_categories_icon_ab3: unibag._airbyte_raw_product_categories + product_categories_icon: unibag._airbyte_raw_product_categories + product_categories_statistic_ab1: unibag._airbyte_raw_product_categories + product_categories_statistic_ab2: unibag._airbyte_raw_product_categories + product_categories_statistic_ab3: unibag._airbyte_raw_product_categories + product_categories_statistic: unibag._airbyte_raw_product_categories + product_sku_info_ab1: unibag._airbyte_raw_product_sku + product_sku_info_ab2: unibag._airbyte_raw_product_sku + product_sku_info_ab3: unibag._airbyte_raw_product_sku + product_sku_info: unibag._airbyte_raw_product_sku + product_sku_price_ab1: unibag._airbyte_raw_product_sku + product_sku_price_ab2: unibag._airbyte_raw_product_sku + product_sku_price_ab3: unibag._airbyte_raw_product_sku + product_sku_price: unibag._airbyte_raw_product_sku + product_sku_statistic_ab1: unibag._airbyte_raw_product_sku + product_sku_statistic_ab2: unibag._airbyte_raw_product_sku + product_sku_statistic_ab3: unibag._airbyte_raw_product_sku + product_sku_statistic: unibag._airbyte_raw_product_sku + product_sku_pricepercent_ab1: unibag._airbyte_raw_product_sku + product_sku_pricepercent_ab2: unibag._airbyte_raw_product_sku + product_sku_pricepercent_ab3: unibag._airbyte_raw_product_sku + product_sku_pricepercent: unibag._airbyte_raw_product_sku + product_sku_versions_info_ab1: unibag._airbyte_raw_product_sku_versions + product_sku_versions_info_ab2: unibag._airbyte_raw_product_sku_versions + product_sku_versions_info_ab3: unibag._airbyte_raw_product_sku_versions + product_sku_versions_info: unibag._airbyte_raw_product_sku_versions + product_sku_versions_price_ab1: unibag._airbyte_raw_product_sku_versions + product_sku_versions_price_ab2: unibag._airbyte_raw_product_sku_versions + product_sku_versions_price_ab3: unibag._airbyte_raw_product_sku_versions + product_sku_versions_price: unibag._airbyte_raw_product_sku_versions + product_sku_versions_statistic_ab1: unibag._airbyte_raw_product_sku_versions + product_sku_versions_statistic_ab2: unibag._airbyte_raw_product_sku_versions + product_sku_versions_statistic_ab3: unibag._airbyte_raw_product_sku_versions + product_sku_versions_statistic: unibag._airbyte_raw_product_sku_versions + products_info_ab1: unibag._airbyte_raw_products + products_info_ab2: unibag._airbyte_raw_products + products_info_ab3: unibag._airbyte_raw_products + products_info: unibag._airbyte_raw_products + products_order_ab1: unibag._airbyte_raw_products + products_order_ab2: unibag._airbyte_raw_products + products_order_ab3: unibag._airbyte_raw_products + products_order: unibag._airbyte_raw_products + products_price_ab1: unibag._airbyte_raw_products + products_price_ab2: unibag._airbyte_raw_products + products_price_ab3: unibag._airbyte_raw_products + products_price: unibag._airbyte_raw_products + products_score_ab1: unibag._airbyte_raw_products + products_score_ab2: unibag._airbyte_raw_products + products_score_ab3: unibag._airbyte_raw_products + products_score: unibag._airbyte_raw_products + products_statistic_ab1: unibag._airbyte_raw_products + products_statistic_ab2: unibag._airbyte_raw_products + products_statistic_ab3: unibag._airbyte_raw_products + products_statistic: unibag._airbyte_raw_products + products_pricepercent_ab1: unibag._airbyte_raw_products + products_pricepercent_ab2: unibag._airbyte_raw_products + products_pricepercent_ab3: unibag._airbyte_raw_products + products_pricepercent: unibag._airbyte_raw_products + products_sharestatistic_ab1: unibag._airbyte_raw_products + products_sharestatistic_ab2: unibag._airbyte_raw_products + products_sharestatistic_ab3: unibag._airbyte_raw_products + products_sharestatistic: unibag._airbyte_raw_products + products_reviewstatistic_ab1: unibag._airbyte_raw_products + products_reviewstatistic_ab2: unibag._airbyte_raw_products + products_reviewstatistic_ab3: unibag._airbyte_raw_products + products_reviewstatistic: unibag._airbyte_raw_products + promotion_orders_supplier_ab1: unibag._airbyte_raw_promotion_orders + promotion_orders_supplier_ab2: unibag._airbyte_raw_promotion_orders + promotion_orders_supplier_ab3: unibag._airbyte_raw_promotion_orders + promotion_orders_supplier: unibag._airbyte_raw_promotion_orders + promotions_options_ab1: unibag._airbyte_raw_promotions + promotions_options_ab2: unibag._airbyte_raw_promotions + promotions_options_ab3: unibag._airbyte_raw_promotions + promotions_options: unibag._airbyte_raw_promotions + promotions_applyfor_ab1: unibag._airbyte_raw_promotions + promotions_applyfor_ab2: unibag._airbyte_raw_promotions + promotions_applyfor_ab3: unibag._airbyte_raw_promotions + promotions_applyfor: unibag._airbyte_raw_promotions + promotions_statistic_ab1: unibag._airbyte_raw_promotions + promotions_statistic_ab2: unibag._airbyte_raw_promotions + promotions_statistic_ab3: unibag._airbyte_raw_promotions + promotions_statistic: unibag._airbyte_raw_promotions + promotions_conditionforuser_ab1: unibag._airbyte_raw_promotions + promotions_conditionforuser_ab2: unibag._airbyte_raw_promotions + promotions_conditionforuser_ab3: unibag._airbyte_raw_promotions + promotions_conditionforuser: unibag._airbyte_raw_promotions + promotions_suppliercommission_ab1: unibag._airbyte_raw_promotions + promotions_suppliercommission_ab2: unibag._airbyte_raw_promotions + promotions_suppliercommission_ab3: unibag._airbyte_raw_promotions + promotions_suppliercommission: unibag._airbyte_raw_promotions + session_deliveries_request_ab1: unibag._airbyte_raw_session_deliveries + session_deliveries_request_ab2: unibag._airbyte_raw_session_deliveries + session_deliveries_request_ab3: unibag._airbyte_raw_session_deliveries + session_deliveries_request: unibag._airbyte_raw_session_deliveries + session_deliveries_customer_ab1: unibag._airbyte_raw_session_deliveries + session_deliveries_customer_ab2: unibag._airbyte_raw_session_deliveries + session_deliveries_customer_ab3: unibag._airbyte_raw_session_deliveries + session_deliveries_customer: unibag._airbyte_raw_session_deliveries + session_deliveries_delivery_ab1: unibag._airbyte_raw_session_deliveries + session_deliveries_delivery_ab2: unibag._airbyte_raw_session_deliveries + session_deliveries_delivery_ab3: unibag._airbyte_raw_session_deliveries + session_deliveries_delivery: unibag._airbyte_raw_session_deliveries + session_deliveries_location_ab1: unibag._airbyte_raw_session_deliveries + session_deliveries_location_ab2: unibag._airbyte_raw_session_deliveries + session_deliveries_location_ab3: unibag._airbyte_raw_session_deliveries + session_deliveries_location: unibag._airbyte_raw_session_deliveries + session_deliveries_promotion_ab1: unibag._airbyte_raw_session_deliveries + session_deliveries_promotion_ab2: unibag._airbyte_raw_session_deliveries + session_deliveries_promotion_ab3: unibag._airbyte_raw_session_deliveries + session_deliveries_promotion: unibag._airbyte_raw_session_deliveries + social_posts_statistic_ab1: unibag._airbyte_raw_social_posts + social_posts_statistic_ab2: unibag._airbyte_raw_social_posts + social_posts_statistic_ab3: unibag._airbyte_raw_social_posts + social_posts_statistic: unibag._airbyte_raw_social_posts + social_posts_sharestatistic_ab1: unibag._airbyte_raw_social_posts + social_posts_sharestatistic_ab2: unibag._airbyte_raw_social_posts + social_posts_sharestatistic_ab3: unibag._airbyte_raw_social_posts + social_posts_sharestatistic: unibag._airbyte_raw_social_posts + suppliers_bank_ab1: unibag._airbyte_raw_suppliers + suppliers_bank_ab2: unibag._airbyte_raw_suppliers + suppliers_bank_ab3: unibag._airbyte_raw_suppliers + suppliers_bank: unibag._airbyte_raw_suppliers + suppliers_logo_ab1: unibag._airbyte_raw_suppliers + suppliers_logo_ab2: unibag._airbyte_raw_suppliers + suppliers_logo_ab3: unibag._airbyte_raw_suppliers + suppliers_logo: unibag._airbyte_raw_suppliers + suppliers_balance_ab1: unibag._airbyte_raw_suppliers + suppliers_balance_ab2: unibag._airbyte_raw_suppliers + suppliers_balance_ab3: unibag._airbyte_raw_suppliers + suppliers_balance: unibag._airbyte_raw_suppliers + suppliers_location_ab1: unibag._airbyte_raw_suppliers + suppliers_location_ab2: unibag._airbyte_raw_suppliers + suppliers_location_ab3: unibag._airbyte_raw_suppliers + suppliers_location: unibag._airbyte_raw_suppliers + suppliers_statistic_ab1: unibag._airbyte_raw_suppliers + suppliers_statistic_ab2: unibag._airbyte_raw_suppliers + suppliers_statistic_ab3: unibag._airbyte_raw_suppliers + suppliers_statistic: unibag._airbyte_raw_suppliers + suppliers_reviewstatistic_ab1: unibag._airbyte_raw_suppliers + suppliers_reviewstatistic_ab2: unibag._airbyte_raw_suppliers + suppliers_reviewstatistic_ab3: unibag._airbyte_raw_suppliers + suppliers_reviewstatistic: unibag._airbyte_raw_suppliers + team_activities_options_ab1: unibag._airbyte_raw_team_activities + team_activities_options_ab2: unibag._airbyte_raw_team_activities + team_activities_options_ab3: unibag._airbyte_raw_team_activities + team_activities_options: unibag._airbyte_raw_team_activities + team_members_statistic_ab1: unibag._airbyte_raw_team_members + team_members_statistic_ab2: unibag._airbyte_raw_team_members + team_members_statistic_ab3: unibag._airbyte_raw_team_members + team_members_statistic: unibag._airbyte_raw_team_members + team_members_statisticmonth_ab1: unibag._airbyte_raw_team_members + team_members_statisticmonth_ab2: unibag._airbyte_raw_team_members + team_members_statisticmonth_ab3: unibag._airbyte_raw_team_members + team_members_statisticmonth: unibag._airbyte_raw_team_members + teams_logo_ab1: unibag._airbyte_raw_teams + teams_logo_ab2: unibag._airbyte_raw_teams + teams_logo_ab3: unibag._airbyte_raw_teams + teams_logo: unibag._airbyte_raw_teams + teams_level_ab1: unibag._airbyte_raw_teams + teams_level_ab2: unibag._airbyte_raw_teams + teams_level_ab3: unibag._airbyte_raw_teams + teams_level: unibag._airbyte_raw_teams + teams_statistic_ab1: unibag._airbyte_raw_teams + teams_statistic_ab2: unibag._airbyte_raw_teams + teams_statistic_ab3: unibag._airbyte_raw_teams + teams_statistic: unibag._airbyte_raw_teams + teams_information_ab1: unibag._airbyte_raw_teams + teams_information_ab2: unibag._airbyte_raw_teams + teams_information_ab3: unibag._airbyte_raw_teams + teams_information: unibag._airbyte_raw_teams + user_identifications_backside_ab1: unibag._airbyte_raw_user_identifications + user_identifications_backside_ab2: unibag._airbyte_raw_user_identifications + user_identifications_backside_ab3: unibag._airbyte_raw_user_identifications + user_identifications_backside: unibag._airbyte_raw_user_identifications + user_identifications_frontside_ab1: unibag._airbyte_raw_user_identifications + user_identifications_frontside_ab2: unibag._airbyte_raw_user_identifications + user_identifications_frontside_ab3: unibag._airbyte_raw_user_identifications + user_identifications_frontside: unibag._airbyte_raw_user_identifications + user_identifications_detectinformation_ab1: unibag._airbyte_raw_user_identifications + user_identifications_detectinformation_ab2: unibag._airbyte_raw_user_identifications + user_identifications_detectinformation_ab3: unibag._airbyte_raw_user_identifications + user_identifications_detectinformation: unibag._airbyte_raw_user_identifications + users_info_ab1: unibag._airbyte_raw_users + users_info_ab2: unibag._airbyte_raw_users + users_info_ab3: unibag._airbyte_raw_users + users_info: unibag._airbyte_raw_users + users_team_ab1: unibag._airbyte_raw_users + users_team_ab2: unibag._airbyte_raw_users + users_team_ab3: unibag._airbyte_raw_users + users_team: unibag._airbyte_raw_users + users_zalo_ab1: unibag._airbyte_raw_users + users_zalo_ab2: unibag._airbyte_raw_users + users_zalo_ab3: unibag._airbyte_raw_users + users_zalo: unibag._airbyte_raw_users + users_email_ab1: unibag._airbyte_raw_users + users_email_ab2: unibag._airbyte_raw_users + users_email_ab3: unibag._airbyte_raw_users + users_email: unibag._airbyte_raw_users + users_phone_ab1: unibag._airbyte_raw_users + users_phone_ab2: unibag._airbyte_raw_users + users_phone_ab3: unibag._airbyte_raw_users + users_phone: unibag._airbyte_raw_users + users_avatar_ab1: unibag._airbyte_raw_users + users_avatar_ab2: unibag._airbyte_raw_users + users_avatar_ab3: unibag._airbyte_raw_users + users_avatar: unibag._airbyte_raw_users + users_facebook_ab1: unibag._airbyte_raw_users + users_facebook_ab2: unibag._airbyte_raw_users + users_facebook_ab3: unibag._airbyte_raw_users + users_facebook: unibag._airbyte_raw_users + users_referral_ab1: unibag._airbyte_raw_users + users_referral_ab2: unibag._airbyte_raw_users + users_referral_ab3: unibag._airbyte_raw_users + users_referral: unibag._airbyte_raw_users + users_statistic_ab1: unibag._airbyte_raw_users + users_statistic_ab2: unibag._airbyte_raw_users + users_statistic_ab3: unibag._airbyte_raw_users + users_statistic: unibag._airbyte_raw_users + users_membership_ab1: unibag._airbyte_raw_users + users_membership_ab2: unibag._airbyte_raw_users + users_membership_ab3: unibag._airbyte_raw_users + users_membership: unibag._airbyte_raw_users + users_identification_ab1: unibag._airbyte_raw_users + users_identification_ab2: unibag._airbyte_raw_users + users_identification_ab3: unibag._airbyte_raw_users + users_identification: unibag._airbyte_raw_users + vouchers_logo_ab1: unibag._airbyte_raw_vouchers + vouchers_logo_ab2: unibag._airbyte_raw_vouchers + vouchers_logo_ab3: unibag._airbyte_raw_vouchers + vouchers_logo: unibag._airbyte_raw_vouchers + vouchers_options_ab1: unibag._airbyte_raw_vouchers + vouchers_options_ab2: unibag._airbyte_raw_vouchers + vouchers_options_ab3: unibag._airbyte_raw_vouchers + vouchers_options: unibag._airbyte_raw_vouchers + vouchers_applyfor_ab1: unibag._airbyte_raw_vouchers + vouchers_applyfor_ab2: unibag._airbyte_raw_vouchers + vouchers_applyfor_ab3: unibag._airbyte_raw_vouchers + vouchers_applyfor: unibag._airbyte_raw_vouchers + events_icon_dimensions_ab1: unibag._airbyte_raw_events + events_icon_dimensions_ab2: unibag._airbyte_raw_events + events_icon_dimensions_ab3: unibag._airbyte_raw_events + events_icon_dimensions: unibag._airbyte_raw_events + events_cover_dimensions_ab1: unibag._airbyte_raw_events + events_cover_dimensions_ab2: unibag._airbyte_raw_events + events_cover_dimensions_ab3: unibag._airbyte_raw_events + events_cover_dimensions: unibag._airbyte_raw_events + events_segments_lastmonthsales_ab1: unibag._airbyte_raw_events + events_segments_lastmonthsales_ab2: unibag._airbyte_raw_events + events_segments_lastmonthsales_ab3: unibag._airbyte_raw_events + events_segments_lastmonthsales: unibag._airbyte_raw_events + events_segments_highestmonthlysales_ab1: unibag._airbyte_raw_events + events_segments_highestmonthlysales_ab2: unibag._airbyte_raw_events + events_segments_highestmonthlysales_ab3: unibag._airbyte_raw_events + events_segments_highestmonthlysales: unibag._airbyte_raw_events + inventories_location_location_ab1: unibag._airbyte_raw_inventories + inventories_location_location_ab2: unibag._airbyte_raw_inventories + inventories_location_location_ab3: unibag._airbyte_raw_inventories + inventories_location_location: unibag._airbyte_raw_inventories + membership_histories_new_condition_ab1: unibag._airbyte_raw_membership_histories + membership_histories_new_condition_ab2: unibag._airbyte_raw_membership_histories + membership_histories_new_condition_ab3: unibag._airbyte_raw_membership_histories + membership_histories_new_condition: unibag._airbyte_raw_membership_histories + membership_histories_old_condition_ab1: unibag._airbyte_raw_membership_histories + membership_histories_old_condition_ab2: unibag._airbyte_raw_membership_histories + membership_histories_old_condition_ab3: unibag._airbyte_raw_membership_histories + membership_histories_old_condition: unibag._airbyte_raw_membership_histories + membership_histories_old_statistic_ab1: unibag._airbyte_raw_membership_histories + membership_histories_old_statistic_ab2: unibag._airbyte_raw_membership_histories + membership_histories_old_statistic_ab3: unibag._airbyte_raw_membership_histories + membership_histories_old_statistic: unibag._airbyte_raw_membership_histories + order_deliveries_delivery_feeship_ab1: unibag._airbyte_raw_order_deliveries + order_deliveries_delivery_feeship_ab2: unibag._airbyte_raw_order_deliveries + order_deliveries_delivery_feeship_ab3: unibag._airbyte_raw_order_deliveries + order_deliveries_delivery_feeship: unibag._airbyte_raw_order_deliveries + orders_delivery_weight_ab1: unibag._airbyte_raw_orders + orders_delivery_weight_ab2: unibag._airbyte_raw_orders + orders_delivery_weight_ab3: unibag._airbyte_raw_orders + orders_delivery_weight: unibag._airbyte_raw_orders + orders_delivery_feeship_ab1: unibag._airbyte_raw_orders + orders_delivery_feeship_ab2: unibag._airbyte_raw_orders + orders_delivery_feeship_ab3: unibag._airbyte_raw_orders + orders_delivery_feeship: unibag._airbyte_raw_orders + orders_delivery_location_ab1: unibag._airbyte_raw_orders + orders_delivery_location_ab2: unibag._airbyte_raw_orders + orders_delivery_location_ab3: unibag._airbyte_raw_orders + orders_delivery_location: unibag._airbyte_raw_orders + product_categories_icon_dimensions_ab1: unibag._airbyte_raw_product_categories + product_categories_icon_dimensions_ab2: unibag._airbyte_raw_product_categories + product_categories_icon_dimensions_ab3: unibag._airbyte_raw_product_categories + product_categories_icon_dimensions: unibag._airbyte_raw_product_categories + product_sku_info_category_ab1: unibag._airbyte_raw_product_sku + product_sku_info_category_ab2: unibag._airbyte_raw_product_sku + product_sku_info_category_ab3: unibag._airbyte_raw_product_sku + product_sku_info_category: unibag._airbyte_raw_product_sku + product_sku_info_supplier_ab1: unibag._airbyte_raw_product_sku + product_sku_info_supplier_ab2: unibag._airbyte_raw_product_sku + product_sku_info_supplier_ab3: unibag._airbyte_raw_product_sku + product_sku_info_supplier: unibag._airbyte_raw_product_sku + product_sku_info_inventory_ab1: unibag._airbyte_raw_product_sku + product_sku_info_inventory_ab2: unibag._airbyte_raw_product_sku + product_sku_info_inventory_ab3: unibag._airbyte_raw_product_sku + product_sku_info_inventory: unibag._airbyte_raw_product_sku + product_sku_versions_info_category_ab1: unibag._airbyte_raw_product_sku_versions + product_sku_versions_info_category_ab2: unibag._airbyte_raw_product_sku_versions + product_sku_versions_info_category_ab3: unibag._airbyte_raw_product_sku_versions + product_sku_versions_info_category: unibag._airbyte_raw_product_sku_versions + product_sku_versions_info_supplier_ab1: unibag._airbyte_raw_product_sku_versions + product_sku_versions_info_supplier_ab2: unibag._airbyte_raw_product_sku_versions + product_sku_versions_info_supplier_ab3: unibag._airbyte_raw_product_sku_versions + product_sku_versions_info_supplier: unibag._airbyte_raw_product_sku_versions + product_sku_versions_info_inventory_ab1: unibag._airbyte_raw_product_sku_versions + product_sku_versions_info_inventory_ab2: unibag._airbyte_raw_product_sku_versions + product_sku_versions_info_inventory_ab3: unibag._airbyte_raw_product_sku_versions + product_sku_versions_info_inventory: unibag._airbyte_raw_product_sku_versions + products_info_category_ab1: unibag._airbyte_raw_products + products_info_category_ab2: unibag._airbyte_raw_products + products_info_category_ab3: unibag._airbyte_raw_products + products_info_category: unibag._airbyte_raw_products + products_info_supplier_ab1: unibag._airbyte_raw_products + products_info_supplier_ab2: unibag._airbyte_raw_products + products_info_supplier_ab3: unibag._airbyte_raw_products + products_info_supplier: unibag._airbyte_raw_products + products_info_inventory_ab1: unibag._airbyte_raw_products + products_info_inventory_ab2: unibag._airbyte_raw_products + products_info_inventory_ab3: unibag._airbyte_raw_products + products_info_inventory: unibag._airbyte_raw_products + promotions_options_bonus_ab1: unibag._airbyte_raw_promotions + promotions_options_bonus_ab2: unibag._airbyte_raw_promotions + promotions_options_bonus_ab3: unibag._airbyte_raw_promotions + promotions_options_bonus: unibag._airbyte_raw_promotions + session_deliveries_request_to_ab1: unibag._airbyte_raw_session_deliveries + session_deliveries_request_to_ab2: unibag._airbyte_raw_session_deliveries + session_deliveries_request_to_ab3: unibag._airbyte_raw_session_deliveries + session_deliveries_request_to: unibag._airbyte_raw_session_deliveries + session_deliveries_request_from_ab1: unibag._airbyte_raw_session_deliveries + session_deliveries_request_from_ab2: unibag._airbyte_raw_session_deliveries + session_deliveries_request_from_ab3: unibag._airbyte_raw_session_deliveries + session_deliveries_request_from: unibag._airbyte_raw_session_deliveries + session_deliveries_delivery_feeship_ab1: unibag._airbyte_raw_session_deliveries + session_deliveries_delivery_feeship_ab2: unibag._airbyte_raw_session_deliveries + session_deliveries_delivery_feeship_ab3: unibag._airbyte_raw_session_deliveries + session_deliveries_delivery_feeship: unibag._airbyte_raw_session_deliveries + suppliers_logo_dimensions_ab1: unibag._airbyte_raw_suppliers + suppliers_logo_dimensions_ab2: unibag._airbyte_raw_suppliers + suppliers_logo_dimensions_ab3: unibag._airbyte_raw_suppliers + suppliers_logo_dimensions: unibag._airbyte_raw_suppliers + teams_logo_dimensions_ab1: unibag._airbyte_raw_teams + teams_logo_dimensions_ab2: unibag._airbyte_raw_teams + teams_logo_dimensions_ab3: unibag._airbyte_raw_teams + teams_logo_dimensions: unibag._airbyte_raw_teams + user_identifications_backside_dimensions_ab1: unibag._airbyte_raw_user_identifications + user_identifications_backside_dimensions_ab2: unibag._airbyte_raw_user_identifications + user_identifications_backside_dimensions_ab3: unibag._airbyte_raw_user_identifications + user_identifications_backside_dimensions: unibag._airbyte_raw_user_identifications + user_identifications_frontside_dimensions_ab1: unibag._airbyte_raw_user_identifications + user_identifications_frontside_dimensions_ab2: unibag._airbyte_raw_user_identifications + user_identifications_frontside_dimensions_ab3: unibag._airbyte_raw_user_identifications + user_identifications_frontside_dimensions: unibag._airbyte_raw_user_identifications + user_identifications__ation_addressentities_ab1: unibag._airbyte_raw_user_identifications + user_identifications__ation_addressentities_ab2: unibag._airbyte_raw_user_identifications + user_identifications__ation_addressentities_ab3: unibag._airbyte_raw_user_identifications + user_identifications__ation_addressentities: unibag._airbyte_raw_user_identifications + users_avatar_dimensions_ab1: unibag._airbyte_raw_users + users_avatar_dimensions_ab2: unibag._airbyte_raw_users + users_avatar_dimensions_ab3: unibag._airbyte_raw_users + users_avatar_dimensions: unibag._airbyte_raw_users + vouchers_logo_dimensions_ab1: unibag._airbyte_raw_vouchers + vouchers_logo_dimensions_ab2: unibag._airbyte_raw_vouchers + vouchers_logo_dimensions_ab3: unibag._airbyte_raw_vouchers + vouchers_logo_dimensions: unibag._airbyte_raw_vouchers + vouchers_options_bonus_ab1: unibag._airbyte_raw_vouchers + vouchers_options_bonus_ab2: unibag._airbyte_raw_vouchers + vouchers_options_bonus_ab3: unibag._airbyte_raw_vouchers + vouchers_options_bonus: unibag._airbyte_raw_vouchers + events_icon_dimensions_md_ab1: unibag._airbyte_raw_events + events_icon_dimensions_md_ab2: unibag._airbyte_raw_events + events_icon_dimensions_md_ab3: unibag._airbyte_raw_events + events_icon_dimensions_md: unibag._airbyte_raw_events + events_icon_dimensions_sm_ab1: unibag._airbyte_raw_events + events_icon_dimensions_sm_ab2: unibag._airbyte_raw_events + events_icon_dimensions_sm_ab3: unibag._airbyte_raw_events + events_icon_dimensions_sm: unibag._airbyte_raw_events + events_cover_dimensions_md_ab1: unibag._airbyte_raw_events + events_cover_dimensions_md_ab2: unibag._airbyte_raw_events + events_cover_dimensions_md_ab3: unibag._airbyte_raw_events + events_cover_dimensions_md: unibag._airbyte_raw_events + events_cover_dimensions_sm_ab1: unibag._airbyte_raw_events + events_cover_dimensions_sm_ab2: unibag._airbyte_raw_events + events_cover_dimensions_sm_ab3: unibag._airbyte_raw_events + events_cover_dimensions_sm: unibag._airbyte_raw_events + product_categories_icon_dimensions_md_ab1: unibag._airbyte_raw_product_categories + product_categories_icon_dimensions_md_ab2: unibag._airbyte_raw_product_categories + product_categories_icon_dimensions_md_ab3: unibag._airbyte_raw_product_categories + product_categories_icon_dimensions_md: unibag._airbyte_raw_product_categories + product_categories_icon_dimensions_sm_ab1: unibag._airbyte_raw_product_categories + product_categories_icon_dimensions_sm_ab2: unibag._airbyte_raw_product_categories + product_categories_icon_dimensions_sm_ab3: unibag._airbyte_raw_product_categories + product_categories_icon_dimensions_sm: unibag._airbyte_raw_product_categories + product_sku_info_inventory_location_ab1: unibag._airbyte_raw_product_sku + product_sku_info_inventory_location_ab2: unibag._airbyte_raw_product_sku + product_sku_info_inventory_location_ab3: unibag._airbyte_raw_product_sku + product_sku_info_inventory_location: unibag._airbyte_raw_product_sku + products_info_inventory_location_ab1: unibag._airbyte_raw_products + products_info_inventory_location_ab2: unibag._airbyte_raw_products + products_info_inventory_location_ab3: unibag._airbyte_raw_products + products_info_inventory_location: unibag._airbyte_raw_products + session_deliveries_request_to_location_ab1: unibag._airbyte_raw_session_deliveries + session_deliveries_request_to_location_ab2: unibag._airbyte_raw_session_deliveries + session_deliveries_request_to_location_ab3: unibag._airbyte_raw_session_deliveries + session_deliveries_request_to_location: unibag._airbyte_raw_session_deliveries + suppliers_logo_dimensions_md_ab1: unibag._airbyte_raw_suppliers + suppliers_logo_dimensions_md_ab2: unibag._airbyte_raw_suppliers + suppliers_logo_dimensions_md_ab3: unibag._airbyte_raw_suppliers + suppliers_logo_dimensions_md: unibag._airbyte_raw_suppliers + suppliers_logo_dimensions_sm_ab1: unibag._airbyte_raw_suppliers + suppliers_logo_dimensions_sm_ab2: unibag._airbyte_raw_suppliers + suppliers_logo_dimensions_sm_ab3: unibag._airbyte_raw_suppliers + suppliers_logo_dimensions_sm: unibag._airbyte_raw_suppliers + teams_logo_dimensions_md_ab1: unibag._airbyte_raw_teams + teams_logo_dimensions_md_ab2: unibag._airbyte_raw_teams + teams_logo_dimensions_md_ab3: unibag._airbyte_raw_teams + teams_logo_dimensions_md: unibag._airbyte_raw_teams + teams_logo_dimensions_sm_ab1: unibag._airbyte_raw_teams + teams_logo_dimensions_sm_ab2: unibag._airbyte_raw_teams + teams_logo_dimensions_sm_ab3: unibag._airbyte_raw_teams + teams_logo_dimensions_sm: unibag._airbyte_raw_teams + user_identifications_backside_dimensions_md_ab1: unibag._airbyte_raw_user_identifications + user_identifications_backside_dimensions_md_ab2: unibag._airbyte_raw_user_identifications + user_identifications_backside_dimensions_md_ab3: unibag._airbyte_raw_user_identifications + user_identifications_backside_dimensions_md: unibag._airbyte_raw_user_identifications + user_identifications_backside_dimensions_sm_ab1: unibag._airbyte_raw_user_identifications + user_identifications_backside_dimensions_sm_ab2: unibag._airbyte_raw_user_identifications + user_identifications_backside_dimensions_sm_ab3: unibag._airbyte_raw_user_identifications + user_identifications_backside_dimensions_sm: unibag._airbyte_raw_user_identifications + user_identifications__ontside_dimensions_md_ab1: unibag._airbyte_raw_user_identifications + user_identifications__ontside_dimensions_md_ab2: unibag._airbyte_raw_user_identifications + user_identifications__ontside_dimensions_md_ab3: unibag._airbyte_raw_user_identifications + user_identifications__ontside_dimensions_md: unibag._airbyte_raw_user_identifications + user_identifications__ontside_dimensions_sm_ab1: unibag._airbyte_raw_user_identifications + user_identifications__ontside_dimensions_sm_ab2: unibag._airbyte_raw_user_identifications + user_identifications__ontside_dimensions_sm_ab3: unibag._airbyte_raw_user_identifications + user_identifications__ontside_dimensions_sm: unibag._airbyte_raw_user_identifications + users_avatar_dimensions_md_ab1: unibag._airbyte_raw_users + users_avatar_dimensions_md_ab2: unibag._airbyte_raw_users + users_avatar_dimensions_md_ab3: unibag._airbyte_raw_users + users_avatar_dimensions_md: unibag._airbyte_raw_users + users_avatar_dimensions_sm_ab1: unibag._airbyte_raw_users + users_avatar_dimensions_sm_ab2: unibag._airbyte_raw_users + users_avatar_dimensions_sm_ab3: unibag._airbyte_raw_users + users_avatar_dimensions_sm: unibag._airbyte_raw_users + vouchers_logo_dimensions_md_ab1: unibag._airbyte_raw_vouchers + vouchers_logo_dimensions_md_ab2: unibag._airbyte_raw_vouchers + vouchers_logo_dimensions_md_ab3: unibag._airbyte_raw_vouchers + vouchers_logo_dimensions_md: unibag._airbyte_raw_vouchers + vouchers_logo_dimensions_sm_ab1: unibag._airbyte_raw_vouchers + vouchers_logo_dimensions_sm_ab2: unibag._airbyte_raw_vouchers + vouchers_logo_dimensions_sm_ab3: unibag._airbyte_raw_vouchers + vouchers_logo_dimensions_sm: unibag._airbyte_raw_vouchers + product_sku_info_inv__ory_location_location_ab1: unibag._airbyte_raw_product_sku + product_sku_info_inv__ory_location_location_ab2: unibag._airbyte_raw_product_sku + product_sku_info_inv__ory_location_location_ab3: unibag._airbyte_raw_product_sku + product_sku_info_inv__ory_location_location: unibag._airbyte_raw_product_sku + products_info_inventory_location_location_ab1: unibag._airbyte_raw_products + products_info_inventory_location_location_ab2: unibag._airbyte_raw_products + products_info_inventory_location_location_ab3: unibag._airbyte_raw_products + products_info_inventory_location_location: unibag._airbyte_raw_products diff --git a/destination_catalog.json b/destination_catalog.json index 016b773..e5f89a1 100644 --- a/destination_catalog.json +++ b/destination_catalog.json @@ -1 +1 @@ -{"streams":[{"stream":{"name":"admin-tags","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"color":{"type":"string"},"active":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"searchString":{"type":"string"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"cash-flows","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"hash":{"type":"string"},"user":{"type":"string"},"value":{"type":"number"},"action":{"type":"string"},"options":{"type":"string"},"category":{"type":"string"},"targetId":{"type":"string"},"createdAt":{"type":"string"},"isAudited":{"type":"boolean"},"updatedAt":{"type":"string"},"newBalance":{"type":"number"},"oldBalance":{"type":"number"},"targetType":{"type":"string"},"isProcessed":{"type":"boolean"},"processStatus":{"type":"string"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"cities","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"code":{"type":"number"},"name":{"type":"string"},"slug":{"type":"string"},"order":{"type":"number"},"tncId":{"type":"number"},"region":{"type":"string"},"source":{"type":"string"},"tempId":{"type":"number"},"tncCode":{"type":"string"},"osirisId":{"type":"number"},"updatedAt":{"type":"string"},"searchString":{"type":"string"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"customers","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"info":{"type":"string"},"name":{"type":"string"},"user":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"source":{"type":"string"},"location":{"type":"array"},"createdAt":{"type":"string"},"isDeleted":{"type":"boolean"},"statistic":{"type":"string"},"updatedAt":{"type":"string"},"searchString":{"type":"string"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"districts","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"city":{"type":"string"},"code":{"type":"number"},"name":{"type":"string"},"slug":{"type":"string"},"tncId":{"type":"number"},"cityId":{"type":"number"},"source":{"type":"string"},"tncCode":{"type":"string"},"gidoCode":{"type":"number"},"osirisId":{"type":"number"},"updatedAt":{"type":"string"},"searchString":{"type":"string"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"event-rewards","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"cash":{"type":"number"},"type":{"type":"string"},"user":{"type":"string"},"event":{"type":"string"},"status":{"type":"string"},"options":{"type":"string"},"createdAt":{"type":"string"},"updatedat":{"type":"string"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"events","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"desc":{"type":"string"},"icon":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"cover":{"type":"string"},"endAt":{"type":"string"},"active":{"type":"boolean"},"notice":{"type":"string"},"screen":{"type":"string"},"article":{"type":"string"},"options":{"type":"string"},"startAt":{"type":"string"},"segments":{"type":"string"},"createdAt":{"type":"string"},"groupType":{"type":"string"},"suppliers":{"type":"array"},"updatedAt":{"type":"string"},"information":{"type":"array"},"displayEndAt":{"type":"string"},"isApplyForAll":{"type":"boolean"},"displayStartAt":{"type":"string"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"inventories","json_schema":{"type":"object","properties":{"id":{"type":"string"},"_id":{"type":"string"},"code":{"type":"number"},"name":{"type":"string"},"slug":{"type":"string"},"active":{"type":"boolean"},"contact":{"type":"string"},"partner":{"type":"string"},"checksum":{"type":"string"},"location":{"type":"string"},"supplier":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"minimumValue":{"type":"number"},"searchString":{"type":"string"},"paymentMethods":{"type":"string"},"canIssueInvoice":{"type":"boolean"},"deliveryMethods":{"type":"array"},"canAutoSendEmail":{"type":"boolean"},"invoiceDeliveryMethod":{"type":"string"},"doesSupportSellyExpress":{"type":"boolean"},"priorityDeliveryServiceCodes":{"type":"array"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"membership","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"},"guide":{"type":"string"},"level":{"type":"number"},"sales":{"type":"number"},"active":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"updatedat":{"type":"string"},"transaction":{"type":"number"},"bonusPercent":{"type":"number"},"bonuspercent":{"type":"number"},"transactionMinValue":{"type":"number"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"membership-histories","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"new":{"type":"string"},"old":{"type":"string"},"type":{"type":"string"},"user":{"type":"string"},"createdAt":{"type":"string"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"membership-orders","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"user":{"type":"string"},"status":{"type":"string"},"percent":{"type":"number"},"targetID":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"commission":{"type":"number"},"isRejected":{"type":"boolean"},"membershipName":{"type":"string"},"membershipLevel":{"type":"number"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"order-deliveries","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"code":{"type":"string"},"order":{"type":"string"},"title":{"type":"string"},"status":{"type":"string"},"service":{"type":"string"},"customer":{"type":"string"},"delivery":{"type":"string"},"location":{"type":"string"},"createdAt":{"type":"string"},"promotion":{"type":"string"},"updatedAt":{"type":"string"},"trackingCode":{"type":"string"},"trackingTime":{"type":"string"},"isAdminChange":{"type":"boolean"},"trackingOrderCode":{"type":"string"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"order-histories","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"order":{"type":"string"},"status":{"type":"string"},"createdAt":{"type":"string"},"timestamp":{"type":"number"},"updatedAt":{"type":"string"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"order-items","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"sku":{"type":"string"},"date":{"type":"string"},"user":{"type":"string"},"brand":{"type":"string"},"order":{"type":"string"},"price":{"type":"string"},"status":{"type":"string"},"teamId":{"type":"string"},"product":{"type":"string"},"voucher":{"type":"string"},"customer":{"type":"string"},"quantity":{"type":"number"},"createdAt":{"type":"string"},"inventory":{"type":"string"},"totalSell":{"type":"number"},"updatedAt":{"type":"string"},"cashbackAt":{"type":"string"},"promotions":{"type":"array"},"totalPrice":{"type":"number"},"deliveredAt":{"type":"string"},"teamMemberId":{"type":"string"},"isAssignCoupon":{"type":"boolean"},"totalPromotion":{"type":"number"},"inWholesaleRange":{"type":"boolean"},"voucherCashTotal":{"type":"number"},"wholesaleRangeId":{"type":"string"},"totalWholesaleBonus":{"type":"number"},"totalSellyWholesaleBonus":{"type":"number"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"orders","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"code":{"type":"string"},"date":{"type":"string"},"hour":{"type":"number"},"note":{"type":"string"},"tags":{"type":"array"},"user":{"type":"string"},"price":{"type":"string"},"banned":{"type":"boolean"},"reason":{"type":"string"},"source":{"type":"string"},"status":{"type":"string"},"teamId":{"type":"string"},"payment":{"type":"string"},"remarks":{"type":"string"},"customer":{"type":"string"},"delivery":{"type":"string"},"isCalled":{"type":"boolean"},"merchant":{"type":"string"},"pickupAt":{"type":"string"},"supplier":{"type":"string"},"createdAt":{"type":"string"},"inventory":{"type":"string"},"invoiceId":{"type":"string"},"isDeleted":{"type":"boolean"},"promotion":{"type":"string"},"requestId":{"type":"string"},"restockAt":{"type":"string"},"sendEmail":{"type":"string"},"totalItem":{"type":"number"},"updatedAt":{"type":"string"},"userAgent":{"type":"string"},"wholesale":{"type":"boolean"},"approvedAt":{"type":"string"},"cashbackAt":{"type":"string"},"isPreorder":{"type":"boolean"},"isReviewed":{"type":"boolean"},"rejectedAt":{"type":"string"},"deliveredAt":{"type":"string"},"deliveringAt":{"type":"string"},"deliveryCode":{"type":"string"},"searchString":{"type":"string"},"staffApprove":{"type":"string"},"teamMemberId":{"type":"string"},"processStatus":{"type":"string"},"hookTimeLastAt":{"type":"string"},"isAssignCoupon":{"type":"boolean"},"isAutoApproved":{"type":"boolean"},"outboundRequest":{"type":"string"},"trackingCodeURL":{"type":"string"},"waitingCancelBy":{"type":"string"},"isChangeDelivery":{"type":"boolean"},"estimateCashbackAt":{"type":"string"},"fromNewActiveBuyer":{"type":"boolean"},"isWaitingCancelled":{"type":"boolean"},"fromNewActiveSeller":{"type":"boolean"},"waitingCancelReason":{"type":"string"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"product-categories","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"icon":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"},"order":{"type":"number"},"active":{"type":"boolean"},"covers":{"type":"array"},"featured":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"totalProduct":{"type":"number"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"product-sku","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"sku":{"type":"string"},"info":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"brand":{"type":"string"},"cover":{"type":"string"},"price":{"type":"string"},"active":{"type":"boolean"},"author":{"type":"string"},"source":{"type":"string"},"display":{"type":"boolean"},"picture":{"type":"string"},"product":{"type":"string"},"version":{"type":"number"},"groupSku":{"type":"string"},"unitCode":{"type":"string"},"createdAt":{"type":"string"},"restockAt":{"type":"string"},"statistic":{"type":"string"},"updatedAt":{"type":"string"},"couponInfo":{"type":"string"},"properties":{"type":"array"},"canPreorder":{"type":"boolean"},"supplierSku":{"type":"string"},"isOutOfStock":{"type":"boolean"},"pricePercent":{"type":"string"},"searchString":{"type":"string"},"displayInventory":{"type":"boolean"},"showRemainingQuantity":{"type":"boolean"},"quantity_aibyte_transform":{"type":"string"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"product-sku-versions","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"sku":{"type":"string"},"info":{"type":"string"},"name":{"type":"string"},"price":{"type":"string"},"source":{"type":"string"},"codeSku":{"type":"string"},"picture":{"type":"string"},"product":{"type":"string"},"version":{"type":"number"},"createdAt":{"type":"string"},"properties":{"type":"array"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"product-sub-categories","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"order":{"type":"number"},"active":{"type":"boolean"},"parent":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"searchString":{"type":"string"},"totalProduct":{"type":"number"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"products","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"desc":{"type":"string"},"info":{"type":"string"},"name":{"type":"string"},"temp":{"type":"string"},"brand":{"type":"string"},"order":{"type":"string"},"price":{"type":"string"},"score":{"type":"string"},"active":{"type":"boolean"},"author":{"type":"string"},"guides":{"type":"array"},"photos":{"type":"array"},"videos":{"type":"array"},"quantity":{"type":"number"},"createdAt":{"type":"string"},"documents":{"type":"array"},"shareDesc":{"type":"string"},"statistic":{"type":"string"},"updatedAt":{"type":"string"},"categories":{"type":"array"},"properties":{"type":"array"},"reActiveAt":{"type":"string"},"inventories":{"type":"array"},"isOutOfStock":{"type":"boolean"},"pricePercent":{"type":"string"},"searchString":{"type":"string"},"subCategories":{"type":"array"},"inactiveReason":{"type":"string"},"propertiesMain":{"type":"string"},"shareStatistic":{"type":"string"},"canIssueInvoice":{"type":"boolean"},"pendingInactive":{"type":"boolean"},"reviewStatistic":{"type":"string"},"pendingInactiveAt":{"type":"string"},"highlightProperties":{"type":"array"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"promotion-orders","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"user":{"type":"string"},"order":{"type":"string"},"title":{"type":"string"},"status":{"type":"string"},"supplier":{"type":"string"},"createdAt":{"type":"string"},"promotion":{"type":"string"},"updatedAt":{"type":"string"},"cashbackAt":{"type":"string"},"commission":{"type":"number"},"isRejected":{"type":"boolean"},"quantityPromotion":{"type":"number"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"promotions","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"rest":{"type":"number"},"type":{"type":"string"},"endAt":{"type":"string"},"title":{"type":"string"},"active":{"type":"boolean"},"options":{"type":"string"},"startAt":{"type":"string"},"applyFor":{"type":"string"},"quantity":{"type":"number"},"articleID":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"searchString":{"type":"string"},"sharePercent":{"type":"string"},"conditionForUser":{"type":"string"},"isUnlimitedQuantity":{"type":"boolean"},"isApplyForOrderWholesale":{"type":"boolean"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"referrals","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"user":{"type":"string"},"invitee":{"type":"string"},"createdAt":{"type":"string"},"fromSystem":{"type":"boolean"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"social-post-views","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"user":{"type":"string"},"clientIP":{"type":"string"},"lastViewAt":{"type":"string"},"socialPost":{"type":"string"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"social-posts","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"tags":{"type":"array"},"isPin":{"type":"boolean"},"order":{"type":"number"},"title":{"type":"string"},"author":{"type":"string"},"cities":{"type":"array"},"photos":{"type":"array"},"reason":{"type":"string"},"status":{"type":"string"},"videos":{"type":"array"},"content":{"type":"string"},"isTimer":{"type":"boolean"},"startAt":{"type":"string"},"products":{"type":"array"},"createdAt":{"type":"string"},"hasUpdate":{"type":"boolean"},"statistic":{"type":"string"},"updatedAt":{"type":"string"},"categories":{"type":"array"},"fromSystem":{"type":"boolean"},"contributor":{"type":"string"},"publishedAt":{"type":"string"},"searchString":{"type":"string"},"updatedCount":{"type":"number"},"shareStatistic":{"type":"string"},"enableNotificationForContributor":{"type":"boolean"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"suppliers","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"tax":{"type":"string"},"bank":{"type":"string"},"logo":{"type":"string"},"name":{"type":"string"},"active":{"type":"boolean"},"checkSum":{"type":"string"},"checksum":{"type":"string"},"location":{"type":"string"},"contracts":{"type":"array"},"createdAt":{"type":"string"},"documents":{"type":"array"},"statistic":{"type":"string"},"updatedAt":{"type":"string"},"categories":{"type":"array"},"inventories":{"type":"array"},"identifyCode":{"type":"number"},"searchString":{"type":"string"},"contractNumber":{"type":"string"},"reviewStatistic":{"type":"string"},"contractSignedAt":{"type":"string"},"emailForInvoices":{"type":"array"},"contractExpiredAt":{"type":"string"},"sendInvoiceRequestEveryDay":{"type":"boolean"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"team-activities","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"team":{"type":"string"},"action":{"type":"string"},"options":{"type":"string"},"targetId":{"type":"string"},"createdAt":{"type":"string"},"createdBy":{"type":"string"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"team-bonus","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"team":{"type":"string"},"user":{"type":"string"},"status":{"type":"string"},"percent":{"type":"number"},"targetId":{"type":"string"},"teamName":{"type":"string"},"createdAt":{"type":"string"},"teamLevel":{"type":"number"},"updatedAt":{"type":"string"},"commission":{"type":"number"},"teamMember":{"type":"string"},"teamPromotion":{"type":"string"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"team-members","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"role":{"type":"string"},"team":{"type":"string"},"user":{"type":"string"},"isLeft":{"type":"boolean"},"leftAt":{"type":"string"},"joinedAt":{"type":"string"},"roleCode":{"type":"number"},"createdAt":{"type":"string"},"statistic":{"type":"string"},"updatedAt":{"type":"string"},"isRemovedBy":{"type":"string"},"firstOrderAt":{"type":"string"},"searchString":{"type":"string"},"isMemberHomegrown":{"type":"boolean"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"teams","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"code":{"type":"string"},"desc":{"type":"string"},"logo":{"type":"string"},"name":{"type":"string"},"level":{"type":"string"},"active":{"type":"boolean"},"isFull":{"type":"boolean"},"cityCode":{"type":"number"},"adminUser":{"type":"string"},"createdAt":{"type":"string"},"statistic":{"type":"string"},"updatedAt":{"type":"string"},"inviteLink":{"type":"string"},"information":{"type":"string"},"searchString":{"type":"string"},"inactiveReason":{"type":"string"},"changingNameCount":{"type":"number"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"user-identifications","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"dob":{"type":"string"},"name":{"type":"string"},"note":{"type":"string"},"type":{"type":"string"},"user":{"type":"string"},"gender":{"type":"string"},"nation":{"type":"string"},"number":{"type":"string"},"status":{"type":"string"},"address":{"type":"string"},"dobDate":{"type":"string"},"backSide":{"type":"string"},"birthday":{"type":"string"},"createdAt":{"type":"string"},"frontSide":{"type":"string"},"issueDate":{"type":"string"},"updatedAt":{"type":"string"},"expiryDate":{"type":"string"},"issuePlace":{"type":"string"},"timeUpdate":{"type":"number"},"detectInformation":{"type":"string"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"users","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"code":{"type":"string"},"info":{"type":"string"},"name":{"type":"string"},"team":{"type":"string"},"zalo":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"avatar":{"type":"string"},"banned":{"type":"boolean"},"segment":{"type":"string"},"facebook":{"type":"string"},"hasOrder":{"type":"boolean"},"referral":{"type":"string"},"segments":{"type":"array"},"createdAt":{"type":"string"},"statistic":{"type":"string"},"updatedAt":{"type":"string"},"membership":{"type":"string"},"lastOrderAt":{"type":"string"},"firstOrderAt":{"type":"string"},"registerFrom":{"type":"string"},"searchString":{"type":"string"},"adjustTracker":{"type":"string"},"isUpdatedInfo":{"type":"boolean"},"identification":{"type":"string"},"lastActivatedAt":{"type":"string"},"lastViewNotificationAt":{"type":"string"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"voucher-bonus","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"user":{"type":"string"},"order":{"type":"string"},"title":{"type":"string"},"status":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"commission":{"type":"number"},"isRejected":{"type":"boolean"},"userVoucher":{"type":"string"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"vouchers","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"code":{"type":"string"},"desc":{"type":"string"},"logo":{"type":"string"},"type":{"type":"string"},"endAt":{"type":"string"},"title":{"type":"string"},"active":{"type":"boolean"},"covers":{"type":"array"},"options":{"type":"string"},"startAt":{"type":"string"},"applyFor":{"type":"string"},"articleID":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"searchString":{"type":"string"},"isApplyForOrderWholesale":{"type":"boolean"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"wards","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"city":{"type":"string"},"code":{"type":"number"},"name":{"type":"string"},"slug":{"type":"string"},"tncId":{"type":"number"},"cityId":{"type":"number"},"source":{"type":"string"},"tncCode":{"type":"string"},"district":{"type":"string"},"gidoCode":{"type":"number"},"osirisId":{"type":"number"},"updatedAt":{"type":"string"},"districtId":{"type":"number"},"provinceId":{"type":"number"},"searchString":{"type":"string"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]}]} \ No newline at end of file +{"streams":[{"stream":{"name":"admin-tags","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"color":{"type":"string"},"active":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"searchString":{"type":"string"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"cash-flows","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"hash":{"type":"string"},"user":{"type":"string"},"value":{"type":"number"},"action":{"type":"string"},"options":{"type":"object","properties":{"orderId":{"type":"string"},"orderCode":{"type":"string"},"giveGiftId":{"type":"string"},"giveGiftTitle":{"type":"string"},"userGiveGiftId":{"type":"string"}}},"category":{"type":"string"},"targetId":{"type":"string"},"createdAt":{"type":"string"},"isAudited":{"type":"boolean"},"updatedAt":{"type":"string"},"newBalance":{"type":"number"},"oldBalance":{"type":"number"},"targetType":{"type":"string"},"isProcessed":{"type":"boolean"},"processStatus":{"type":"string"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"cities","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"code":{"type":"number"},"name":{"type":"string"},"slug":{"type":"string"},"order":{"type":"number"},"tncId":{"type":"number"},"region":{"type":"string"},"source":{"type":"string"},"tempId":{"type":"number"},"tncCode":{"type":"string"},"osirisId":{"type":"number"},"updatedAt":{"type":"string"},"searchString":{"type":"string"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"customers","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"info":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"address":{"type":"string"},"companyName":{"type":"string"},"taxIdentificationNumber":{"type":"string"}}},"name":{"type":"string"},"user":{"type":"string"},"phone":{"type":"string"},"source":{"type":"string"},"location":{"type":"array"},"createdAt":{"type":"string"},"isDeleted":{"type":"boolean"},"statistic":{"type":"object","properties":{"expenseTotal":{"type":"number"},"transactionTotal_aibyte_transform":{"type":"string"},"transactionPending_aibyte_transform":{"type":"string"},"transactionSuccess_aibyte_transform":{"type":"string"},"transactionRejected_aibyte_transform":{"type":"string"}}},"updatedAt":{"type":"string"},"searchString":{"type":"string"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"districts","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"city":{"type":"string"},"code":{"type":"number"},"name":{"type":"string"},"slug":{"type":"string"},"tncId":{"type":"number"},"cityId":{"type":"number"},"source":{"type":"string"},"tncCode":{"type":"string"},"gidoCode":{"type":"number"},"osirisId":{"type":"number"},"updatedAt":{"type":"string"},"searchString":{"type":"string"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"event-rewards","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"cash":{"type":"number"},"type":{"type":"string"},"user":{"type":"string"},"event":{"type":"string"},"status":{"type":"string"},"options":{"type":"object","properties":{"order":{"type":"string"},"invitee":{"type":"string"},"percent":{"type":"number"},"referral":{"type":"string"},"minOrderValue":{"type":"number"},"minOrderToClaim":{"type":"number"}}},"createdAt":{"type":"string"},"updatedat":{"type":"string"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"events","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"code":{"type":"string"},"desc":{"type":"string"},"icon":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"dimensions":{"type":"object","properties":{"md":{"type":"object","properties":{"url":{"type":"string"},"width":{"type":"number"},"height":{"type":"number"}}},"sm":{"type":"object","properties":{"url":{"type":"string"},"width":{"type":"number"},"height":{"type":"number"}}}}}}},"name":{"type":"string"},"type":{"type":"string"},"cover":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"dimensions":{"type":"object","properties":{"md":{"type":"object","properties":{"url":{"type":"string"},"width":{"type":"number"},"height":{"type":"number"}}},"sm":{"type":"object","properties":{"url":{"type":"string"},"width":{"type":"number"},"height":{"type":"number"}}}}}}},"endAt":{"type":"string"},"active":{"type":"boolean"},"notice":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}}},"article":{"type":"string"},"options":{"type":"object","properties":{"cash":{"type":"number"},"percent":{"type":"number"},"validInDays":{"type":"number"},"minOrderValue":{"type":"number"},"minOrderToClaim":{"type":"number"},"userCreatedBeforeDate":{"type":"string"}}},"startAt":{"type":"string"},"segments":{"type":"object","properties":{"segments":{"type":"array"},"userSegment":{"type":"string"},"lastMonthSales":{"type":"object","properties":{"to":{"type":"number"},"from":{"type":"number"},"active":{"type":"boolean"}}},"highestMonthlySales":{"type":"object","properties":{"to":{"type":"number"},"from":{"type":"number"},"active":{"type":"boolean"}}}}},"createdAt":{"type":"string"},"suppliers":{"type":"array"},"updatedAt":{"type":"string"},"information":{"type":"array"},"displayEndAt":{"type":"string"},"isApplyForAll":{"type":"boolean"},"displayStartAt":{"type":"string"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"inventories","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"code":{"type":"number"},"name":{"type":"string"},"slug":{"type":"string"},"active":{"type":"boolean"},"contact":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"address":{"type":"string"}}},"partner":{"type":"object","properties":{"code":{"type":"string"},"identityCode":{"type":"string"}}},"checksum":{"type":"string"},"location":{"type":"object","properties":{"ward":{"type":"string"},"address":{"type":"string"},"district":{"type":"string"},"location":{"type":"object","properties":{"type":{"type":"string"},"coordinates":{"type":"array"}}},"province":{"type":"string"}}},"supplier":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"searchString":{"type":"string"}}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"minimumValue":{"type":"number"},"searchString":{"type":"string"},"paymentMethods":{"type":"object","properties":{"cod":{"type":"boolean"},"bankTransfer":{"type":"boolean"}}},"canIssueInvoice":{"type":"boolean"},"deliveryMethods":{"type":"array"},"canAutoSendEmail":{"type":"boolean"},"invoiceDeliveryMethod":{"type":"string"},"doesSupportSellyExpress":{"type":"boolean"},"priorityDeliveryServiceCodes":{"type":"array"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"membership","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"},"guide":{"type":"string"},"level":{"type":"number"},"sales":{"type":"number"},"active":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"transaction":{"type":"number"},"bonusPercent":{"type":"number"},"transactionMinValue":{"type":"number"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"membership-histories","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"new":{"type":"object","properties":{"name":{"type":"string"},"level":{"type":"number"},"condition":{"type":"object","properties":{"name":{"type":"string"},"sales":{"type":"number"},"transaction":{"type":"number"},"bonusPercent":{"type":"number"},"transactionMinValue":{"type":"number"}}},"statistic":{"type":"string"},"transaction":{"type":"number"},"bonusPercent":{"type":"number"},"transactionMinValue":{"type":"number"}}},"old":{"type":"object","properties":{"name":{"type":"string"},"level":{"type":"number"},"condition":{"type":"object","properties":{"name":{"type":"string"},"sales":{"type":"number"},"transaction":{"type":"number"},"bonusPercent":{"type":"number"},"transactionMinValue":{"type":"number"}}},"statistic":{"type":"object","properties":{"sales":{"type":"number"},"transaction":{"type":"number"}}},"transaction":{"type":"number"},"bonusPercent":{"type":"number"},"transactionMinValue":{"type":"number"}}},"type":{"type":"string"},"user":{"type":"string"},"createdAt":{"type":"string"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"membership-orders","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"user":{"type":"string"},"status":{"type":"string"},"percent":{"type":"number"},"targetID":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"commission":{"type":"number"},"isRejected":{"type":"boolean"},"membershipName":{"type":"string"},"membershipLevel":{"type":"number"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"order-deliveries","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"code":{"type":"string"},"order":{"type":"string"},"title":{"type":"string"},"status":{"type":"string"},"weight":{"type":"object","properties":{"real":{"type":"number"},"sent":{"type":"number"},"converted":{"type":"number"},"multiplier":{"type":"number"},"convertedWithMultiplier":{"type":"number"}}},"service":{"type":"string"},"customer":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"phone":{"type":"string"}}},"delivery":{"type":"object","properties":{"_id":{"type":"string"},"fee":{"type":"number"},"desc":{"type":"string"},"note":{"type":"string"},"feeShip":{"type":"object","properties":{"cod":{"type":"number"},"total":{"type":"number"},"shipping":{"type":"number"},"insurance":{"type":"number"}}},"currency":{"type":"string"},"courierName":{"type":"string"},"serviceCode":{"type":"string"},"serviceName":{"type":"string"},"deliveryCode":{"type":"string"},"maxDeliveryDays":{"type":"number"},"minDeliveryDays":{"type":"number"},"estimateTimeDelivery":{"type":"string"}}},"location":{"type":"object","properties":{"_id":{"type":"string"},"ward":{"type":"number"},"address":{"type":"string"},"district":{"type":"number"},"province":{"type":"number"},"fullAddress":{"type":"string"}}},"createdAt":{"type":"string"},"promotion":{"type":"object","properties":{"type":{"type":"string"},"discount":{"type":"number"},"isApplied":{"type":"boolean"},"minOrderValue":{"type":"number"}}},"updatedAt":{"type":"string"},"trackingCode":{"type":"string"},"trackingTime":{"type":"object","properties":{"pickedAt":{"type":"string"},"completedAt":{"type":"string"},"deliveringAt":{"type":"string"}}},"isAdminChange":{"type":"boolean"},"trackingOrderCode":{"type":"string"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"order-histories","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"order":{"type":"string"},"status":{"type":"string"},"createdAt":{"type":"string"},"timeStamp":{"type":"number"},"updatedAt":{"type":"string"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"order-items","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"sku":{"type":"object","properties":{"_id":{"type":"string"},"sku":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"source":{"type":"string"},"picture":{"type":"string"},"version":{"type":"number"},"properties":{"type":"array"}}},"date":{"type":"string"},"user":{"type":"string"},"order":{"type":"string"},"price":{"type":"object","properties":{"base":{"type":"number"},"sell":{"type":"number"},"market":{"type":"number"},"profit":{"type":"number"},"volume":{"type":"string"},"weight":{"type":"number"},"maximum":{"type":"number"},"minimum":{"type":"number"},"profitUni":{"type":"number"},"supplierPrice":{"type":"number"},"membershipPercent":{"type":"number"},"membershipCommission":{"type":"number"}}},"status":{"type":"string"},"product":{"type":"string"},"customer":{"type":"string"},"quantity":{"type":"number"},"createdAt":{"type":"string"},"totalSell":{"type":"number"},"updatedAt":{"type":"string"},"cashbackAt":{"type":"string"},"totalPrice":{"type":"number"},"deliveredAt":{"type":"string"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"orders","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"code":{"type":"string"},"date":{"type":"string"},"hour":{"type":"number"},"note":{"type":"string"},"skus":{"type":"array"},"tags":{"type":"array"},"user":{"type":"string"},"price":{"type":"object","properties":{"sell":{"type":"number"},"total":{"type":"number"},"market":{"type":"number"},"weight":{"type":"number"},"maximum":{"type":"number"},"minimum":{"type":"number"},"profitUni":{"type":"number"},"promotion":{"type":"number"},"supplierPrice":{"type":"number"},"wholesaleBonus":{"type":"number"},"membershipPercent":{"type":"number"},"membershipCommission":{"type":"number"},"base_aibyte_transform":{"type":"string"},"profit_aibyte_transform":{"type":"string"}}},"banned":{"type":"boolean"},"reason":{"type":"string"},"source":{"type":"string"},"status":{"type":"string"},"update":{"type":"string"},"payment":{"type":"object","properties":{"_id":{"type":"string"},"method":{"type":"string"},"status":{"type":"string"}}},"remarks":{"type":"string"},"customer":{"type":"string"},"delivery":{"type":"object","properties":{"_id":{"type":"string"},"fee":{"type":"number"},"code":{"type":"string"},"note":{"type":"string"},"title":{"type":"string"},"status":{"type":"string"},"weight":{"type":"object","properties":{"real":{"type":"number"},"sent":{"type":"number"},"converted":{"type":"number"},"multiplier":{"type":"number"},"convertedWithMultiplier":{"type":"number"}}},"feeShip":{"type":"object","properties":{"cod":{"type":"number"},"total":{"type":"number"},"shipping":{"type":"number"},"insurance":{"type":"number"}}},"currency":{"type":"string"},"freeShip":{"type":"boolean"},"location":{"type":"object","properties":{"_id":{"type":"string"},"ward":{"type":"number"},"address":{"type":"string"},"district":{"type":"number"},"province":{"type":"number"},"fullAddress":{"type":"string"}}},"sourceId":{"type":"number"},"courierName":{"type":"string"},"serviceCode":{"type":"string"},"serviceName":{"type":"string"},"customerName":{"type":"string"},"customerPhone":{"type":"string"},"discountValue":{"type":"number"},"serviceDelivery":{"type":"string"},"estimateDeliveryAt":{"type":"string"},"estimateTimeDelivery":{"type":"string"},"maxDeliveryDay_aibyte_transform":{"type":"string"},"minDeliveryDay_aibyte_transform":{"type":"string"}}},"pickupAt":{"type":"string"},"products":{"type":"array"},"supplier":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"searchString":{"type":"string"}}},"approveAt":{"type":"string"},"createdAt":{"type":"string"},"inventory":{"type":"object","properties":{"id":{"type":"number"},"_id":{"type":"string"},"name":{"type":"string"},"canIssueInvoice":{"type":"boolean"}}},"isDeleted":{"type":"boolean"},"promotion":{"type":"object","properties":{"type":{"type":"string"},"discount":{"type":"number"},"isApplied":{"type":"boolean"},"minOrderValue":{"type":"number"}}},"requestId":{"type":"string"},"sendEmail":{"type":"object","properties":{"status":{"type":"string"}}},"totalItem":{"type":"number"},"updatedAt":{"type":"string"},"userAgent":{"type":"object","properties":{"ip":{"type":"string"},"version":{"type":"string"},"platform":{"type":"string"}}},"wholesale":{"type":"boolean"},"approvedAt":{"type":"string"},"cashbackAt":{"type":"string"},"codeOsiris":{"type":"string"},"isPreorder":{"type":"boolean"},"membership":{"type":"string"},"rejectedAt":{"type":"string"},"deliveredAt":{"type":"string"},"deliveringAt":{"type":"string"},"deliveryCode":{"type":"string"},"searchString":{"type":"string"},"staffApprove":{"type":"string"},"trackingCode":{"type":"string"},"processStatus":{"type":"string"},"hookTimeLastAt":{"type":"string"},"trackingCodeURL":{"type":"string"},"approvePaymentAt":{"type":"string"},"isChangeDelivery":{"type":"boolean"},"trackingOrderCode":{"type":"string"},"estimateCashbackAt":{"type":"string"},"isWaitingCancelled":{"type":"boolean"},"fromNewActiveSeller":{"type":"boolean"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"product-categories","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"icon":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"dimensions":{"type":"object","properties":{"md":{"type":"object","properties":{"url":{"type":"string"},"width":{"type":"number"},"height":{"type":"number"}}},"sm":{"type":"object","properties":{"url":{"type":"string"},"width":{"type":"number"},"height":{"type":"number"}}}}}}},"name":{"type":"string"},"color":{"type":"string"},"order":{"type":"number"},"active":{"type":"boolean"},"covers":{"type":"array"},"featured":{"type":"boolean"},"createdAt":{"type":"string"},"statistic":{"type":"object","properties":{"salesTotal":{"type":"number"},"totalShare":{"type":"number"},"salesWeekTotal":{"type":"number"},"salesYearTotal":{"type":"number"},"salesMonthTotal":{"type":"number"},"salesTwoMonthTotal":{"type":"number"}}},"updatedAt":{"type":"string"},"totalProduct":{"type":"number"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"product-sku","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"sku":{"type":"string"},"info":{"type":"object","properties":{"weight":{"type":"number"},"category":{"type":"object","properties":{"id":{"type":"number"},"_id":{"type":"string"},"name":{"type":"string"},"searchString":{"type":"string"}}},"supplier":{"type":"object","properties":{"id":{"type":"number"},"_id":{"type":"string"},"name":{"type":"string"},"searchString":{"type":"string"}}},"dimension":{"type":"string"},"inventory":{"type":"object","properties":{"id":{"type":"number"},"_id":{"type":"string"},"name":{"type":"string"},"location":{"type":"object","properties":{"ward":{"type":"string"},"address":{"type":"string"},"district":{"type":"string"},"location":{"type":"object","properties":{"type":{"type":"string"},"coordinates":{"type":"array"}}},"province":{"type":"string"}}},"searchString":{"type":"string"}}}}},"name":{"type":"string"},"type":{"type":"string"},"brand":{"type":"string"},"cover":{"type":"string"},"price":{"type":"object","properties":{"base":{"type":"number"},"market":{"type":"number"},"profit":{"type":"number"},"maximum":{"type":"number"},"minimum":{"type":"number"},"supplier":{"type":"number"},"wholesaleBonus":{"type":"number"}}},"active":{"type":"boolean"},"author":{"type":"string"},"manual":{"type":"boolean"},"source":{"type":"string"},"display":{"type":"boolean"},"picture":{"type":"string"},"product":{"type":"string"},"version":{"type":"number"},"groupSku":{"type":"string"},"unitCode":{"type":"string"},"createdAt":{"type":"string"},"restockAt":{"type":"string"},"statistic":{"type":"object","properties":{"saleTotal":{"type":"number"},"salePending":{"type":"number"},"saleWaiting":{"type":"number"},"saleCashback":{"type":"number"},"saleCancelled":{"type":"number"},"saleDelivered":{"type":"number"},"saleDelivering":{"type":"number"},"salePaymentProcessing":{"type":"number"}}},"updatedAt":{"type":"string"},"properties":{"type":"array"},"canPreorder":{"type":"boolean"},"supplierSku":{"type":"string"},"isOutOfStock":{"type":"boolean"},"pricePercent":{"type":"object","properties":{"supplier":{"type":"number"},"minimumPriceDifferential":{"type":"number"}}},"searchString":{"type":"string"},"updateReason":{"type":"string"},"updateActiveId":{"type":"string"},"displayInventory":{"type":"boolean"},"showRemainingQuantity":{"type":"boolean"},"quantity_aibyte_transform":{"type":"string"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"product-sku-versions","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"sku":{"type":"string"},"info":{"type":"object","properties":{"weight":{"type":"number"},"category":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"searchString":{"type":"string"}}},"supplier":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"searchString":{"type":"string"}}},"dimension":{"type":"string"},"inventory":{"type":"object","properties":{"id":{"type":"number"},"_id":{"type":"string"},"name":{"type":"string"},"searchString":{"type":"string"}}}}},"name":{"type":"string"},"price":{"type":"object","properties":{"base":{"type":"number"},"market":{"type":"number"},"maximum":{"type":"number"},"minimum":{"type":"number"},"supplier":{"type":"number"}}},"source":{"type":"string"},"codeSku":{"type":"string"},"picture":{"type":"string"},"product":{"type":"string"},"version":{"type":"number"},"createdAt":{"type":"string"},"statistic":{"type":"object","properties":{"saleTotal":{"type":"number"},"salePending":{"type":"number"},"saleWaiting":{"type":"number"},"saleCashback":{"type":"number"},"saleCancelled":{"type":"number"},"saleDelivered":{"type":"number"},"saleDelivering":{"type":"number"},"salePaymentProcessing":{"type":"number"}}},"updatedAt":{"type":"string"},"properties":{"type":"array"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"product-sub-categories","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"order":{"type":"number"},"active":{"type":"boolean"},"parent":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"searchString":{"type":"string"},"totalProduct":{"type":"number"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"products","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"desc":{"type":"string"},"info":{"type":"object","properties":{"profit":{"type":"number"},"category":{"type":"object","properties":{"id":{"type":"number"},"_id":{"type":"string"},"name":{"type":"string"},"searchString":{"type":"string"}}},"supplier":{"type":"object","properties":{"id":{"type":"number"},"_id":{"type":"string"},"name":{"type":"string"},"searchString":{"type":"string"}}},"inventory":{"type":"object","properties":{"id":{"type":"number"},"_id":{"type":"string"},"name":{"type":"string"},"location":{"type":"object","properties":{"ward":{"type":"string"},"address":{"type":"string"},"district":{"type":"string"},"location":{"type":"object","properties":{"type":{"type":"string"},"coordinates":{"type":"array"}}},"province":{"type":"string"},"provinceName":{"type":"string"}}},"searchString":{"type":"string"}}}}},"name":{"type":"string"},"temp":{"type":"string"},"brand":{"type":"string"},"order":{"type":"object","properties":{"newest":{"type":"number"},"profit":{"type":"number"},"topSale":{"type":"number"},"scoreYesterday":{"type":"number"},"region_aibyte_transform":{"type":"string"}}},"price":{"type":"object","properties":{"base":{"type":"number"},"market":{"type":"number"},"profit":{"type":"number"},"maximum":{"type":"number"},"minimum":{"type":"number"},"supplier":{"type":"number"},"wholesaleBonus":{"type":"number"}}},"score":{"type":"object","properties":{"view":{"type":"number"},"order":{"type":"number"},"profit":{"type":"number"},"current":{"type":"number"}}},"active":{"type":"boolean"},"author":{"type":"string"},"guides":{"type":"array"},"photos":{"type":"array"},"videos":{"type":"array"},"quantity":{"type":"number"},"createdAt":{"type":"string"},"documents":{"type":"array"},"shareDesc":{"type":"string"},"statistic":{"type":"object","properties":{"view":{"type":"number"},"skuTotal":{"type":"number"},"saleTotal":{"type":"number"},"skuActive":{"type":"number"},"totalPost":{"type":"number"},"salesTotal":{"type":"number"},"salePending":{"type":"number"},"saleWaiting":{"type":"number"},"saleCashback":{"type":"number"},"saleCancelled":{"type":"number"},"saleDelivered":{"type":"number"},"saleWeekTotal":{"type":"number"},"saleYearTotal":{"type":"number"},"saleDelivering":{"type":"number"},"saleMonthTotal":{"type":"number"},"salesWeekTotal":{"type":"number"},"salesYearTotal":{"type":"number"},"salesMonthTotal":{"type":"number"},"saleTwoMonthTotal":{"type":"number"},"salesTwoMonthTotal":{"type":"number"},"salePaymentProcessing":{"type":"number"},"totalInventory_aibyte_transform":{"type":"string"}}},"updatedAt":{"type":"string"},"categories":{"type":"array"},"inactiveAt":{"type":"string"},"properties":{"type":"array"},"reActiveAt":{"type":"string"},"inventories":{"type":"array"},"displaySKUId":{"type":"string"},"isOutOfStock":{"type":"boolean"},"pricePercent":{"type":"object","properties":{"base":{"type":"number"},"selly":{"type":"number"},"market":{"type":"number"},"maximum":{"type":"number"},"minimum":{"type":"number"},"supplier":{"type":"number"},"minimumPriceDifferential":{"type":"number"}}},"searchString":{"type":"string"},"subCategories":{"type":"array"},"inactiveReason":{"type":"string"},"propertiesMain":{"type":"string"},"shareStatistic":{"type":"object","properties":{"totalShare":{"type":"number"},"totalShareFromSocialPost":{"type":"number"},"totalShareFromProductDetail":{"type":"number"},"totalUniqueShareFromSocialPost":{"type":"number"},"totalUniqueShareFromProductDetail":{"type":"number"}}},"updateActiveId":{"type":"string"},"canIssueInvoice":{"type":"boolean"},"pendingInactive":{"type":"boolean"},"reviewStatistic":{"type":"object","properties":{"total":{"type":"number"},"totalReview":{"type":"number"},"totalScore1":{"type":"number"},"totalScore2":{"type":"number"},"totalScore3":{"type":"number"},"totalScore4":{"type":"number"},"totalScore5":{"type":"number"},"scoreAverage":{"type":"number"},"totalHasMedia":{"type":"number"},"totalHasContent":{"type":"number"},"scoreAverageWeekTotal":{"type":"number"},"scoreAverageYearTotal":{"type":"number"},"scoreAverageMonthTotal":{"type":"number"},"scoreAverageTwoMonthTotal":{"type":"number"}}},"highlightProperties":{"type":"array"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"promotion-orders","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"user":{"type":"string"},"order":{"type":"string"},"title":{"type":"string"},"status":{"type":"string"},"supplier":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"searchString":{"type":"string"}}},"createdAt":{"type":"string"},"promotion":{"type":"string"},"updatedAt":{"type":"string"},"cashbackAt":{"type":"string"},"commission":{"type":"number"},"isRejected":{"type":"boolean"},"orderPriceTotal":{"type":"number"},"quantityPromotion":{"type":"number"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"promotions","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"code":{"type":"string"},"rest":{"type":"number"},"type":{"type":"string"},"endAt":{"type":"string"},"title":{"type":"string"},"active":{"type":"boolean"},"options":{"type":"object","properties":{"bonus":{"type":"object","properties":{"type":{"type":"string"},"value":{"type":"number"}}},"milestones":{"type":"array"},"supplierMilestones":{"type":"array"},"transactionMinValue":{"type":"number"}}},"startAt":{"type":"string"},"applyFor":{"type":"object","properties":{"list":{"type":"array"},"type":{"type":"string"},"provinces":{"type":"array"},"isApplyAllOrder":{"type":"boolean"}}},"quantity":{"type":"number"},"articleID":{"type":"string"},"createdAt":{"type":"string"},"statistic":{"type":"object","properties":{"nmv":{"type":"number"},"userTotal":{"type":"number"},"quantityPendingTotal":{"type":"number"},"quantitySuccessTotal":{"type":"number"},"quantityRejectedTotal":{"type":"number"},"commissionPendingTotal":{"type":"number"},"commissionSuccessTotal":{"type":"number"},"commissionRejectedTotal":{"type":"number"},"quantityNotRejectedTotal":{"type":"number"},"supplierCommissionPending":{"type":"number"},"supplierCommissionSuccess":{"type":"number"},"commissionNotRejectedTotal":{"type":"number"},"supplierCommissionNotRejected":{"type":"number"}}},"updatedAt":{"type":"string"},"searchString":{"type":"string"},"conditionForUser":{"type":"object","properties":{"gender":{"type":"string"},"applyFor":{"type":"string"},"segments":{"type":"array"}}},"supplierCommission":{"type":"object","properties":{"type":{"type":"string"},"value":{"type":"number"}}},"isUnlimitedQuantity":{"type":"boolean"},"maximumLimitPerUser":{"type":"number"},"milestonesStatistic":{"type":"array"},"isApplyForOrderWholesale":{"type":"boolean"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"referrals","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"user":{"type":"string"},"invitee":{"type":"string"},"createdAt":{"type":"string"},"fromSystem":{"type":"boolean"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"session-deliveries","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"cart":{"type":"string"},"note":{"type":"string"},"title":{"type":"string"},"request":{"type":"object","properties":{"to":{"type":"object","properties":{"name":{"type":"string"},"phone":{"type":"string"},"location":{"type":"object","properties":{"address":{"type":"string"},"wardCode":{"type":"number"},"districtCode":{"type":"number"},"provinceCode":{"type":"number"}}}}},"from":{"type":"object","properties":{"userId":{"type":"string"},"warehouseId":{"type":"string"}}},"items":{"type":"array"},"checksum":{"type":"string"},"codAmount":{"type":"number"},"orderCode":{"type":"string"},"restockAt":{"type":"string"},"isPreorder":{"type":"boolean"},"totalAmount":{"type":"number"},"paymentMethod":{"type":"string"}}},"service":{"type":"string"},"currency":{"type":"string"},"customer":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"phone":{"type":"string"}}},"delivery":{"type":"object","properties":{"_id":{"type":"string"},"fee":{"type":"number"},"desc":{"type":"string"},"note":{"type":"string"},"title":{"type":"string"},"feeShip":{"type":"object","properties":{"cod":{"type":"number"},"total":{"type":"number"},"shipping":{"type":"number"},"insurance":{"type":"number"}}},"currency":{"type":"string"},"sourceId":{"type":"number"},"courierName":{"type":"string"},"serviceCode":{"type":"string"},"serviceName":{"type":"string"},"deliveryCode":{"type":"string"},"maxDeliveryDays":{"type":"number"},"minDeliveryDays":{"type":"number"},"realShippingFee":{"type":"number"},"estimateTimeDelivery":{"type":"string"}}},"location":{"type":"object","properties":{"_id":{"type":"string"},"ward":{"type":"number"},"address":{"type":"string"},"district":{"type":"number"},"province":{"type":"number"},"fullAddress":{"type":"string"}}},"createdAt":{"type":"string"},"promotion":{"type":"object","properties":{"type":{"type":"string"},"discount":{"type":"number"},"isApplied":{"type":"boolean"},"minOrderValue":{"type":"number"}}},"sessionOrder":{"type":"string"},"paymentMethod":{"type":"string"},"estimateTimeDelivery":{"type":"string"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"social-post-views","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"user":{"type":"string"},"clientIP":{"type":"string"},"lastViewAt":{"type":"string"},"socialPost":{"type":"string"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"social-posts","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"tags":{"type":"array"},"isPin":{"type":"boolean"},"order":{"type":"number"},"title":{"type":"string"},"author":{"type":"string"},"cities":{"type":"array"},"photos":{"type":"array"},"reason":{"type":"string"},"status":{"type":"string"},"videos":{"type":"array"},"content":{"type":"string"},"isTimer":{"type":"boolean"},"startAt":{"type":"string"},"products":{"type":"array"},"createdAt":{"type":"string"},"hasUpdate":{"type":"boolean"},"statistic":{"type":"object","properties":{"likes":{"type":"number"},"views":{"type":"number"},"comments":{"type":"number"},"uniqueViews":{"type":"number"},"shares_aibyte_transform":{"type":"string"},"uniqueShares_aibyte_transform":{"type":"string"}}},"updatedAt":{"type":"string"},"categories":{"type":"array"},"fromSystem":{"type":"boolean"},"contributor":{"type":"string"},"publishedAt":{"type":"string"},"searchString":{"type":"string"},"updatedCount":{"type":"number"},"shareStatistic":{"type":"object","properties":{"totalShare":{"type":"number"},"totalShareFromSocialPost":{"type":"number"},"totalShareFromProductDetail":{"type":"number"},"totalUniqueShareFromSocialPost":{"type":"number"},"totalUniqueShareFromProductDetail":{"type":"number"}}},"enableNotificationForContributor":{"type":"boolean"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"suppliers","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"tax":{"type":"string"},"bank":{"type":"object","properties":{"bank":{"type":"string"},"branch":{"type":"string"},"cardNumber":{"type":"string"},"cardHolderName":{"type":"string"}}},"logo":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"dimensions":{"type":"object","properties":{"md":{"type":"object","properties":{"url":{"type":"string"},"width":{"type":"number"},"height":{"type":"number"}}},"sm":{"type":"object","properties":{"url":{"type":"string"},"width":{"type":"number"},"height":{"type":"number"}}}}}}},"name":{"type":"string"},"active":{"type":"boolean"},"balance":{"type":"object","properties":{"currentCash":{"type":"number"},"orderPendingCash":{"type":"number"},"totalPendingCash":{"type":"number"},"withdrawRejectCash":{"type":"number"},"orderReconciledCash":{"type":"number"},"withdrawPendingCash":{"type":"number"},"withdrawSuccessCash":{"type":"number"},"changeBalanceRequestApproved":{"type":"number"},"orderWaitingForReconcileCash":{"type":"number"}}},"checkSum":{"type":"string"},"checksum":{"type":"string"},"location":{"type":"object","properties":{"ward":{"type":"string"},"address":{"type":"string"},"district":{"type":"string"},"location":{"type":"string"},"province":{"type":"string"},"fullAddress":{"type":"string"}}},"contracts":{"type":"array"},"createdAt":{"type":"string"},"documents":{"type":"array"},"statistic":{"type":"object","properties":{"salesTotal":{"type":"number"},"salesPending":{"type":"number"},"salesSuccess":{"type":"number"},"totalProduct":{"type":"number"},"salesCancelled":{"type":"number"},"salesWeekTotal":{"type":"number"},"salesYearTotal":{"type":"number"},"totalInventory":{"type":"number"},"salesMonthTotal":{"type":"number"},"totalQuantitySale":{"type":"number"},"salesTwoMonthTotal":{"type":"number"},"totalHasOrderSeller":{"type":"number"}}},"updatedAt":{"type":"string"},"categories":{"type":"array"},"inventories":{"type":"array"},"identifyCode":{"type":"number"},"searchString":{"type":"string"},"reconcileDays":{"type":"array"},"contractNumber":{"type":"string"},"reviewStatistic":{"type":"object","properties":{"total":{"type":"number"},"totalReview":{"type":"number"},"totalScore1":{"type":"number"},"totalScore2":{"type":"number"},"totalScore3":{"type":"number"},"totalScore4":{"type":"number"},"totalScore5":{"type":"number"},"scoreAverage":{"type":"number"},"totalHasMedia":{"type":"number"},"totalHasContent":{"type":"number"},"scoreAverageWeekTotal":{"type":"number"},"scoreAverageYearTotal":{"type":"number"},"scoreAverageMonthTotal":{"type":"number"},"scoreAverageTwoMonthTotal":{"type":"number"}}},"contractSignedAt":{"type":"string"},"emailForInvoices":{"type":"array"},"contractExpiredAt":{"type":"string"},"sendInvoiceRequestEveryDay":{"type":"boolean"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"team-activities","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"team":{"type":"string"},"action":{"type":"string"},"options":{"type":"object","properties":{"name":{"type":"string"},"role":{"type":"string"}}},"targetId":{"type":"string"},"createdAt":{"type":"string"},"createdBy":{"type":"string"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"team-bonus","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"team":{"type":"string"},"user":{"type":"string"},"status":{"type":"string"},"percent":{"type":"number"},"targetId":{"type":"string"},"teamName":{"type":"string"},"createdAt":{"type":"string"},"teamLevel":{"type":"number"},"updatedAt":{"type":"string"},"commission":{"type":"number"},"teamMember":{"type":"string"},"teamPromotion":{"type":"string"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"team-members","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"role":{"type":"string"},"team":{"type":"string"},"user":{"type":"string"},"isLeft":{"type":"boolean"},"leftAt":{"type":"string"},"joinedAt":{"type":"string"},"roleCode":{"type":"number"},"createdAt":{"type":"string"},"statistic":{"type":"object","properties":{"sales":{"type":"number"},"transactionTotal":{"type":"number"},"transactionPending":{"type":"number"},"transactionSuccess":{"type":"number"},"transactionRejected":{"type":"number"},"cashTransactionTotal":{"type":"number"},"transactionDelivered":{"type":"number"},"transactionDelivering":{"type":"number"},"cashTransactionPending":{"type":"number"},"cashTransactionSuccess":{"type":"number"},"cashTransactionRejected":{"type":"number"},"cashTransactionDelivered":{"type":"number"},"cashTransactionDelivering":{"type":"number"},"transactionWaitingApprove":{"type":"number"},"transactionPaymentProcessing":{"type":"number"},"cashTransactionWaitingApprove":{"type":"number"},"thisMonthSale_aibyte_transform":{"type":"string"},"lastMonthSales_aibyte_transform":{"type":"string"},"thisMonthSales_aibyte_transform":{"type":"string"},"cashTransactionPaymentProcessing":{"type":"number"}}},"updatedAt":{"type":"string"},"isRemovedBy":{"type":"string"},"searchString":{"type":"string"},"statisticMonth":{"type":"object","properties":{"sales":{"type":"number"},"thisMonthSale":{"type":"number"},"transactionTotal":{"type":"number"},"transactionPending":{"type":"number"},"transactionSuccess":{"type":"number"},"transactionRejected":{"type":"number"},"cashTransactionTotal":{"type":"number"},"transactionDelivered":{"type":"number"},"transactionDelivering":{"type":"number"},"cashTransactionPending":{"type":"number"},"cashTransactionSuccess":{"type":"number"},"cashTransactionRejected":{"type":"number"},"cashTransactionDelivered":{"type":"number"},"cashTransactionDelivering":{"type":"number"},"transactionWaitingApprove":{"type":"number"},"transactionPaymentProcessing":{"type":"number"},"cashTransactionWaitingApprove":{"type":"number"},"cashTransactionPaymentProcessing":{"type":"number"}}}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"teams","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"code":{"type":"string"},"desc":{"type":"string"},"logo":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"dimensions":{"type":"object","properties":{"md":{"type":"object","properties":{"url":{"type":"string"},"width":{"type":"number"},"height":{"type":"number"}}},"sm":{"type":"object","properties":{"url":{"type":"string"},"width":{"type":"number"},"height":{"type":"number"}}}}}}},"name":{"type":"string"},"temp":{"type":"string"},"level":{"type":"object","properties":{"name":{"type":"string"},"color":{"type":"string"},"level":{"type":"number"},"expiredAt":{"type":"string"},"nextLevel":{"type":"number"},"bonusPercent":{"type":"number"},"maximumVipMember":{"type":"number"},"levelAtStartOfMonth":{"type":"number"},"maximumNumberMember":{"type":"number"},"maximumNumberViceLeader":{"type":"number"}}},"active":{"type":"boolean"},"isFull":{"type":"boolean"},"cityCode":{"type":"number"},"adminUser":{"type":"string"},"createdAt":{"type":"string"},"statistic":{"type":"object","properties":{"sales":{"type":"number"},"memberTotal":{"type":"number"},"lastMonthSales":{"type":"number"},"thisMonthSales":{"type":"number"},"transactionTotal":{"type":"number"},"transactionPending":{"type":"number"},"transactionSuccess":{"type":"number"},"transactionRejected":{"type":"number"},"cashTransactionTotal":{"type":"number"},"memberTotalRemaining":{"type":"number"},"transactionDelivered":{"type":"number"},"transactionDelivering":{"type":"number"},"cashTransactionPending":{"type":"number"},"cashTransactionSuccess":{"type":"number"},"cashTransactionRejected":{"type":"number"},"cashTransactionDelivered":{"type":"number"},"cashTransactionDelivering":{"type":"number"},"transactionWaitingApprove":{"type":"number"},"transactionPaymentProcessing":{"type":"number"},"cashTransactionWaitingApprove":{"type":"number"},"thisMonthSale_aibyte_transform":{"type":"string"},"vipMemberTotal_aibyte_transform":{"type":"string"},"cashTransactionPaymentProcessing":{"type":"number"},"memberRequestTotalPending_aibyte_transform":{"type":"string"}}},"updatedAt":{"type":"string"},"inviteLink":{"type":"string"},"information":{"type":"object","properties":{"communicationChannel":{"type":"string"}}},"searchString":{"type":"string"},"inactiveReason":{"type":"string"},"changingNameCount":{"type":"number"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"user-identifications","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"dob":{"type":"string"},"name":{"type":"string"},"note":{"type":"string"},"type":{"type":"string"},"user":{"type":"string"},"gender":{"type":"string"},"nation":{"type":"string"},"number":{"type":"string"},"status":{"type":"string"},"address":{"type":"string"},"backSide":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"dimensions":{"type":"object","properties":{"md":{"type":"object","properties":{"url":{"type":"string"},"width":{"type":"number"},"height":{"type":"number"}}},"sm":{"type":"object","properties":{"url":{"type":"string"},"width":{"type":"number"},"height":{"type":"number"}}}}}}},"birthday":{"type":"string"},"createdAt":{"type":"string"},"frontSide":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"dimensions":{"type":"object","properties":{"md":{"type":"object","properties":{"url":{"type":"string"},"width":{"type":"number"},"height":{"type":"number"}}},"sm":{"type":"object","properties":{"url":{"type":"string"},"width":{"type":"number"},"height":{"type":"number"}}}}}}},"issueDate":{"type":"string"},"updatedAt":{"type":"string"},"expiryDate":{"type":"string"},"issuePlace":{"type":"string"},"timeUpdate":{"type":"number"},"detectInformation":{"type":"object","properties":{"id":{"type":"string"},"dob":{"type":"string"},"doe":{"type":"string"},"sex":{"type":"string"},"home":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"idProb":{"type":"string"},"address":{"type":"string"},"dobProb":{"type":"string"},"doeProb":{"type":"string"},"sexProb":{"type":"string"},"typeNew":{"type":"string"},"homeProb":{"type":"string"},"nameProb":{"type":"string"},"addressProb":{"type":"string"},"nationality":{"type":"string"},"overallScore":{"type":"string"},"addressEntities":{"type":"object","properties":{"ward":{"type":"string"},"street":{"type":"string"},"district":{"type":"string"},"province":{"type":"string"}}},"nationalityProb":{"type":"string"}}}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"users","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"code":{"type":"string"},"info":{"type":"object","properties":{"email":{"type":"string"},"gender":{"type":"string"},"cityCode":{"type":"number"}}},"name":{"type":"string"},"team":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"role":{"type":"string"}}},"zalo":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"photo":{"type":"string"},"token":{"type":"string"}}},"email":{"type":"object","properties":{"email":{"type":"string"},"verified":{"type":"boolean"},"verifiedAt":{"type":"string"}}},"phone":{"type":"object","properties":{"full":{"type":"string"},"number":{"type":"string"},"verified":{"type":"boolean"},"verifiedAt":{"type":"string"},"countryCode":{"type":"string"}}},"avatar":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"dimensions":{"type":"object","properties":{"md":{"type":"object","properties":{"url":{"type":"string"},"width":{"type":"number"},"height":{"type":"number"}}},"sm":{"type":"object","properties":{"url":{"type":"string"},"width":{"type":"number"},"height":{"type":"number"}}}}}}},"banned":{"type":"boolean"},"segment":{"type":"string"},"facebook":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"photo":{"type":"string"},"token":{"type":"string"},"gender":{"type":"string"}}},"hasOrder":{"type":"boolean"},"referral":{"type":"object","properties":{"code":{"type":"string"},"enabled":{"type":"boolean"},"enabledAt":{"type":"string"},"shareContent":{"type":"string"}}},"segments":{"type":"array"},"createdAt":{"type":"string"},"statistic":{"type":"object","properties":{"cashTotal":{"type":"number"},"cashPending":{"type":"number"},"cashCashback":{"type":"number"},"cashGiveGift":{"type":"number"},"cashRejected":{"type":"number"},"taxTotalCash":{"type":"number"},"totalGiftBox":{"type":"number"},"totalTickets":{"type":"number"},"cashCancelled":{"type":"number"},"cashDelivered":{"type":"number"},"cashRemaining":{"type":"number"},"customerTotal":{"type":"number"},"totalCartItem":{"type":"number"},"withdrawTotal":{"type":"number"},"cashDelivering":{"type":"number"},"taxCashPending":{"type":"number"},"withdrawPending":{"type":"number"},"withdrawSuccess":{"type":"number"},"revenueLastMonth":{"type":"number"},"totalSaleSuccess":{"type":"number"},"transactionTotal":{"type":"number"},"withdrawRejected":{"type":"number"},"cashWithdrawTotal":{"type":"number"},"cashWaitingApprove":{"type":"number"},"transactionPending":{"type":"number"},"transactionSuccess":{"type":"number"},"cashWithdrawPending":{"type":"number"},"cashWithdrawSuccess":{"type":"number"},"highestMonthlySales":{"type":"number"},"transactionRejected":{"type":"number"},"cashWithdrawRejected":{"type":"number"},"teamBonusPendingCash":{"type":"number"},"teamBonusSuccessCash":{"type":"number"},"transactionDelivered":{"type":"number"},"cashPaymentProcessing":{"type":"number"},"transactionDelivering":{"type":"number"},"eventRewardPendingCash":{"type":"number"},"eventRewardSuccessCash":{"type":"number"},"transactionCashPending":{"type":"number"},"voucherBonusPendingCash":{"type":"number"},"voucherBonusSuccessCash":{"type":"number"},"eventReferralPendingCash":{"type":"number"},"eventReferralSuccessCash":{"type":"number"},"promotionBonusPendingCash":{"type":"number"},"promotionBonusSuccessCash":{"type":"number"},"transactionWaitingApprove":{"type":"number"},"commissionTransactionTotal":{"type":"number"},"membershipBonusPendingCash":{"type":"number"},"membershipBonusSuccessCash":{"type":"number"},"commissionTransactionPending":{"type":"number"},"transactionPaymentProcessing":{"type":"number"},"commissionTransactionCashback":{"type":"number"},"commissionTransactionRejected":{"type":"number"},"commissionTransactionDelivered":{"type":"number"},"commissionTransactionDelivering":{"type":"number"},"revenueThisMonth_aibyte_transform":{"type":"string"}}},"updatedAt":{"type":"string"},"membership":{"type":"object","properties":{"expireAt":{"type":"string"},"nextLevel":{"type":"number"},"currentLevel":{"type":"number"},"currentTransactionCount":{"type":"number"},"currentSales_aibyte_transform":{"type":"string"}}},"registerFrom":{"type":"string"},"searchString":{"type":"string"},"isUpdatedInfo":{"type":"boolean"},"identification":{"type":"object","properties":{"_id":{"type":"string"},"note":{"type":"string"},"status":{"type":"string"},"timeUpdate":{"type":"number"},"completedAt":{"type":"string"}}},"lastActivatedAt":{"type":"string"},"lastViewNotificationAt":{"type":"string"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"voucher-bonus","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"user":{"type":"string"},"order":{"type":"string"},"title":{"type":"string"},"status":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"commission":{"type":"number"},"isRejected":{"type":"boolean"},"userVoucher":{"type":"string"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"vouchers","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"code":{"type":"string"},"desc":{"type":"string"},"logo":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"dimensions":{"type":"object","properties":{"md":{"type":"object","properties":{"url":{"type":"string"},"width":{"type":"number"},"height":{"type":"number"}}},"sm":{"type":"object","properties":{"url":{"type":"string"},"width":{"type":"number"},"height":{"type":"number"}}}}}}},"type":{"type":"string"},"endAt":{"type":"string"},"title":{"type":"string"},"active":{"type":"boolean"},"covers":{"type":"array"},"options":{"type":"object","properties":{"bonus":{"type":"object","properties":{"type":{"type":"string"},"value":{"type":"number"}}},"milestones":{"type":"array"},"transactionMinValue":{"type":"number"}}},"startAt":{"type":"string"},"applyFor":{"type":"object","properties":{"list":{"type":"array"},"type":{"type":"string"},"provinces":{"type":"string"},"isApplyAllOrder":{"type":"boolean"}}},"articleID":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"searchString":{"type":"string"},"isApplyForOrderWholesale":{"type":"boolean"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]},{"stream":{"name":"wards","json_schema":{"type":"object","properties":{"_id":{"type":"string"},"city":{"type":"string"},"code":{"type":"number"},"name":{"type":"string"},"slug":{"type":"string"},"tncId":{"type":"number"},"cityId":{"type":"number"},"source":{"type":"string"},"tncCode":{"type":"string"},"district":{"type":"string"},"gidoCode":{"type":"number"},"osirisId":{"type":"number"},"updatedAt":{"type":"string"},"districtId":{"type":"number"},"provinceId":{"type":"number"},"searchString":{"type":"string"}}},"supported_sync_modes":["full_refresh","incremental"],"default_cursor_field":[],"source_defined_primary_key":[],"namespace":"unibag"},"sync_mode":"full_refresh","cursor_field":[],"destination_sync_mode":"overwrite","primary_key":[]}]} \ No newline at end of file diff --git a/macros/cross_db_utils/datatypes.sql b/macros/cross_db_utils/datatypes.sql index 07600de..18e2d61 100644 --- a/macros/cross_db_utils/datatypes.sql +++ b/macros/cross_db_utils/datatypes.sql @@ -33,7 +33,7 @@ {%- endmacro -%} {%- macro sqlserver__type_json() -%} - VARCHAR(max) + NVARCHAR(max) {%- endmacro -%} {% macro clickhouse__type_json() %} @@ -52,7 +52,7 @@ {%- endmacro -%} {% macro sqlserver__type_string() %} - VARCHAR(max) + NVARCHAR(max) {%- endmacro -%} {%- macro clickhouse__type_string() -%} @@ -154,7 +154,7 @@ {%- macro sqlserver__type_timestamp_with_timezone() -%} {#-- 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 --#} - datetime + datetime2 {%- endmacro -%} {% macro clickhouse__type_timestamp_with_timezone() %} diff --git a/models/generated/airbyte_ctes/unibag/cash_flows_ab1.sql b/models/generated/airbyte_ctes/unibag/cash_flows_ab1.sql index 0bd7698..f34eb81 100644 --- a/models/generated/airbyte_ctes/unibag/cash_flows_ab1.sql +++ b/models/generated/airbyte_ctes/unibag/cash_flows_ab1.sql @@ -12,7 +12,7 @@ select {{ json_extract_scalar('_airbyte_data', ['user'], ['user']) }} as {{ adapter.quote('user') }}, {{ json_extract_scalar('_airbyte_data', ['value'], ['value']) }} as {{ adapter.quote('value') }}, {{ json_extract_scalar('_airbyte_data', ['action'], ['action']) }} as {{ adapter.quote('action') }}, - {{ json_extract_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', ['targetId'], ['targetId']) }} as targetid, {{ json_extract_scalar('_airbyte_data', ['createdAt'], ['createdAt']) }} as createdat, diff --git a/models/generated/airbyte_ctes/unibag/cash_flows_ab2.sql b/models/generated/airbyte_ctes/unibag/cash_flows_ab2.sql index 25e9b92..a2aeaf4 100644 --- a/models/generated/airbyte_ctes/unibag/cash_flows_ab2.sql +++ b/models/generated/airbyte_ctes/unibag/cash_flows_ab2.sql @@ -12,7 +12,7 @@ select cast({{ adapter.quote('user') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('user') }}, cast({{ adapter.quote('value') }} as {{ dbt_utils.type_float() }}) as {{ adapter.quote('value') }}, cast({{ adapter.quote('action') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('action') }}, - cast({{ adapter.quote('options') }} as {{ 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(targetid as {{ dbt_utils.type_string() }}) as targetid, cast(createdat as {{ dbt_utils.type_string() }}) as createdat, diff --git a/models/generated/airbyte_ctes/unibag/cash_flows_ab3.sql b/models/generated/airbyte_ctes/unibag/cash_flows_ab3.sql index c4f4b73..9cad6df 100644 --- a/models/generated/airbyte_ctes/unibag/cash_flows_ab3.sql +++ b/models/generated/airbyte_ctes/unibag/cash_flows_ab3.sql @@ -13,7 +13,7 @@ select adapter.quote('user'), adapter.quote('value'), adapter.quote('action'), - adapter.quote('options'), + object_to_string(adapter.quote('options')), 'category', 'targetid', 'createdat', diff --git a/models/generated/airbyte_ctes/unibag/cash_flows_options_ab1.sql b/models/generated/airbyte_ctes/unibag/cash_flows_options_ab1.sql new file mode 100644 index 0000000..3c013d9 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/cash_flows_options_ab1.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/cash_flows_options_ab2.sql b/models/generated/airbyte_ctes/unibag/cash_flows_options_ab2.sql new file mode 100644 index 0000000..88fa715 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/cash_flows_options_ab2.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/cash_flows_options_ab3.sql b/models/generated/airbyte_ctes/unibag/cash_flows_options_ab3.sql new file mode 100644 index 0000000..5030208 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/cash_flows_options_ab3.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/customers_ab1.sql b/models/generated/airbyte_ctes/unibag/customers_ab1.sql index 977ea06..57df4a8 100644 --- a/models/generated/airbyte_ctes/unibag/customers_ab1.sql +++ b/models/generated/airbyte_ctes/unibag/customers_ab1.sql @@ -8,16 +8,15 @@ -- depends_on: {{ source('unibag', '_airbyte_raw_customers') }} select {{ 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', ['user'], ['user']) }} as {{ adapter.quote('user') }}, - {{ json_extract_scalar('_airbyte_data', ['email'], ['email']) }} as email, {{ json_extract_scalar('_airbyte_data', ['phone'], ['phone']) }} as phone, {{ json_extract_scalar('_airbyte_data', ['source'], ['source']) }} as {{ adapter.quote('source') }}, {{ json_extract_array('_airbyte_data', ['location'], ['location']) }} as {{ adapter.quote('location') }}, {{ json_extract_scalar('_airbyte_data', ['createdAt'], ['createdAt']) }} as createdat, {{ json_extract_scalar('_airbyte_data', ['isDeleted'], ['isDeleted']) }} as isdeleted, - {{ json_extract_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', ['searchString'], ['searchString']) }} as searchstring, _airbyte_ab_id, diff --git a/models/generated/airbyte_ctes/unibag/customers_ab2.sql b/models/generated/airbyte_ctes/unibag/customers_ab2.sql index c4ca101..2a64dae 100644 --- a/models/generated/airbyte_ctes/unibag/customers_ab2.sql +++ b/models/generated/airbyte_ctes/unibag/customers_ab2.sql @@ -8,16 +8,15 @@ -- depends_on: {{ ref('customers_ab1') }} select 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('user') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('user') }}, - cast(email as {{ dbt_utils.type_string() }}) as email, cast(phone as {{ dbt_utils.type_string() }}) as phone, cast({{ adapter.quote('source') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('source') }}, {{ adapter.quote('location') }}, cast(createdat as {{ dbt_utils.type_string() }}) as createdat, {{ cast_to_boolean('isdeleted') }} as isdeleted, - cast(statistic as {{ dbt_utils.type_string() }}) as statistic, + cast(statistic as {{ type_json() }}) as statistic, cast(updatedat as {{ dbt_utils.type_string() }}) as updatedat, cast(searchstring as {{ dbt_utils.type_string() }}) as searchstring, _airbyte_ab_id, diff --git a/models/generated/airbyte_ctes/unibag/customers_ab3.sql b/models/generated/airbyte_ctes/unibag/customers_ab3.sql index c980251..ca9f1fb 100644 --- a/models/generated/airbyte_ctes/unibag/customers_ab3.sql +++ b/models/generated/airbyte_ctes/unibag/customers_ab3.sql @@ -9,16 +9,15 @@ select {{ dbt_utils.surrogate_key([ '_id', - 'info', + object_to_string('info'), adapter.quote('name'), adapter.quote('user'), - 'email', 'phone', adapter.quote('source'), array_to_string(adapter.quote('location')), 'createdat', boolean_to_string('isdeleted'), - 'statistic', + object_to_string('statistic'), 'updatedat', 'searchstring', ]) }} as _airbyte_customers_hashid, diff --git a/models/generated/airbyte_ctes/unibag/customers_info_ab1.sql b/models/generated/airbyte_ctes/unibag/customers_info_ab1.sql new file mode 100644 index 0000000..e91f2d5 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/customers_info_ab1.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/customers_info_ab2.sql b/models/generated/airbyte_ctes/unibag/customers_info_ab2.sql new file mode 100644 index 0000000..53eb2d7 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/customers_info_ab2.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/customers_info_ab3.sql b/models/generated/airbyte_ctes/unibag/customers_info_ab3.sql new file mode 100644 index 0000000..a92f980 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/customers_info_ab3.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/customers_statistic_ab1.sql b/models/generated/airbyte_ctes/unibag/customers_statistic_ab1.sql new file mode 100644 index 0000000..75e9329 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/customers_statistic_ab1.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/customers_statistic_ab2.sql b/models/generated/airbyte_ctes/unibag/customers_statistic_ab2.sql new file mode 100644 index 0000000..aa46106 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/customers_statistic_ab2.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/customers_statistic_ab3.sql b/models/generated/airbyte_ctes/unibag/customers_statistic_ab3.sql new file mode 100644 index 0000000..821b13d --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/customers_statistic_ab3.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/event_rewards_ab1.sql b/models/generated/airbyte_ctes/unibag/event_rewards_ab1.sql index fa06cec..a3339f7 100644 --- a/models/generated/airbyte_ctes/unibag/event_rewards_ab1.sql +++ b/models/generated/airbyte_ctes/unibag/event_rewards_ab1.sql @@ -13,7 +13,7 @@ select {{ json_extract_scalar('_airbyte_data', ['user'], ['user']) }} as {{ adapter.quote('user') }}, {{ json_extract_scalar('_airbyte_data', ['event'], ['event']) }} as {{ adapter.quote('event') }}, {{ json_extract_scalar('_airbyte_data', ['status'], ['status']) }} as status, - {{ json_extract_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', ['updatedat'], ['updatedat']) }} as updatedat, _airbyte_ab_id, diff --git a/models/generated/airbyte_ctes/unibag/event_rewards_ab2.sql b/models/generated/airbyte_ctes/unibag/event_rewards_ab2.sql index bfcdc1a..3cacd54 100644 --- a/models/generated/airbyte_ctes/unibag/event_rewards_ab2.sql +++ b/models/generated/airbyte_ctes/unibag/event_rewards_ab2.sql @@ -13,7 +13,7 @@ select cast({{ adapter.quote('user') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('user') }}, cast({{ adapter.quote('event') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('event') }}, cast(status as {{ dbt_utils.type_string() }}) as status, - cast({{ adapter.quote('options') }} as {{ 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(updatedat as {{ dbt_utils.type_string() }}) as updatedat, _airbyte_ab_id, diff --git a/models/generated/airbyte_ctes/unibag/event_rewards_ab3.sql b/models/generated/airbyte_ctes/unibag/event_rewards_ab3.sql index 95be1f6..8b45880 100644 --- a/models/generated/airbyte_ctes/unibag/event_rewards_ab3.sql +++ b/models/generated/airbyte_ctes/unibag/event_rewards_ab3.sql @@ -14,7 +14,7 @@ select adapter.quote('user'), adapter.quote('event'), 'status', - adapter.quote('options'), + object_to_string(adapter.quote('options')), 'createdat', 'updatedat', ]) }} as _airbyte_event_rewards_hashid, diff --git a/models/generated/airbyte_ctes/unibag/event_rewards_options_ab1.sql b/models/generated/airbyte_ctes/unibag/event_rewards_options_ab1.sql new file mode 100644 index 0000000..452e880 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/event_rewards_options_ab1.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/event_rewards_options_ab2.sql b/models/generated/airbyte_ctes/unibag/event_rewards_options_ab2.sql new file mode 100644 index 0000000..531999b --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/event_rewards_options_ab2.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/event_rewards_options_ab3.sql b/models/generated/airbyte_ctes/unibag/event_rewards_options_ab3.sql new file mode 100644 index 0000000..9de8ca8 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/event_rewards_options_ab3.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/events_ab1.sql b/models/generated/airbyte_ctes/unibag/events_ab1.sql index 3966a3a..eeb8789 100644 --- a/models/generated/airbyte_ctes/unibag/events_ab1.sql +++ b/models/generated/airbyte_ctes/unibag/events_ab1.sql @@ -8,21 +8,20 @@ -- depends_on: {{ source('unibag', '_airbyte_raw_events') }} select {{ json_extract_scalar('_airbyte_data', ['_id'], ['_id']) }} as _id, + {{ json_extract_scalar('_airbyte_data', ['code'], ['code']) }} as code, {{ json_extract_scalar('_airbyte_data', ['desc'], ['desc']) }} as {{ adapter.quote('desc') }}, - {{ json_extract_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', ['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', ['active'], ['active']) }} as active, - {{ json_extract_scalar('_airbyte_data', ['notice'], ['notice']) }} as notice, - {{ json_extract_scalar('_airbyte_data', ['screen'], ['screen']) }} as screen, + {{ json_extract('table_alias', '_airbyte_data', ['notice'], ['notice']) }} as notice, {{ 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', ['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', ['groupType'], ['groupType']) }} as grouptype, {{ json_extract_array('_airbyte_data', ['suppliers'], ['suppliers']) }} as suppliers, {{ json_extract_scalar('_airbyte_data', ['updatedAt'], ['updatedAt']) }} as updatedat, {{ json_extract_array('_airbyte_data', ['information'], ['information']) }} as information, diff --git a/models/generated/airbyte_ctes/unibag/events_ab2.sql b/models/generated/airbyte_ctes/unibag/events_ab2.sql index 3a43ded..a9447e2 100644 --- a/models/generated/airbyte_ctes/unibag/events_ab2.sql +++ b/models/generated/airbyte_ctes/unibag/events_ab2.sql @@ -8,21 +8,20 @@ -- depends_on: {{ ref('events_ab1') }} select cast(_id as {{ dbt_utils.type_string() }}) as _id, + cast(code as {{ dbt_utils.type_string() }}) as code, cast({{ adapter.quote('desc') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('desc') }}, - cast(icon as {{ 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('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_to_boolean('active') }} as active, - cast(notice as {{ dbt_utils.type_string() }}) as notice, - cast(screen as {{ dbt_utils.type_string() }}) as screen, + cast(notice as {{ type_json() }}) as notice, 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(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(grouptype as {{ dbt_utils.type_string() }}) as grouptype, suppliers, cast(updatedat as {{ dbt_utils.type_string() }}) as updatedat, information, diff --git a/models/generated/airbyte_ctes/unibag/events_ab3.sql b/models/generated/airbyte_ctes/unibag/events_ab3.sql index d7029d7..441f568 100644 --- a/models/generated/airbyte_ctes/unibag/events_ab3.sql +++ b/models/generated/airbyte_ctes/unibag/events_ab3.sql @@ -9,21 +9,20 @@ select {{ dbt_utils.surrogate_key([ '_id', + 'code', adapter.quote('desc'), - 'icon', + object_to_string('icon'), adapter.quote('name'), adapter.quote('type'), - 'cover', + object_to_string('cover'), 'endat', boolean_to_string('active'), - 'notice', - 'screen', + object_to_string('notice'), 'article', - adapter.quote('options'), + object_to_string(adapter.quote('options')), 'startat', - 'segments', + object_to_string('segments'), 'createdat', - 'grouptype', array_to_string('suppliers'), 'updatedat', array_to_string('information'), diff --git a/models/generated/airbyte_ctes/unibag/events_cover_ab1.sql b/models/generated/airbyte_ctes/unibag/events_cover_ab1.sql new file mode 100644 index 0000000..03e056a --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/events_cover_ab1.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/events_cover_ab2.sql b/models/generated/airbyte_ctes/unibag/events_cover_ab2.sql new file mode 100644 index 0000000..c9565fe --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/events_cover_ab2.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/events_cover_ab3.sql b/models/generated/airbyte_ctes/unibag/events_cover_ab3.sql new file mode 100644 index 0000000..380b3c4 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/events_cover_ab3.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/events_cover_dimensions_ab1.sql b/models/generated/airbyte_ctes/unibag/events_cover_dimensions_ab1.sql new file mode 100644 index 0000000..a2135f0 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/events_cover_dimensions_ab1.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/events_cover_dimensions_ab2.sql b/models/generated/airbyte_ctes/unibag/events_cover_dimensions_ab2.sql new file mode 100644 index 0000000..b143fd9 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/events_cover_dimensions_ab2.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/events_cover_dimensions_ab3.sql b/models/generated/airbyte_ctes/unibag/events_cover_dimensions_ab3.sql new file mode 100644 index 0000000..896e403 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/events_cover_dimensions_ab3.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/events_cover_dimensions_md_ab1.sql b/models/generated/airbyte_ctes/unibag/events_cover_dimensions_md_ab1.sql new file mode 100644 index 0000000..aa9052f --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/events_cover_dimensions_md_ab1.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/events_cover_dimensions_md_ab2.sql b/models/generated/airbyte_ctes/unibag/events_cover_dimensions_md_ab2.sql new file mode 100644 index 0000000..2cba577 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/events_cover_dimensions_md_ab2.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/events_cover_dimensions_md_ab3.sql b/models/generated/airbyte_ctes/unibag/events_cover_dimensions_md_ab3.sql new file mode 100644 index 0000000..f54ae0c --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/events_cover_dimensions_md_ab3.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/events_cover_dimensions_sm_ab1.sql b/models/generated/airbyte_ctes/unibag/events_cover_dimensions_sm_ab1.sql new file mode 100644 index 0000000..3b4c0ee --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/events_cover_dimensions_sm_ab1.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/events_cover_dimensions_sm_ab2.sql b/models/generated/airbyte_ctes/unibag/events_cover_dimensions_sm_ab2.sql new file mode 100644 index 0000000..e9026d9 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/events_cover_dimensions_sm_ab2.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/events_cover_dimensions_sm_ab3.sql b/models/generated/airbyte_ctes/unibag/events_cover_dimensions_sm_ab3.sql new file mode 100644 index 0000000..c8089c5 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/events_cover_dimensions_sm_ab3.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/events_icon_ab1.sql b/models/generated/airbyte_ctes/unibag/events_icon_ab1.sql new file mode 100644 index 0000000..18af009 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/events_icon_ab1.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/events_icon_ab2.sql b/models/generated/airbyte_ctes/unibag/events_icon_ab2.sql new file mode 100644 index 0000000..a77e79c --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/events_icon_ab2.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/events_icon_ab3.sql b/models/generated/airbyte_ctes/unibag/events_icon_ab3.sql new file mode 100644 index 0000000..2e2fb46 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/events_icon_ab3.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/events_icon_dimensions_ab1.sql b/models/generated/airbyte_ctes/unibag/events_icon_dimensions_ab1.sql new file mode 100644 index 0000000..345eeae --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/events_icon_dimensions_ab1.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/events_icon_dimensions_ab2.sql b/models/generated/airbyte_ctes/unibag/events_icon_dimensions_ab2.sql new file mode 100644 index 0000000..2ce1ad9 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/events_icon_dimensions_ab2.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/events_icon_dimensions_ab3.sql b/models/generated/airbyte_ctes/unibag/events_icon_dimensions_ab3.sql new file mode 100644 index 0000000..987b78c --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/events_icon_dimensions_ab3.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/events_icon_dimensions_md_ab1.sql b/models/generated/airbyte_ctes/unibag/events_icon_dimensions_md_ab1.sql new file mode 100644 index 0000000..2365eaf --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/events_icon_dimensions_md_ab1.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/events_icon_dimensions_md_ab2.sql b/models/generated/airbyte_ctes/unibag/events_icon_dimensions_md_ab2.sql new file mode 100644 index 0000000..27ff870 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/events_icon_dimensions_md_ab2.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/events_icon_dimensions_md_ab3.sql b/models/generated/airbyte_ctes/unibag/events_icon_dimensions_md_ab3.sql new file mode 100644 index 0000000..a11535f --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/events_icon_dimensions_md_ab3.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/events_icon_dimensions_sm_ab1.sql b/models/generated/airbyte_ctes/unibag/events_icon_dimensions_sm_ab1.sql new file mode 100644 index 0000000..111ce53 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/events_icon_dimensions_sm_ab1.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/events_icon_dimensions_sm_ab2.sql b/models/generated/airbyte_ctes/unibag/events_icon_dimensions_sm_ab2.sql new file mode 100644 index 0000000..23656ae --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/events_icon_dimensions_sm_ab2.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/events_icon_dimensions_sm_ab3.sql b/models/generated/airbyte_ctes/unibag/events_icon_dimensions_sm_ab3.sql new file mode 100644 index 0000000..63ee724 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/events_icon_dimensions_sm_ab3.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/events_notice_ab1.sql b/models/generated/airbyte_ctes/unibag/events_notice_ab1.sql new file mode 100644 index 0000000..3ab46da --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/events_notice_ab1.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/events_notice_ab2.sql b/models/generated/airbyte_ctes/unibag/events_notice_ab2.sql new file mode 100644 index 0000000..8f5b505 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/events_notice_ab2.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/events_notice_ab3.sql b/models/generated/airbyte_ctes/unibag/events_notice_ab3.sql new file mode 100644 index 0000000..b04e613 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/events_notice_ab3.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/events_options_ab1.sql b/models/generated/airbyte_ctes/unibag/events_options_ab1.sql new file mode 100644 index 0000000..24da485 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/events_options_ab1.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/events_options_ab2.sql b/models/generated/airbyte_ctes/unibag/events_options_ab2.sql new file mode 100644 index 0000000..51dd1ef --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/events_options_ab2.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/events_options_ab3.sql b/models/generated/airbyte_ctes/unibag/events_options_ab3.sql new file mode 100644 index 0000000..4505b41 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/events_options_ab3.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/events_segments_ab1.sql b/models/generated/airbyte_ctes/unibag/events_segments_ab1.sql new file mode 100644 index 0000000..8ce10f9 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/events_segments_ab1.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/events_segments_ab2.sql b/models/generated/airbyte_ctes/unibag/events_segments_ab2.sql new file mode 100644 index 0000000..476f25d --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/events_segments_ab2.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/events_segments_ab3.sql b/models/generated/airbyte_ctes/unibag/events_segments_ab3.sql new file mode 100644 index 0000000..9a2c306 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/events_segments_ab3.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/events_segments_highestmonthlysales_ab1.sql b/models/generated/airbyte_ctes/unibag/events_segments_highestmonthlysales_ab1.sql new file mode 100644 index 0000000..4907802 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/events_segments_highestmonthlysales_ab1.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/events_segments_highestmonthlysales_ab2.sql b/models/generated/airbyte_ctes/unibag/events_segments_highestmonthlysales_ab2.sql new file mode 100644 index 0000000..9694438 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/events_segments_highestmonthlysales_ab2.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/events_segments_highestmonthlysales_ab3.sql b/models/generated/airbyte_ctes/unibag/events_segments_highestmonthlysales_ab3.sql new file mode 100644 index 0000000..8864501 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/events_segments_highestmonthlysales_ab3.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/events_segments_lastmonthsales_ab1.sql b/models/generated/airbyte_ctes/unibag/events_segments_lastmonthsales_ab1.sql new file mode 100644 index 0000000..ea23485 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/events_segments_lastmonthsales_ab1.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/events_segments_lastmonthsales_ab2.sql b/models/generated/airbyte_ctes/unibag/events_segments_lastmonthsales_ab2.sql new file mode 100644 index 0000000..112d1e0 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/events_segments_lastmonthsales_ab2.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/events_segments_lastmonthsales_ab3.sql b/models/generated/airbyte_ctes/unibag/events_segments_lastmonthsales_ab3.sql new file mode 100644 index 0000000..5a5f590 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/events_segments_lastmonthsales_ab3.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/inventories_ab1.sql b/models/generated/airbyte_ctes/unibag/inventories_ab1.sql index e064db0..599b106 100644 --- a/models/generated/airbyte_ctes/unibag/inventories_ab1.sql +++ b/models/generated/airbyte_ctes/unibag/inventories_ab1.sql @@ -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 -- depends_on: {{ source('unibag', '_airbyte_raw_inventories') }} select - {{ json_extract_scalar('_airbyte_data', ['id'], ['id']) }} as {{ adapter.quote('id') }}, {{ json_extract_scalar('_airbyte_data', ['_id'], ['_id']) }} as _id, {{ json_extract_scalar('_airbyte_data', ['code'], ['code']) }} as code, {{ json_extract_scalar('_airbyte_data', ['name'], ['name']) }} as {{ adapter.quote('name') }}, {{ json_extract_scalar('_airbyte_data', ['slug'], ['slug']) }} as slug, {{ json_extract_scalar('_airbyte_data', ['active'], ['active']) }} as active, - {{ json_extract_scalar('_airbyte_data', ['contact'], ['contact']) }} as contact, - {{ json_extract_scalar('_airbyte_data', ['partner'], ['partner']) }} as partner, + {{ json_extract('table_alias', '_airbyte_data', ['contact'], ['contact']) }} as contact, + {{ json_extract('table_alias', '_airbyte_data', ['partner'], ['partner']) }} as partner, {{ json_extract_scalar('_airbyte_data', ['checksum'], ['checksum']) }} as checksum, - {{ json_extract_scalar('_airbyte_data', ['location'], ['location']) }} as {{ adapter.quote('location') }}, - {{ json_extract_scalar('_airbyte_data', ['supplier'], ['supplier']) }} as supplier, + {{ json_extract('table_alias', '_airbyte_data', ['location'], ['location']) }} as {{ adapter.quote('location') }}, + {{ json_extract('table_alias', '_airbyte_data', ['supplier'], ['supplier']) }} as supplier, {{ json_extract_scalar('_airbyte_data', ['createdAt'], ['createdAt']) }} as createdat, {{ json_extract_scalar('_airbyte_data', ['updatedAt'], ['updatedAt']) }} as updatedat, {{ json_extract_scalar('_airbyte_data', ['minimumValue'], ['minimumValue']) }} as minimumvalue, {{ json_extract_scalar('_airbyte_data', ['searchString'], ['searchString']) }} as searchstring, - {{ json_extract_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_array('_airbyte_data', ['deliveryMethods'], ['deliveryMethods']) }} as deliverymethods, {{ json_extract_scalar('_airbyte_data', ['canAutoSendEmail'], ['canAutoSendEmail']) }} as canautosendemail, diff --git a/models/generated/airbyte_ctes/unibag/inventories_ab2.sql b/models/generated/airbyte_ctes/unibag/inventories_ab2.sql index b8968d3..1dd2309 100644 --- a/models/generated/airbyte_ctes/unibag/inventories_ab2.sql +++ b/models/generated/airbyte_ctes/unibag/inventories_ab2.sql @@ -7,22 +7,21 @@ -- SQL model to cast each column to its adequate SQL type converted from the JSON schema type -- depends_on: {{ ref('inventories_ab1') }} select - cast({{ adapter.quote('id') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('id') }}, cast(_id as {{ dbt_utils.type_string() }}) as _id, cast(code as {{ dbt_utils.type_float() }}) as code, cast({{ adapter.quote('name') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('name') }}, cast(slug as {{ dbt_utils.type_string() }}) as slug, {{ cast_to_boolean('active') }} as active, - cast(contact as {{ dbt_utils.type_string() }}) as contact, - cast(partner as {{ dbt_utils.type_string() }}) as partner, + cast(contact as {{ type_json() }}) as contact, + cast(partner as {{ type_json() }}) as partner, cast(checksum as {{ dbt_utils.type_string() }}) as checksum, - cast({{ adapter.quote('location') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('location') }}, - cast(supplier as {{ dbt_utils.type_string() }}) as supplier, + cast({{ adapter.quote('location') }} as {{ type_json() }}) as {{ adapter.quote('location') }}, + cast(supplier as {{ type_json() }}) as supplier, cast(createdat as {{ dbt_utils.type_string() }}) as createdat, cast(updatedat as {{ dbt_utils.type_string() }}) as updatedat, cast(minimumvalue as {{ dbt_utils.type_float() }}) as minimumvalue, cast(searchstring as {{ dbt_utils.type_string() }}) as searchstring, - cast(paymentmethods as {{ dbt_utils.type_string() }}) as paymentmethods, + cast(paymentmethods as {{ type_json() }}) as paymentmethods, {{ cast_to_boolean('canissueinvoice') }} as canissueinvoice, deliverymethods, {{ cast_to_boolean('canautosendemail') }} as canautosendemail, diff --git a/models/generated/airbyte_ctes/unibag/inventories_ab3.sql b/models/generated/airbyte_ctes/unibag/inventories_ab3.sql index c0e65e2..02d85a4 100644 --- a/models/generated/airbyte_ctes/unibag/inventories_ab3.sql +++ b/models/generated/airbyte_ctes/unibag/inventories_ab3.sql @@ -8,22 +8,21 @@ -- depends_on: {{ ref('inventories_ab2') }} select {{ dbt_utils.surrogate_key([ - adapter.quote('id'), '_id', 'code', adapter.quote('name'), 'slug', boolean_to_string('active'), - 'contact', - 'partner', + object_to_string('contact'), + object_to_string('partner'), 'checksum', - adapter.quote('location'), - 'supplier', + object_to_string(adapter.quote('location')), + object_to_string('supplier'), 'createdat', 'updatedat', 'minimumvalue', 'searchstring', - 'paymentmethods', + object_to_string('paymentmethods'), boolean_to_string('canissueinvoice'), array_to_string('deliverymethods'), boolean_to_string('canautosendemail'), diff --git a/models/generated/airbyte_ctes/unibag/inventories_contact_ab1.sql b/models/generated/airbyte_ctes/unibag/inventories_contact_ab1.sql new file mode 100644 index 0000000..712460d --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/inventories_contact_ab1.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/inventories_contact_ab2.sql b/models/generated/airbyte_ctes/unibag/inventories_contact_ab2.sql new file mode 100644 index 0000000..ef58581 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/inventories_contact_ab2.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/inventories_contact_ab3.sql b/models/generated/airbyte_ctes/unibag/inventories_contact_ab3.sql new file mode 100644 index 0000000..c0bd3fd --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/inventories_contact_ab3.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/inventories_location_ab1.sql b/models/generated/airbyte_ctes/unibag/inventories_location_ab1.sql new file mode 100644 index 0000000..8d39f10 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/inventories_location_ab1.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/inventories_location_ab2.sql b/models/generated/airbyte_ctes/unibag/inventories_location_ab2.sql new file mode 100644 index 0000000..098af26 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/inventories_location_ab2.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/inventories_location_ab3.sql b/models/generated/airbyte_ctes/unibag/inventories_location_ab3.sql new file mode 100644 index 0000000..a2780d9 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/inventories_location_ab3.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/inventories_location_location_ab1.sql b/models/generated/airbyte_ctes/unibag/inventories_location_location_ab1.sql new file mode 100644 index 0000000..8765b55 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/inventories_location_location_ab1.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/inventories_location_location_ab2.sql b/models/generated/airbyte_ctes/unibag/inventories_location_location_ab2.sql new file mode 100644 index 0000000..84b4e66 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/inventories_location_location_ab2.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/inventories_location_location_ab3.sql b/models/generated/airbyte_ctes/unibag/inventories_location_location_ab3.sql new file mode 100644 index 0000000..1c725fd --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/inventories_location_location_ab3.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/inventories_partner_ab1.sql b/models/generated/airbyte_ctes/unibag/inventories_partner_ab1.sql new file mode 100644 index 0000000..cad39ce --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/inventories_partner_ab1.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/inventories_partner_ab2.sql b/models/generated/airbyte_ctes/unibag/inventories_partner_ab2.sql new file mode 100644 index 0000000..46abaf1 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/inventories_partner_ab2.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/inventories_partner_ab3.sql b/models/generated/airbyte_ctes/unibag/inventories_partner_ab3.sql new file mode 100644 index 0000000..44bf88c --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/inventories_partner_ab3.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/inventories_paymentmethods_ab1.sql b/models/generated/airbyte_ctes/unibag/inventories_paymentmethods_ab1.sql new file mode 100644 index 0000000..3fab4cb --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/inventories_paymentmethods_ab1.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/inventories_paymentmethods_ab2.sql b/models/generated/airbyte_ctes/unibag/inventories_paymentmethods_ab2.sql new file mode 100644 index 0000000..ca4ecaa --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/inventories_paymentmethods_ab2.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/inventories_paymentmethods_ab3.sql b/models/generated/airbyte_ctes/unibag/inventories_paymentmethods_ab3.sql new file mode 100644 index 0000000..9f41dce --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/inventories_paymentmethods_ab3.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/inventories_supplier_ab1.sql b/models/generated/airbyte_ctes/unibag/inventories_supplier_ab1.sql new file mode 100644 index 0000000..d9e3844 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/inventories_supplier_ab1.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/inventories_supplier_ab2.sql b/models/generated/airbyte_ctes/unibag/inventories_supplier_ab2.sql new file mode 100644 index 0000000..384390d --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/inventories_supplier_ab2.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/inventories_supplier_ab3.sql b/models/generated/airbyte_ctes/unibag/inventories_supplier_ab3.sql new file mode 100644 index 0000000..e30e872 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/inventories_supplier_ab3.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/membership_ab1.sql b/models/generated/airbyte_ctes/unibag/membership_ab1.sql index ce7d6ce..8d189b2 100644 --- a/models/generated/airbyte_ctes/unibag/membership_ab1.sql +++ b/models/generated/airbyte_ctes/unibag/membership_ab1.sql @@ -16,10 +16,8 @@ select {{ json_extract_scalar('_airbyte_data', ['active'], ['active']) }} as active, {{ json_extract_scalar('_airbyte_data', ['createdAt'], ['createdAt']) }} as createdat, {{ json_extract_scalar('_airbyte_data', ['updatedAt'], ['updatedAt']) }} as updatedat, - {{ json_extract_scalar('_airbyte_data', ['updatedat'], ['updatedat']) }} as updatedat_1, {{ json_extract_scalar('_airbyte_data', ['transaction'], ['transaction']) }} as {{ adapter.quote('transaction') }}, {{ json_extract_scalar('_airbyte_data', ['bonusPercent'], ['bonusPercent']) }} as bonuspercent, - {{ json_extract_scalar('_airbyte_data', ['bonuspercent'], ['bonuspercent']) }} as bonuspercent_1, {{ json_extract_scalar('_airbyte_data', ['transactionMinValue'], ['transactionMinValue']) }} as transactionminvalue, _airbyte_ab_id, _airbyte_emitted_at, diff --git a/models/generated/airbyte_ctes/unibag/membership_ab2.sql b/models/generated/airbyte_ctes/unibag/membership_ab2.sql index 60c1e91..0bf0a3e 100644 --- a/models/generated/airbyte_ctes/unibag/membership_ab2.sql +++ b/models/generated/airbyte_ctes/unibag/membership_ab2.sql @@ -16,10 +16,8 @@ select {{ cast_to_boolean('active') }} as active, cast(createdat as {{ dbt_utils.type_string() }}) as createdat, cast(updatedat as {{ dbt_utils.type_string() }}) as updatedat, - cast(updatedat_1 as {{ dbt_utils.type_string() }}) as updatedat_1, cast({{ adapter.quote('transaction') }} as {{ dbt_utils.type_float() }}) as {{ adapter.quote('transaction') }}, cast(bonuspercent as {{ dbt_utils.type_float() }}) as bonuspercent, - cast(bonuspercent_1 as {{ dbt_utils.type_float() }}) as bonuspercent_1, cast(transactionminvalue as {{ dbt_utils.type_float() }}) as transactionminvalue, _airbyte_ab_id, _airbyte_emitted_at, diff --git a/models/generated/airbyte_ctes/unibag/membership_ab3.sql b/models/generated/airbyte_ctes/unibag/membership_ab3.sql index 44e9ab5..7d0a7f7 100644 --- a/models/generated/airbyte_ctes/unibag/membership_ab3.sql +++ b/models/generated/airbyte_ctes/unibag/membership_ab3.sql @@ -17,10 +17,8 @@ select boolean_to_string('active'), 'createdat', 'updatedat', - 'updatedat_1', adapter.quote('transaction'), 'bonuspercent', - 'bonuspercent_1', 'transactionminvalue', ]) }} as _airbyte_membership_hashid, tmp.* diff --git a/models/generated/airbyte_ctes/unibag/membership_histories_ab1.sql b/models/generated/airbyte_ctes/unibag/membership_histories_ab1.sql index c920079..3b39e41 100644 --- a/models/generated/airbyte_ctes/unibag/membership_histories_ab1.sql +++ b/models/generated/airbyte_ctes/unibag/membership_histories_ab1.sql @@ -8,8 +8,8 @@ -- depends_on: {{ source('unibag', '_airbyte_raw_membership_histories') }} select {{ json_extract_scalar('_airbyte_data', ['_id'], ['_id']) }} as _id, - {{ json_extract_scalar('_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', ['new'], ['new']) }} as {{ adapter.quote('new') }}, + {{ 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', ['user'], ['user']) }} as {{ adapter.quote('user') }}, {{ json_extract_scalar('_airbyte_data', ['createdAt'], ['createdAt']) }} as createdat, diff --git a/models/generated/airbyte_ctes/unibag/membership_histories_ab2.sql b/models/generated/airbyte_ctes/unibag/membership_histories_ab2.sql index 2453c8d..a63c6d6 100644 --- a/models/generated/airbyte_ctes/unibag/membership_histories_ab2.sql +++ b/models/generated/airbyte_ctes/unibag/membership_histories_ab2.sql @@ -8,8 +8,8 @@ -- depends_on: {{ ref('membership_histories_ab1') }} select cast(_id as {{ dbt_utils.type_string() }}) as _id, - cast({{ adapter.quote('new') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('new') }}, - cast({{ adapter.quote('old') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('old') }}, + cast({{ adapter.quote('new') }} as {{ type_json() }}) as {{ adapter.quote('new') }}, + cast({{ adapter.quote('old') }} as {{ type_json() }}) as {{ adapter.quote('old') }}, cast({{ adapter.quote('type') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('type') }}, cast({{ adapter.quote('user') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('user') }}, cast(createdat as {{ dbt_utils.type_string() }}) as createdat, diff --git a/models/generated/airbyte_ctes/unibag/membership_histories_ab3.sql b/models/generated/airbyte_ctes/unibag/membership_histories_ab3.sql index 49f6c05..b52156c 100644 --- a/models/generated/airbyte_ctes/unibag/membership_histories_ab3.sql +++ b/models/generated/airbyte_ctes/unibag/membership_histories_ab3.sql @@ -9,8 +9,8 @@ select {{ dbt_utils.surrogate_key([ '_id', - adapter.quote('new'), - adapter.quote('old'), + object_to_string(adapter.quote('new')), + object_to_string(adapter.quote('old')), adapter.quote('type'), adapter.quote('user'), 'createdat', diff --git a/models/generated/airbyte_ctes/unibag/membership_histories_new_ab1.sql b/models/generated/airbyte_ctes/unibag/membership_histories_new_ab1.sql new file mode 100644 index 0000000..cbdf08a --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/membership_histories_new_ab1.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/membership_histories_new_ab2.sql b/models/generated/airbyte_ctes/unibag/membership_histories_new_ab2.sql new file mode 100644 index 0000000..02c4c25 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/membership_histories_new_ab2.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/membership_histories_new_ab3.sql b/models/generated/airbyte_ctes/unibag/membership_histories_new_ab3.sql new file mode 100644 index 0000000..bf21d95 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/membership_histories_new_ab3.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/membership_histories_new_condition_ab1.sql b/models/generated/airbyte_ctes/unibag/membership_histories_new_condition_ab1.sql new file mode 100644 index 0000000..a23046a --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/membership_histories_new_condition_ab1.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/membership_histories_new_condition_ab2.sql b/models/generated/airbyte_ctes/unibag/membership_histories_new_condition_ab2.sql new file mode 100644 index 0000000..b704a36 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/membership_histories_new_condition_ab2.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/membership_histories_new_condition_ab3.sql b/models/generated/airbyte_ctes/unibag/membership_histories_new_condition_ab3.sql new file mode 100644 index 0000000..6c7146d --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/membership_histories_new_condition_ab3.sql @@ -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 + diff --git a/models/generated/airbyte_ctes/unibag/membership_histories_old_ab1.sql b/models/generated/airbyte_ctes/unibag/membership_histories_old_ab1.sql new file mode 100644 index 0000000..d478077 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/membership_histories_old_ab1.sql @@ -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('old'), ['name'], ['name']) }} as {{ adapter.quote('name') }}, + {{ json_extract_scalar(adapter.quote('old'), ['level'], ['level']) }} as {{ adapter.quote('level') }}, + {{ json_extract('table_alias', adapter.quote('old'), ['condition'], ['condition']) }} as {{ adapter.quote('condition') }}, + {{ json_extract('table_alias', adapter.quote('old'), ['statistic'], ['statistic']) }} as statistic, + {{ json_extract_scalar(adapter.quote('old'), ['transaction'], ['transaction']) }} as {{ adapter.quote('transaction') }}, + {{ json_extract_scalar(adapter.quote('old'), ['bonusPercent'], ['bonusPercent']) }} as bonuspercent, + {{ json_extract_scalar(adapter.quote('old'), ['transactionMinValue'], ['transactionMinValue']) }} as transactionminvalue, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('membership_histories') }} as table_alias +-- old at membership-histories/old +where 1 = 1 +and {{ adapter.quote('old') }} is not null + diff --git a/models/generated/airbyte_ctes/unibag/membership_histories_old_ab2.sql b/models/generated/airbyte_ctes/unibag/membership_histories_old_ab2.sql new file mode 100644 index 0000000..f867a5f --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/membership_histories_old_ab2.sql @@ -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_old_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 {{ type_json() }}) 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_old_ab1') }} +-- old at membership-histories/old +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/membership_histories_old_ab3.sql b/models/generated/airbyte_ctes/unibag/membership_histories_old_ab3.sql new file mode 100644 index 0000000..a0ebf7c --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/membership_histories_old_ab3.sql @@ -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_old_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_membership_histories_hashid', + adapter.quote('name'), + adapter.quote('level'), + object_to_string(adapter.quote('condition')), + object_to_string('statistic'), + adapter.quote('transaction'), + 'bonuspercent', + 'transactionminvalue', + ]) }} as _airbyte_old_hashid, + tmp.* +from {{ ref('membership_histories_old_ab2') }} tmp +-- old at membership-histories/old +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/membership_histories_old_condition_ab1.sql b/models/generated/airbyte_ctes/unibag/membership_histories_old_condition_ab1.sql new file mode 100644 index 0000000..040f975 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/membership_histories_old_condition_ab1.sql @@ -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_old') }} +select + _airbyte_old_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_old') }} as table_alias +-- condition at membership-histories/old/condition +where 1 = 1 +and {{ adapter.quote('condition') }} is not null + diff --git a/models/generated/airbyte_ctes/unibag/membership_histories_old_condition_ab2.sql b/models/generated/airbyte_ctes/unibag/membership_histories_old_condition_ab2.sql new file mode 100644 index 0000000..2ec45f6 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/membership_histories_old_condition_ab2.sql @@ -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_old_condition_ab1') }} +select + _airbyte_old_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_old_condition_ab1') }} +-- condition at membership-histories/old/condition +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/membership_histories_old_condition_ab3.sql b/models/generated/airbyte_ctes/unibag/membership_histories_old_condition_ab3.sql new file mode 100644 index 0000000..c876afc --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/membership_histories_old_condition_ab3.sql @@ -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_old_condition_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_old_hashid', + adapter.quote('name'), + 'sales', + adapter.quote('transaction'), + 'bonuspercent', + 'transactionminvalue', + ]) }} as _airbyte_condition_hashid, + tmp.* +from {{ ref('membership_histories_old_condition_ab2') }} tmp +-- condition at membership-histories/old/condition +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/membership_histories_old_statistic_ab1.sql b/models/generated/airbyte_ctes/unibag/membership_histories_old_statistic_ab1.sql new file mode 100644 index 0000000..061f020 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/membership_histories_old_statistic_ab1.sql @@ -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('membership_histories_old') }} +select + _airbyte_old_hashid, + {{ json_extract_scalar('statistic', ['sales'], ['sales']) }} as sales, + {{ json_extract_scalar('statistic', ['transaction'], ['transaction']) }} as {{ adapter.quote('transaction') }}, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('membership_histories_old') }} as table_alias +-- statistic at membership-histories/old/statistic +where 1 = 1 +and statistic is not null + diff --git a/models/generated/airbyte_ctes/unibag/membership_histories_old_statistic_ab2.sql b/models/generated/airbyte_ctes/unibag/membership_histories_old_statistic_ab2.sql new file mode 100644 index 0000000..9541651 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/membership_histories_old_statistic_ab2.sql @@ -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('membership_histories_old_statistic_ab1') }} +select + _airbyte_old_hashid, + cast(sales as {{ dbt_utils.type_float() }}) as sales, + cast({{ adapter.quote('transaction') }} as {{ dbt_utils.type_float() }}) as {{ adapter.quote('transaction') }}, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('membership_histories_old_statistic_ab1') }} +-- statistic at membership-histories/old/statistic +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/membership_histories_old_statistic_ab3.sql b/models/generated/airbyte_ctes/unibag/membership_histories_old_statistic_ab3.sql new file mode 100644 index 0000000..9aec091 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/membership_histories_old_statistic_ab3.sql @@ -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('membership_histories_old_statistic_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_old_hashid', + 'sales', + adapter.quote('transaction'), + ]) }} as _airbyte_statistic_hashid, + tmp.* +from {{ ref('membership_histories_old_statistic_ab2') }} tmp +-- statistic at membership-histories/old/statistic +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/membership_orders_ab1.sql b/models/generated/airbyte_ctes/unibag/membership_orders_ab1.sql index 1f7b78c..80c8290 100644 --- a/models/generated/airbyte_ctes/unibag/membership_orders_ab1.sql +++ b/models/generated/airbyte_ctes/unibag/membership_orders_ab1.sql @@ -18,7 +18,6 @@ select {{ json_extract_scalar('_airbyte_data', ['isRejected'], ['isRejected']) }} as isrejected, {{ json_extract_scalar('_airbyte_data', ['membershipName'], ['membershipName']) }} as membershipname, {{ json_extract_scalar('_airbyte_data', ['membershipLevel'], ['membershipLevel']) }} as membershiplevel, - {{ json_extract_scalar('_airbyte_data', ['membershipPromotion'], ['membershipPromotion']) }} as membershippromotion, _airbyte_ab_id, _airbyte_emitted_at, {{ current_timestamp() }} as _airbyte_normalized_at diff --git a/models/generated/airbyte_ctes/unibag/membership_orders_ab2.sql b/models/generated/airbyte_ctes/unibag/membership_orders_ab2.sql index 9235cee..9f30b26 100644 --- a/models/generated/airbyte_ctes/unibag/membership_orders_ab2.sql +++ b/models/generated/airbyte_ctes/unibag/membership_orders_ab2.sql @@ -18,7 +18,6 @@ select {{ cast_to_boolean('isrejected') }} as isrejected, cast(membershipname as {{ dbt_utils.type_string() }}) as membershipname, cast(membershiplevel as {{ dbt_utils.type_float() }}) as membershiplevel, - cast({{ adapter.quote('membershippromotion') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('membershippromotion') }}, _airbyte_ab_id, _airbyte_emitted_at, {{ current_timestamp() }} as _airbyte_normalized_at diff --git a/models/generated/airbyte_ctes/unibag/membership_orders_ab3.sql b/models/generated/airbyte_ctes/unibag/membership_orders_ab3.sql index 23d74cf..c7932e7 100644 --- a/models/generated/airbyte_ctes/unibag/membership_orders_ab3.sql +++ b/models/generated/airbyte_ctes/unibag/membership_orders_ab3.sql @@ -19,7 +19,6 @@ select boolean_to_string('isrejected'), 'membershipname', 'membershiplevel', - 'membershippromotion' ]) }} as _airbyte_membership_orders_hashid, tmp.* from {{ ref('membership_orders_ab2') }} tmp diff --git a/models/generated/airbyte_ctes/unibag/order_deliveries_ab1.sql b/models/generated/airbyte_ctes/unibag/order_deliveries_ab1.sql index e08806f..c3abf6a 100644 --- a/models/generated/airbyte_ctes/unibag/order_deliveries_ab1.sql +++ b/models/generated/airbyte_ctes/unibag/order_deliveries_ab1.sql @@ -12,18 +12,18 @@ select {{ json_extract_scalar('_airbyte_data', ['order'], ['order']) }} as {{ adapter.quote('order') }}, {{ json_extract_scalar('_airbyte_data', ['title'], ['title']) }} as title, {{ json_extract_scalar('_airbyte_data', ['status'], ['status']) }} as status, + {{ json_extract('table_alias', '_airbyte_data', ['weight'], ['weight']) }} as weight, {{ json_extract_scalar('_airbyte_data', ['service'], ['service']) }} as service, - {{ json_extract_scalar('_airbyte_data', ['customer'], ['customer']) }} as customer, - {{ json_extract_scalar('_airbyte_data', ['delivery'], ['delivery']) }} as delivery, - {{ json_extract_scalar('_airbyte_data', ['location'], ['location']) }} as {{ adapter.quote('location') }}, + {{ json_extract('table_alias', '_airbyte_data', ['customer'], ['customer']) }} as customer, + {{ json_extract('table_alias', '_airbyte_data', ['delivery'], ['delivery']) }} as delivery, + {{ json_extract('table_alias', '_airbyte_data', ['location'], ['location']) }} as {{ adapter.quote('location') }}, {{ json_extract_scalar('_airbyte_data', ['createdAt'], ['createdAt']) }} as createdat, - {{ json_extract_scalar('_airbyte_data', ['promotion'], ['promotion']) }} as promotion, + {{ json_extract('table_alias', '_airbyte_data', ['promotion'], ['promotion']) }} as promotion, {{ json_extract_scalar('_airbyte_data', ['updatedAt'], ['updatedAt']) }} as updatedat, {{ json_extract_scalar('_airbyte_data', ['trackingCode'], ['trackingCode']) }} as trackingcode, - {{ json_extract_scalar('_airbyte_data', ['trackingTime'], ['trackingTime']) }} as trackingtime, + {{ json_extract('table_alias', '_airbyte_data', ['trackingTime'], ['trackingTime']) }} as trackingtime, {{ json_extract_scalar('_airbyte_data', ['isAdminChange'], ['isAdminChange']) }} as isadminchange, {{ json_extract_scalar('_airbyte_data', ['trackingOrderCode'], ['trackingOrderCode']) }} as trackingordercode, - {{ json_extract_scalar('_airbyte_data', ['weight'], ['weight']) }} as weight, _airbyte_ab_id, _airbyte_emitted_at, {{ current_timestamp() }} as _airbyte_normalized_at diff --git a/models/generated/airbyte_ctes/unibag/order_deliveries_ab2.sql b/models/generated/airbyte_ctes/unibag/order_deliveries_ab2.sql index bd88883..75187ba 100644 --- a/models/generated/airbyte_ctes/unibag/order_deliveries_ab2.sql +++ b/models/generated/airbyte_ctes/unibag/order_deliveries_ab2.sql @@ -12,18 +12,18 @@ select cast({{ adapter.quote('order') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('order') }}, cast(title as {{ dbt_utils.type_string() }}) as title, cast(status as {{ dbt_utils.type_string() }}) as status, + cast(weight as {{ type_json() }}) as weight, cast(service as {{ dbt_utils.type_string() }}) as service, - cast(customer as {{ dbt_utils.type_string() }}) as customer, - cast(delivery as {{ dbt_utils.type_string() }}) as delivery, - cast({{ adapter.quote('location') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('location') }}, + cast(customer as {{ type_json() }}) as customer, + cast(delivery as {{ type_json() }}) as delivery, + cast({{ adapter.quote('location') }} as {{ type_json() }}) as {{ adapter.quote('location') }}, cast(createdat as {{ dbt_utils.type_string() }}) as createdat, - cast(promotion as {{ dbt_utils.type_string() }}) as promotion, + cast(promotion as {{ type_json() }}) as promotion, cast(updatedat as {{ dbt_utils.type_string() }}) as updatedat, cast(trackingcode as {{ dbt_utils.type_string() }}) as trackingcode, - cast(trackingtime as {{ dbt_utils.type_string() }}) as trackingtime, + cast(trackingtime as {{ type_json() }}) as trackingtime, {{ cast_to_boolean('isadminchange') }} as isadminchange, cast(trackingordercode as {{ dbt_utils.type_string() }}) as trackingordercode, - cast(weight as {{ dbt_utils.type_string() }}) as weight, _airbyte_ab_id, _airbyte_emitted_at, {{ current_timestamp() }} as _airbyte_normalized_at diff --git a/models/generated/airbyte_ctes/unibag/order_deliveries_ab3.sql b/models/generated/airbyte_ctes/unibag/order_deliveries_ab3.sql index 68b2c60..33e01a2 100644 --- a/models/generated/airbyte_ctes/unibag/order_deliveries_ab3.sql +++ b/models/generated/airbyte_ctes/unibag/order_deliveries_ab3.sql @@ -13,18 +13,18 @@ select adapter.quote('order'), 'title', 'status', + object_to_string('weight'), 'service', - 'customer', - 'delivery', - adapter.quote('location'), + object_to_string('customer'), + object_to_string('delivery'), + object_to_string(adapter.quote('location')), 'createdat', - 'promotion', + object_to_string('promotion'), 'updatedat', 'trackingcode', - 'trackingtime', + object_to_string('trackingtime'), boolean_to_string('isadminchange'), 'trackingordercode', - 'weight', ]) }} as _airbyte_order_deliveries_hashid, tmp.* from {{ ref('order_deliveries_ab2') }} tmp diff --git a/models/generated/airbyte_ctes/unibag/order_deliveries_customer_ab1.sql b/models/generated/airbyte_ctes/unibag/order_deliveries_customer_ab1.sql new file mode 100644 index 0000000..d21ef9f --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/order_deliveries_customer_ab1.sql @@ -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('order_deliveries') }} +select + _airbyte_order_deliveries_hashid, + {{ json_extract_scalar('customer', ['_id'], ['_id']) }} as _id, + {{ json_extract_scalar('customer', ['name'], ['name']) }} as {{ adapter.quote('name') }}, + {{ json_extract_scalar('customer', ['phone'], ['phone']) }} as phone, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('order_deliveries') }} as table_alias +-- customer at order-deliveries/customer +where 1 = 1 +and customer is not null + diff --git a/models/generated/airbyte_ctes/unibag/order_deliveries_customer_ab2.sql b/models/generated/airbyte_ctes/unibag/order_deliveries_customer_ab2.sql new file mode 100644 index 0000000..87ef67d --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/order_deliveries_customer_ab2.sql @@ -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('order_deliveries_customer_ab1') }} +select + _airbyte_order_deliveries_hashid, + cast(_id as {{ dbt_utils.type_string() }}) as _id, + cast({{ adapter.quote('name') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('name') }}, + cast(phone as {{ dbt_utils.type_string() }}) as phone, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('order_deliveries_customer_ab1') }} +-- customer at order-deliveries/customer +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/order_deliveries_customer_ab3.sql b/models/generated/airbyte_ctes/unibag/order_deliveries_customer_ab3.sql new file mode 100644 index 0000000..0381deb --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/order_deliveries_customer_ab3.sql @@ -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('order_deliveries_customer_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_order_deliveries_hashid', + '_id', + adapter.quote('name'), + 'phone', + ]) }} as _airbyte_customer_hashid, + tmp.* +from {{ ref('order_deliveries_customer_ab2') }} tmp +-- customer at order-deliveries/customer +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/order_deliveries_delivery_ab1.sql b/models/generated/airbyte_ctes/unibag/order_deliveries_delivery_ab1.sql new file mode 100644 index 0000000..388e39a --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/order_deliveries_delivery_ab1.sql @@ -0,0 +1,30 @@ +{{ 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('order_deliveries') }} +select + _airbyte_order_deliveries_hashid, + {{ json_extract_scalar('delivery', ['_id'], ['_id']) }} as _id, + {{ json_extract_scalar('delivery', ['fee'], ['fee']) }} as fee, + {{ json_extract_scalar('delivery', ['desc'], ['desc']) }} as {{ adapter.quote('desc') }}, + {{ json_extract_scalar('delivery', ['note'], ['note']) }} as note, + {{ json_extract('table_alias', 'delivery', ['feeShip'], ['feeShip']) }} as feeship, + {{ json_extract_scalar('delivery', ['currency'], ['currency']) }} as currency, + {{ json_extract_scalar('delivery', ['courierName'], ['courierName']) }} as couriername, + {{ json_extract_scalar('delivery', ['serviceCode'], ['serviceCode']) }} as servicecode, + {{ json_extract_scalar('delivery', ['serviceName'], ['serviceName']) }} as servicename, + {{ json_extract_scalar('delivery', ['deliveryCode'], ['deliveryCode']) }} as deliverycode, + {{ json_extract_scalar('delivery', ['maxDeliveryDays'], ['maxDeliveryDays']) }} as maxdeliverydays, + {{ json_extract_scalar('delivery', ['minDeliveryDays'], ['minDeliveryDays']) }} as mindeliverydays, + {{ json_extract_scalar('delivery', ['estimateTimeDelivery'], ['estimateTimeDelivery']) }} as estimatetimedelivery, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('order_deliveries') }} as table_alias +-- delivery at order-deliveries/delivery +where 1 = 1 +and delivery is not null + diff --git a/models/generated/airbyte_ctes/unibag/order_deliveries_delivery_ab2.sql b/models/generated/airbyte_ctes/unibag/order_deliveries_delivery_ab2.sql new file mode 100644 index 0000000..8713e30 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/order_deliveries_delivery_ab2.sql @@ -0,0 +1,29 @@ +{{ 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('order_deliveries_delivery_ab1') }} +select + _airbyte_order_deliveries_hashid, + cast(_id as {{ dbt_utils.type_string() }}) as _id, + cast(fee as {{ dbt_utils.type_float() }}) as fee, + cast({{ adapter.quote('desc') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('desc') }}, + cast(note as {{ dbt_utils.type_string() }}) as note, + cast(feeship as {{ type_json() }}) as feeship, + cast(currency as {{ dbt_utils.type_string() }}) as currency, + cast(couriername as {{ dbt_utils.type_string() }}) as couriername, + cast(servicecode as {{ dbt_utils.type_string() }}) as servicecode, + cast(servicename as {{ dbt_utils.type_string() }}) as servicename, + cast(deliverycode as {{ dbt_utils.type_string() }}) as deliverycode, + cast(maxdeliverydays as {{ dbt_utils.type_float() }}) as maxdeliverydays, + cast(mindeliverydays as {{ dbt_utils.type_float() }}) as mindeliverydays, + cast(estimatetimedelivery as {{ dbt_utils.type_string() }}) as estimatetimedelivery, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('order_deliveries_delivery_ab1') }} +-- delivery at order-deliveries/delivery +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/order_deliveries_delivery_ab3.sql b/models/generated/airbyte_ctes/unibag/order_deliveries_delivery_ab3.sql new file mode 100644 index 0000000..456914c --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/order_deliveries_delivery_ab3.sql @@ -0,0 +1,29 @@ +{{ 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('order_deliveries_delivery_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_order_deliveries_hashid', + '_id', + 'fee', + adapter.quote('desc'), + 'note', + object_to_string('feeship'), + 'currency', + 'couriername', + 'servicecode', + 'servicename', + 'deliverycode', + 'maxdeliverydays', + 'mindeliverydays', + 'estimatetimedelivery', + ]) }} as _airbyte_delivery_hashid, + tmp.* +from {{ ref('order_deliveries_delivery_ab2') }} tmp +-- delivery at order-deliveries/delivery +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/order_deliveries_delivery_feeship_ab1.sql b/models/generated/airbyte_ctes/unibag/order_deliveries_delivery_feeship_ab1.sql new file mode 100644 index 0000000..2aab24c --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/order_deliveries_delivery_feeship_ab1.sql @@ -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('order_deliveries_delivery') }} +select + _airbyte_delivery_hashid, + {{ json_extract_scalar('feeship', ['cod'], ['cod']) }} as cod, + {{ json_extract_scalar('feeship', ['total'], ['total']) }} as total, + {{ json_extract_scalar('feeship', ['shipping'], ['shipping']) }} as shipping, + {{ json_extract_scalar('feeship', ['insurance'], ['insurance']) }} as insurance, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('order_deliveries_delivery') }} as table_alias +-- feeship at order-deliveries/delivery/feeShip +where 1 = 1 +and feeship is not null + diff --git a/models/generated/airbyte_ctes/unibag/order_deliveries_delivery_feeship_ab2.sql b/models/generated/airbyte_ctes/unibag/order_deliveries_delivery_feeship_ab2.sql new file mode 100644 index 0000000..8d12697 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/order_deliveries_delivery_feeship_ab2.sql @@ -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('order_deliveries_delivery_feeship_ab1') }} +select + _airbyte_delivery_hashid, + cast(cod as {{ dbt_utils.type_float() }}) as cod, + cast(total as {{ dbt_utils.type_float() }}) as total, + cast(shipping as {{ dbt_utils.type_float() }}) as shipping, + cast(insurance as {{ dbt_utils.type_float() }}) as insurance, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('order_deliveries_delivery_feeship_ab1') }} +-- feeship at order-deliveries/delivery/feeShip +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/order_deliveries_delivery_feeship_ab3.sql b/models/generated/airbyte_ctes/unibag/order_deliveries_delivery_feeship_ab3.sql new file mode 100644 index 0000000..2decc78 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/order_deliveries_delivery_feeship_ab3.sql @@ -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('order_deliveries_delivery_feeship_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_delivery_hashid', + 'cod', + 'total', + 'shipping', + 'insurance', + ]) }} as _airbyte_feeship_hashid, + tmp.* +from {{ ref('order_deliveries_delivery_feeship_ab2') }} tmp +-- feeship at order-deliveries/delivery/feeShip +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/order_deliveries_location_ab1.sql b/models/generated/airbyte_ctes/unibag/order_deliveries_location_ab1.sql new file mode 100644 index 0000000..788bd8d --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/order_deliveries_location_ab1.sql @@ -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('order_deliveries') }} +select + _airbyte_order_deliveries_hashid, + {{ json_extract_scalar(adapter.quote('location'), ['_id'], ['_id']) }} as _id, + {{ 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_scalar(adapter.quote('location'), ['province'], ['province']) }} as province, + {{ json_extract_scalar(adapter.quote('location'), ['fullAddress'], ['fullAddress']) }} as fulladdress, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('order_deliveries') }} as table_alias +-- location at order-deliveries/location +where 1 = 1 +and {{ adapter.quote('location') }} is not null + diff --git a/models/generated/airbyte_ctes/unibag/order_deliveries_location_ab2.sql b/models/generated/airbyte_ctes/unibag/order_deliveries_location_ab2.sql new file mode 100644 index 0000000..88b2abe --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/order_deliveries_location_ab2.sql @@ -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('order_deliveries_location_ab1') }} +select + _airbyte_order_deliveries_hashid, + cast(_id as {{ dbt_utils.type_string() }}) as _id, + cast(ward as {{ dbt_utils.type_float() }}) as ward, + cast(address as {{ dbt_utils.type_string() }}) as address, + cast(district as {{ dbt_utils.type_float() }}) as district, + cast(province as {{ dbt_utils.type_float() }}) as province, + cast(fulladdress as {{ dbt_utils.type_string() }}) as fulladdress, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('order_deliveries_location_ab1') }} +-- location at order-deliveries/location +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/order_deliveries_location_ab3.sql b/models/generated/airbyte_ctes/unibag/order_deliveries_location_ab3.sql new file mode 100644 index 0000000..66fa515 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/order_deliveries_location_ab3.sql @@ -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('order_deliveries_location_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_order_deliveries_hashid', + '_id', + 'ward', + 'address', + 'district', + 'province', + 'fulladdress', + ]) }} as _airbyte_location_hashid, + tmp.* +from {{ ref('order_deliveries_location_ab2') }} tmp +-- location at order-deliveries/location +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/order_deliveries_promotion_ab1.sql b/models/generated/airbyte_ctes/unibag/order_deliveries_promotion_ab1.sql new file mode 100644 index 0000000..f9d295d --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/order_deliveries_promotion_ab1.sql @@ -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('order_deliveries') }} +select + _airbyte_order_deliveries_hashid, + {{ json_extract_scalar('promotion', ['type'], ['type']) }} as {{ adapter.quote('type') }}, + {{ json_extract_scalar('promotion', ['discount'], ['discount']) }} as discount, + {{ json_extract_scalar('promotion', ['isApplied'], ['isApplied']) }} as isapplied, + {{ json_extract_scalar('promotion', ['minOrderValue'], ['minOrderValue']) }} as minordervalue, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('order_deliveries') }} as table_alias +-- promotion at order-deliveries/promotion +where 1 = 1 +and promotion is not null + diff --git a/models/generated/airbyte_ctes/unibag/order_deliveries_promotion_ab2.sql b/models/generated/airbyte_ctes/unibag/order_deliveries_promotion_ab2.sql new file mode 100644 index 0000000..5c52fc2 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/order_deliveries_promotion_ab2.sql @@ -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('order_deliveries_promotion_ab1') }} +select + _airbyte_order_deliveries_hashid, + cast({{ adapter.quote('type') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('type') }}, + cast(discount as {{ dbt_utils.type_float() }}) as discount, + {{ cast_to_boolean('isapplied') }} as isapplied, + cast(minordervalue as {{ dbt_utils.type_float() }}) as minordervalue, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('order_deliveries_promotion_ab1') }} +-- promotion at order-deliveries/promotion +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/order_deliveries_promotion_ab3.sql b/models/generated/airbyte_ctes/unibag/order_deliveries_promotion_ab3.sql new file mode 100644 index 0000000..a43ed0a --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/order_deliveries_promotion_ab3.sql @@ -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('order_deliveries_promotion_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_order_deliveries_hashid', + adapter.quote('type'), + 'discount', + boolean_to_string('isapplied'), + 'minordervalue', + ]) }} as _airbyte_promotion_hashid, + tmp.* +from {{ ref('order_deliveries_promotion_ab2') }} tmp +-- promotion at order-deliveries/promotion +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/order_deliveries_trackingtime_ab1.sql b/models/generated/airbyte_ctes/unibag/order_deliveries_trackingtime_ab1.sql new file mode 100644 index 0000000..ff13473 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/order_deliveries_trackingtime_ab1.sql @@ -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('order_deliveries') }} +select + _airbyte_order_deliveries_hashid, + {{ json_extract_scalar('trackingtime', ['pickedAt'], ['pickedAt']) }} as pickedat, + {{ json_extract_scalar('trackingtime', ['completedAt'], ['completedAt']) }} as completedat, + {{ json_extract_scalar('trackingtime', ['deliveringAt'], ['deliveringAt']) }} as deliveringat, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('order_deliveries') }} as table_alias +-- trackingtime at order-deliveries/trackingTime +where 1 = 1 +and trackingtime is not null + diff --git a/models/generated/airbyte_ctes/unibag/order_deliveries_trackingtime_ab2.sql b/models/generated/airbyte_ctes/unibag/order_deliveries_trackingtime_ab2.sql new file mode 100644 index 0000000..3c4fd27 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/order_deliveries_trackingtime_ab2.sql @@ -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('order_deliveries_trackingtime_ab1') }} +select + _airbyte_order_deliveries_hashid, + cast(pickedat as {{ dbt_utils.type_string() }}) as pickedat, + cast(completedat as {{ dbt_utils.type_string() }}) as completedat, + cast(deliveringat as {{ dbt_utils.type_string() }}) as deliveringat, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('order_deliveries_trackingtime_ab1') }} +-- trackingtime at order-deliveries/trackingTime +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/order_deliveries_trackingtime_ab3.sql b/models/generated/airbyte_ctes/unibag/order_deliveries_trackingtime_ab3.sql new file mode 100644 index 0000000..a19abe2 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/order_deliveries_trackingtime_ab3.sql @@ -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('order_deliveries_trackingtime_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_order_deliveries_hashid', + 'pickedat', + 'completedat', + 'deliveringat', + ]) }} as _airbyte_trackingtime_hashid, + tmp.* +from {{ ref('order_deliveries_trackingtime_ab2') }} tmp +-- trackingtime at order-deliveries/trackingTime +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/order_deliveries_weight_ab1.sql b/models/generated/airbyte_ctes/unibag/order_deliveries_weight_ab1.sql new file mode 100644 index 0000000..9549913 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/order_deliveries_weight_ab1.sql @@ -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('order_deliveries') }} +select + _airbyte_order_deliveries_hashid, + {{ json_extract_scalar('weight', ['real'], ['real']) }} as {{ adapter.quote('real') }}, + {{ json_extract_scalar('weight', ['sent'], ['sent']) }} as sent, + {{ json_extract_scalar('weight', ['converted'], ['converted']) }} as converted, + {{ json_extract_scalar('weight', ['multiplier'], ['multiplier']) }} as multiplier, + {{ json_extract_scalar('weight', ['convertedWithMultiplier'], ['convertedWithMultiplier']) }} as convertedwithmultiplier, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('order_deliveries') }} as table_alias +-- weight at order-deliveries/weight +where 1 = 1 +and weight is not null + diff --git a/models/generated/airbyte_ctes/unibag/order_deliveries_weight_ab2.sql b/models/generated/airbyte_ctes/unibag/order_deliveries_weight_ab2.sql new file mode 100644 index 0000000..6d895f8 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/order_deliveries_weight_ab2.sql @@ -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('order_deliveries_weight_ab1') }} +select + _airbyte_order_deliveries_hashid, + cast({{ adapter.quote('real') }} as {{ dbt_utils.type_float() }}) as {{ adapter.quote('real') }}, + cast(sent as {{ dbt_utils.type_float() }}) as sent, + cast(converted as {{ dbt_utils.type_float() }}) as converted, + cast(multiplier as {{ dbt_utils.type_float() }}) as multiplier, + cast(convertedwithmultiplier as {{ dbt_utils.type_float() }}) as convertedwithmultiplier, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('order_deliveries_weight_ab1') }} +-- weight at order-deliveries/weight +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/order_deliveries_weight_ab3.sql b/models/generated/airbyte_ctes/unibag/order_deliveries_weight_ab3.sql new file mode 100644 index 0000000..1e88585 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/order_deliveries_weight_ab3.sql @@ -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('order_deliveries_weight_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_order_deliveries_hashid', + adapter.quote('real'), + 'sent', + 'converted', + 'multiplier', + 'convertedwithmultiplier', + ]) }} as _airbyte_weight_hashid, + tmp.* +from {{ ref('order_deliveries_weight_ab2') }} tmp +-- weight at order-deliveries/weight +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/order_histories_ab1.sql b/models/generated/airbyte_ctes/unibag/order_histories_ab1.sql index a29935e..551977b 100644 --- a/models/generated/airbyte_ctes/unibag/order_histories_ab1.sql +++ b/models/generated/airbyte_ctes/unibag/order_histories_ab1.sql @@ -11,7 +11,7 @@ select {{ json_extract_scalar('_airbyte_data', ['order'], ['order']) }} as {{ adapter.quote('order') }}, {{ json_extract_scalar('_airbyte_data', ['status'], ['status']) }} as status, {{ json_extract_scalar('_airbyte_data', ['createdAt'], ['createdAt']) }} as createdat, - {{ json_extract_scalar('_airbyte_data', ['timestamp'], ['timestamp']) }} as {{ adapter.quote('timestamp') }}, + {{ json_extract_scalar('_airbyte_data', ['timeStamp'], ['timeStamp']) }} as {{ adapter.quote('timeStamp') }}, {{ json_extract_scalar('_airbyte_data', ['updatedAt'], ['updatedAt']) }} as updatedat, _airbyte_ab_id, _airbyte_emitted_at, diff --git a/models/generated/airbyte_ctes/unibag/order_histories_ab2.sql b/models/generated/airbyte_ctes/unibag/order_histories_ab2.sql index 6829844..0910e61 100644 --- a/models/generated/airbyte_ctes/unibag/order_histories_ab2.sql +++ b/models/generated/airbyte_ctes/unibag/order_histories_ab2.sql @@ -11,7 +11,7 @@ select cast({{ adapter.quote('order') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('order') }}, cast(status as {{ dbt_utils.type_string() }}) as status, cast(createdat as {{ dbt_utils.type_string() }}) as createdat, - cast({{ adapter.quote('timestamp') }} as {{ dbt_utils.type_float() }}) as {{ adapter.quote('timestamp') }}, + cast({{ adapter.quote('timeStamp') }} as {{ dbt_utils.type_float() }}) as {{ adapter.quote('timeStamp') }}, cast(updatedat as {{ dbt_utils.type_string() }}) as updatedat, _airbyte_ab_id, _airbyte_emitted_at, diff --git a/models/generated/airbyte_ctes/unibag/order_histories_ab3.sql b/models/generated/airbyte_ctes/unibag/order_histories_ab3.sql index 1f63e99..417d252 100644 --- a/models/generated/airbyte_ctes/unibag/order_histories_ab3.sql +++ b/models/generated/airbyte_ctes/unibag/order_histories_ab3.sql @@ -12,7 +12,7 @@ select adapter.quote('order'), 'status', 'createdat', - adapter.quote('timestamp'), + adapter.quote('timeStamp'), 'updatedat', ]) }} as _airbyte_order_histories_hashid, tmp.* diff --git a/models/generated/airbyte_ctes/unibag/order_items_ab1.sql b/models/generated/airbyte_ctes/unibag/order_items_ab1.sql index bc10213..ff5774f 100644 --- a/models/generated/airbyte_ctes/unibag/order_items_ab1.sql +++ b/models/generated/airbyte_ctes/unibag/order_items_ab1.sql @@ -8,34 +8,21 @@ -- depends_on: {{ source('unibag', '_airbyte_raw_order_items') }} select {{ json_extract_scalar('_airbyte_data', ['_id'], ['_id']) }} as _id, - {{ json_extract_scalar('_airbyte_data', ['sku'], ['sku']) }} as sku, + {{ json_extract('table_alias', '_airbyte_data', ['sku'], ['sku']) }} as sku, {{ json_extract_scalar('_airbyte_data', ['date'], ['date']) }} as {{ adapter.quote('date') }}, {{ json_extract_scalar('_airbyte_data', ['user'], ['user']) }} as {{ adapter.quote('user') }}, - {{ json_extract_scalar('_airbyte_data', ['brand'], ['brand']) }} as brand, {{ json_extract_scalar('_airbyte_data', ['order'], ['order']) }} as {{ adapter.quote('order') }}, - {{ json_extract_scalar('_airbyte_data', ['price'], ['price']) }} as price, + {{ json_extract('table_alias', '_airbyte_data', ['price'], ['price']) }} as price, {{ json_extract_scalar('_airbyte_data', ['status'], ['status']) }} as status, - {{ json_extract_scalar('_airbyte_data', ['teamId'], ['teamId']) }} as teamid, {{ json_extract_scalar('_airbyte_data', ['product'], ['product']) }} as product, - {{ json_extract_scalar('_airbyte_data', ['voucher'], ['voucher']) }} as voucher, {{ json_extract_scalar('_airbyte_data', ['customer'], ['customer']) }} as customer, {{ json_extract_scalar('_airbyte_data', ['quantity'], ['quantity']) }} as quantity, {{ json_extract_scalar('_airbyte_data', ['createdAt'], ['createdAt']) }} as createdat, - {{ json_extract_scalar('_airbyte_data', ['inventory'], ['inventory']) }} as inventory, {{ json_extract_scalar('_airbyte_data', ['totalSell'], ['totalSell']) }} as totalsell, {{ json_extract_scalar('_airbyte_data', ['updatedAt'], ['updatedAt']) }} as updatedat, {{ json_extract_scalar('_airbyte_data', ['cashbackAt'], ['cashbackAt']) }} as cashbackat, - {{ json_extract_array('_airbyte_data', ['promotions'], ['promotions']) }} as promotions, {{ json_extract_scalar('_airbyte_data', ['totalPrice'], ['totalPrice']) }} as totalprice, {{ json_extract_scalar('_airbyte_data', ['deliveredAt'], ['deliveredAt']) }} as deliveredat, - {{ json_extract_scalar('_airbyte_data', ['teamMemberId'], ['teamMemberId']) }} as teammemberid, - {{ json_extract_scalar('_airbyte_data', ['isAssignCoupon'], ['isAssignCoupon']) }} as isassigncoupon, - {{ json_extract_scalar('_airbyte_data', ['totalPromotion'], ['totalPromotion']) }} as totalpromotion, - {{ json_extract_scalar('_airbyte_data', ['inWholesaleRange'], ['inWholesaleRange']) }} as inwholesalerange, - {{ json_extract_scalar('_airbyte_data', ['voucherCashTotal'], ['voucherCashTotal']) }} as vouchercashtotal, - {{ json_extract_scalar('_airbyte_data', ['wholesaleRangeId'], ['wholesaleRangeId']) }} as wholesalerangeid, - {{ json_extract_scalar('_airbyte_data', ['totalWholesaleBonus'], ['totalWholesaleBonus']) }} as totalwholesalebonus, - {{ json_extract_scalar('_airbyte_data', ['totalSellyWholesaleBonus'], ['totalSellyWholesaleBonus']) }} as totalsellywholesalebonus, _airbyte_ab_id, _airbyte_emitted_at, {{ current_timestamp() }} as _airbyte_normalized_at diff --git a/models/generated/airbyte_ctes/unibag/order_items_ab2.sql b/models/generated/airbyte_ctes/unibag/order_items_ab2.sql index 441ca5c..a6a1415 100644 --- a/models/generated/airbyte_ctes/unibag/order_items_ab2.sql +++ b/models/generated/airbyte_ctes/unibag/order_items_ab2.sql @@ -8,34 +8,21 @@ -- depends_on: {{ ref('order_items_ab1') }} select cast(_id as {{ dbt_utils.type_string() }}) as _id, - cast(sku as {{ dbt_utils.type_string() }}) as sku, + cast(sku as {{ type_json() }}) as sku, cast({{ adapter.quote('date') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('date') }}, cast({{ adapter.quote('user') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('user') }}, - cast(brand as {{ dbt_utils.type_string() }}) as brand, cast({{ adapter.quote('order') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('order') }}, - cast(price as {{ dbt_utils.type_string() }}) as price, + cast(price as {{ type_json() }}) as price, cast(status as {{ dbt_utils.type_string() }}) as status, - cast(teamid as {{ dbt_utils.type_string() }}) as teamid, cast(product as {{ dbt_utils.type_string() }}) as product, - cast(voucher as {{ dbt_utils.type_string() }}) as voucher, cast(customer as {{ dbt_utils.type_string() }}) as customer, cast(quantity as {{ dbt_utils.type_float() }}) as quantity, cast(createdat as {{ dbt_utils.type_string() }}) as createdat, - cast(inventory as {{ dbt_utils.type_string() }}) as inventory, cast(totalsell as {{ dbt_utils.type_float() }}) as totalsell, cast(updatedat as {{ dbt_utils.type_string() }}) as updatedat, cast(cashbackat as {{ dbt_utils.type_string() }}) as cashbackat, - promotions, cast(totalprice as {{ dbt_utils.type_float() }}) as totalprice, cast(deliveredat as {{ dbt_utils.type_string() }}) as deliveredat, - cast(teammemberid as {{ dbt_utils.type_string() }}) as teammemberid, - {{ cast_to_boolean('isassigncoupon') }} as isassigncoupon, - cast(totalpromotion as {{ dbt_utils.type_float() }}) as totalpromotion, - {{ cast_to_boolean('inwholesalerange') }} as inwholesalerange, - cast(vouchercashtotal as {{ dbt_utils.type_float() }}) as vouchercashtotal, - cast(wholesalerangeid as {{ dbt_utils.type_string() }}) as wholesalerangeid, - cast(totalwholesalebonus as {{ dbt_utils.type_float() }}) as totalwholesalebonus, - cast(totalsellywholesalebonus as {{ dbt_utils.type_float() }}) as totalsellywholesalebonus, _airbyte_ab_id, _airbyte_emitted_at, {{ current_timestamp() }} as _airbyte_normalized_at diff --git a/models/generated/airbyte_ctes/unibag/order_items_ab3.sql b/models/generated/airbyte_ctes/unibag/order_items_ab3.sql index 2f34c0b..b1e5ac3 100644 --- a/models/generated/airbyte_ctes/unibag/order_items_ab3.sql +++ b/models/generated/airbyte_ctes/unibag/order_items_ab3.sql @@ -9,34 +9,21 @@ select {{ dbt_utils.surrogate_key([ '_id', - 'sku', + object_to_string('sku'), adapter.quote('date'), adapter.quote('user'), - 'brand', adapter.quote('order'), - 'price', + object_to_string('price'), 'status', - 'teamid', 'product', - 'voucher', 'customer', 'quantity', 'createdat', - 'inventory', 'totalsell', 'updatedat', 'cashbackat', - array_to_string('promotions'), 'totalprice', 'deliveredat', - 'teammemberid', - boolean_to_string('isassigncoupon'), - 'totalpromotion', - boolean_to_string('inwholesalerange'), - 'vouchercashtotal', - 'wholesalerangeid', - 'totalwholesalebonus', - 'totalsellywholesalebonus', ]) }} as _airbyte_order_items_hashid, tmp.* from {{ ref('order_items_ab2') }} tmp diff --git a/models/generated/airbyte_ctes/unibag/order_items_price_ab1.sql b/models/generated/airbyte_ctes/unibag/order_items_price_ab1.sql new file mode 100644 index 0000000..ef704b0 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/order_items_price_ab1.sql @@ -0,0 +1,29 @@ +{{ 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('order_items') }} +select + _airbyte_order_items_hashid, + {{ json_extract_scalar('price', ['base'], ['base']) }} as base, + {{ json_extract_scalar('price', ['sell'], ['sell']) }} as sell, + {{ json_extract_scalar('price', ['market'], ['market']) }} as market, + {{ json_extract_scalar('price', ['profit'], ['profit']) }} as profit, + {{ json_extract_scalar('price', ['volume'], ['volume']) }} as volume, + {{ json_extract_scalar('price', ['weight'], ['weight']) }} as weight, + {{ json_extract_scalar('price', ['maximum'], ['maximum']) }} as maximum, + {{ json_extract_scalar('price', ['minimum'], ['minimum']) }} as minimum, + {{ json_extract_scalar('price', ['profitUni'], ['profitUni']) }} as profituni, + {{ json_extract_scalar('price', ['supplierPrice'], ['supplierPrice']) }} as supplierprice, + {{ json_extract_scalar('price', ['membershipPercent'], ['membershipPercent']) }} as membershippercent, + {{ json_extract_scalar('price', ['membershipCommission'], ['membershipCommission']) }} as membershipcommission, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('order_items') }} as table_alias +-- price at order-items/price +where 1 = 1 +and price is not null + diff --git a/models/generated/airbyte_ctes/unibag/order_items_price_ab2.sql b/models/generated/airbyte_ctes/unibag/order_items_price_ab2.sql new file mode 100644 index 0000000..196f127 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/order_items_price_ab2.sql @@ -0,0 +1,28 @@ +{{ 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('order_items_price_ab1') }} +select + _airbyte_order_items_hashid, + cast(base as {{ dbt_utils.type_float() }}) as base, + cast(sell as {{ dbt_utils.type_float() }}) as sell, + cast(market as {{ dbt_utils.type_float() }}) as market, + cast(profit as {{ dbt_utils.type_float() }}) as profit, + cast(volume as {{ dbt_utils.type_string() }}) as volume, + cast(weight as {{ dbt_utils.type_float() }}) as weight, + cast(maximum as {{ dbt_utils.type_float() }}) as maximum, + cast(minimum as {{ dbt_utils.type_float() }}) as minimum, + cast(profituni as {{ dbt_utils.type_float() }}) as profituni, + cast(supplierprice as {{ dbt_utils.type_float() }}) as supplierprice, + cast(membershippercent as {{ dbt_utils.type_float() }}) as membershippercent, + cast(membershipcommission as {{ dbt_utils.type_float() }}) as membershipcommission, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('order_items_price_ab1') }} +-- price at order-items/price +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/order_items_price_ab3.sql b/models/generated/airbyte_ctes/unibag/order_items_price_ab3.sql new file mode 100644 index 0000000..bcd93a2 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/order_items_price_ab3.sql @@ -0,0 +1,28 @@ +{{ 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('order_items_price_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_order_items_hashid', + 'base', + 'sell', + 'market', + 'profit', + 'volume', + 'weight', + 'maximum', + 'minimum', + 'profituni', + 'supplierprice', + 'membershippercent', + 'membershipcommission', + ]) }} as _airbyte_price_hashid, + tmp.* +from {{ ref('order_items_price_ab2') }} tmp +-- price at order-items/price +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/order_items_sku_ab1.sql b/models/generated/airbyte_ctes/unibag/order_items_sku_ab1.sql new file mode 100644 index 0000000..1b51427 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/order_items_sku_ab1.sql @@ -0,0 +1,25 @@ +{{ 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('order_items') }} +select + _airbyte_order_items_hashid, + {{ json_extract_scalar('sku', ['_id'], ['_id']) }} as _id, + {{ json_extract_scalar('sku', ['sku'], ['sku']) }} as sku, + {{ json_extract_scalar('sku', ['name'], ['name']) }} as {{ adapter.quote('name') }}, + {{ json_extract_scalar('sku', ['type'], ['type']) }} as {{ adapter.quote('type') }}, + {{ json_extract_scalar('sku', ['source'], ['source']) }} as {{ adapter.quote('source') }}, + {{ json_extract_scalar('sku', ['picture'], ['picture']) }} as picture, + {{ json_extract_scalar('sku', ['version'], ['version']) }} as {{ adapter.quote('version') }}, + {{ json_extract_array('sku', ['properties'], ['properties']) }} as properties, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('order_items') }} as table_alias +-- sku at order-items/sku +where 1 = 1 +and sku is not null + diff --git a/models/generated/airbyte_ctes/unibag/order_items_sku_ab2.sql b/models/generated/airbyte_ctes/unibag/order_items_sku_ab2.sql new file mode 100644 index 0000000..87c99d9 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/order_items_sku_ab2.sql @@ -0,0 +1,24 @@ +{{ 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('order_items_sku_ab1') }} +select + _airbyte_order_items_hashid, + cast(_id as {{ dbt_utils.type_string() }}) as _id, + cast(sku as {{ dbt_utils.type_string() }}) as sku, + 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('source') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('source') }}, + cast(picture as {{ dbt_utils.type_string() }}) as picture, + cast({{ adapter.quote('version') }} as {{ dbt_utils.type_float() }}) as {{ adapter.quote('version') }}, + properties, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('order_items_sku_ab1') }} +-- sku at order-items/sku +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/order_items_sku_ab3.sql b/models/generated/airbyte_ctes/unibag/order_items_sku_ab3.sql new file mode 100644 index 0000000..99ef8db --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/order_items_sku_ab3.sql @@ -0,0 +1,24 @@ +{{ 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('order_items_sku_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_order_items_hashid', + '_id', + 'sku', + adapter.quote('name'), + adapter.quote('type'), + adapter.quote('source'), + 'picture', + adapter.quote('version'), + array_to_string('properties'), + ]) }} as _airbyte_sku_hashid, + tmp.* +from {{ ref('order_items_sku_ab2') }} tmp +-- sku at order-items/sku +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/orders_ab1.sql b/models/generated/airbyte_ctes/unibag/orders_ab1.sql index a4896c8..b44b9f8 100644 --- a/models/generated/airbyte_ctes/unibag/orders_ab1.sql +++ b/models/generated/airbyte_ctes/unibag/orders_ab1.sql @@ -12,59 +12,54 @@ select {{ json_extract_scalar('_airbyte_data', ['date'], ['date']) }} as {{ adapter.quote('date') }}, {{ json_extract_scalar('_airbyte_data', ['hour'], ['hour']) }} as {{ adapter.quote('hour') }}, {{ json_extract_scalar('_airbyte_data', ['note'], ['note']) }} as note, + {{ json_extract_array('_airbyte_data', ['skus'], ['skus']) }} as skus, {{ json_extract_array('_airbyte_data', ['tags'], ['tags']) }} as tags, {{ json_extract_scalar('_airbyte_data', ['user'], ['user']) }} as {{ adapter.quote('user') }}, - {{ json_extract_scalar('_airbyte_data', ['price'], ['price']) }} as price, + {{ json_extract('table_alias', '_airbyte_data', ['price'], ['price']) }} as price, {{ json_extract_scalar('_airbyte_data', ['banned'], ['banned']) }} as banned, {{ json_extract_scalar('_airbyte_data', ['reason'], ['reason']) }} as reason, {{ json_extract_scalar('_airbyte_data', ['source'], ['source']) }} as {{ adapter.quote('source') }}, {{ json_extract_scalar('_airbyte_data', ['status'], ['status']) }} as status, - {{ json_extract_scalar('_airbyte_data', ['teamId'], ['teamId']) }} as teamid, - {{ json_extract_scalar('_airbyte_data', ['payment'], ['payment']) }} as payment, + {{ json_extract_scalar('_airbyte_data', ['update'], ['update']) }} as {{ adapter.quote('update') }}, + {{ json_extract('table_alias', '_airbyte_data', ['payment'], ['payment']) }} as payment, {{ json_extract_scalar('_airbyte_data', ['remarks'], ['remarks']) }} as remarks, {{ json_extract_scalar('_airbyte_data', ['customer'], ['customer']) }} as customer, - {{ json_extract_scalar('_airbyte_data', ['delivery'], ['delivery']) }} as delivery, - {{ json_extract_scalar('_airbyte_data', ['isCalled'], ['isCalled']) }} as iscalled, - {{ json_extract_scalar('_airbyte_data', ['merchant'], ['merchant']) }} as merchant, + {{ json_extract('table_alias', '_airbyte_data', ['delivery'], ['delivery']) }} as delivery, {{ json_extract_scalar('_airbyte_data', ['pickupAt'], ['pickupAt']) }} as pickupat, - {{ json_extract_scalar('_airbyte_data', ['supplier'], ['supplier']) }} as supplier, + {{ json_extract_array('_airbyte_data', ['products'], ['products']) }} as products, + {{ json_extract('table_alias', '_airbyte_data', ['supplier'], ['supplier']) }} as supplier, + {{ json_extract_scalar('_airbyte_data', ['approveAt'], ['approveAt']) }} as approveat, {{ json_extract_scalar('_airbyte_data', ['createdAt'], ['createdAt']) }} as createdat, - {{ json_extract_scalar('_airbyte_data', ['inventory'], ['inventory']) }} as inventory, - {{ json_extract_scalar('_airbyte_data', ['invoiceId'], ['invoiceId']) }} as invoiceid, + {{ json_extract('table_alias', '_airbyte_data', ['inventory'], ['inventory']) }} as inventory, {{ json_extract_scalar('_airbyte_data', ['isDeleted'], ['isDeleted']) }} as isdeleted, - {{ json_extract_scalar('_airbyte_data', ['promotion'], ['promotion']) }} as promotion, + {{ json_extract('table_alias', '_airbyte_data', ['promotion'], ['promotion']) }} as promotion, {{ json_extract_scalar('_airbyte_data', ['requestId'], ['requestId']) }} as requestid, - {{ json_extract_scalar('_airbyte_data', ['restockAt'], ['restockAt']) }} as restockat, - {{ json_extract_scalar('_airbyte_data', ['sendEmail'], ['sendEmail']) }} as sendemail, + {{ json_extract('table_alias', '_airbyte_data', ['sendEmail'], ['sendEmail']) }} as sendemail, {{ json_extract_scalar('_airbyte_data', ['totalItem'], ['totalItem']) }} as totalitem, {{ json_extract_scalar('_airbyte_data', ['updatedAt'], ['updatedAt']) }} as updatedat, - {{ json_extract_scalar('_airbyte_data', ['userAgent'], ['userAgent']) }} as useragent, + {{ json_extract('table_alias', '_airbyte_data', ['userAgent'], ['userAgent']) }} as useragent, {{ json_extract_scalar('_airbyte_data', ['wholesale'], ['wholesale']) }} as wholesale, {{ json_extract_scalar('_airbyte_data', ['approvedAt'], ['approvedAt']) }} as approvedat, {{ json_extract_scalar('_airbyte_data', ['cashbackAt'], ['cashbackAt']) }} as cashbackat, + {{ json_extract_scalar('_airbyte_data', ['codeOsiris'], ['codeOsiris']) }} as codeosiris, {{ json_extract_scalar('_airbyte_data', ['isPreorder'], ['isPreorder']) }} as ispreorder, - {{ json_extract_scalar('_airbyte_data', ['isReviewed'], ['isReviewed']) }} as isreviewed, + {{ json_extract_scalar('_airbyte_data', ['membership'], ['membership']) }} as membership, {{ json_extract_scalar('_airbyte_data', ['rejectedAt'], ['rejectedAt']) }} as rejectedat, {{ json_extract_scalar('_airbyte_data', ['deliveredAt'], ['deliveredAt']) }} as deliveredat, {{ json_extract_scalar('_airbyte_data', ['deliveringAt'], ['deliveringAt']) }} as deliveringat, {{ json_extract_scalar('_airbyte_data', ['deliveryCode'], ['deliveryCode']) }} as deliverycode, {{ json_extract_scalar('_airbyte_data', ['searchString'], ['searchString']) }} as searchstring, {{ json_extract_scalar('_airbyte_data', ['staffApprove'], ['staffApprove']) }} as staffapprove, - {{ json_extract_scalar('_airbyte_data', ['teamMemberId'], ['teamMemberId']) }} as teammemberid, + {{ json_extract_scalar('_airbyte_data', ['trackingCode'], ['trackingCode']) }} as trackingcode, {{ json_extract_scalar('_airbyte_data', ['processStatus'], ['processStatus']) }} as processstatus, {{ json_extract_scalar('_airbyte_data', ['hookTimeLastAt'], ['hookTimeLastAt']) }} as hooktimelastat, - {{ json_extract_scalar('_airbyte_data', ['isAssignCoupon'], ['isAssignCoupon']) }} as isassigncoupon, - {{ json_extract_scalar('_airbyte_data', ['isAutoApproved'], ['isAutoApproved']) }} as isautoapproved, - {{ json_extract_scalar('_airbyte_data', ['outboundRequest'], ['outboundRequest']) }} as outboundrequest, {{ json_extract_scalar('_airbyte_data', ['trackingCodeURL'], ['trackingCodeURL']) }} as trackingcodeurl, - {{ json_extract_scalar('_airbyte_data', ['trackingCode'], ['trackingcode']) }} as trackingCode, - {{ json_extract_scalar('_airbyte_data', ['waitingCancelBy'], ['waitingCancelBy']) }} as waitingcancelby, + {{ json_extract_scalar('_airbyte_data', ['approvePaymentAt'], ['approvePaymentAt']) }} as approvepaymentat, {{ json_extract_scalar('_airbyte_data', ['isChangeDelivery'], ['isChangeDelivery']) }} as ischangedelivery, + {{ json_extract_scalar('_airbyte_data', ['trackingOrderCode'], ['trackingOrderCode']) }} as trackingordercode, {{ json_extract_scalar('_airbyte_data', ['estimateCashbackAt'], ['estimateCashbackAt']) }} as estimatecashbackat, - {{ json_extract_scalar('_airbyte_data', ['fromNewActiveBuyer'], ['fromNewActiveBuyer']) }} as fromnewactivebuyer, {{ json_extract_scalar('_airbyte_data', ['isWaitingCancelled'], ['isWaitingCancelled']) }} as iswaitingcancelled, {{ json_extract_scalar('_airbyte_data', ['fromNewActiveSeller'], ['fromNewActiveSeller']) }} as fromnewactiveseller, - {{ json_extract_scalar('_airbyte_data', ['waitingCancelReason'], ['waitingCancelReason']) }} as waitingcancelreason, _airbyte_ab_id, _airbyte_emitted_at, {{ current_timestamp() }} as _airbyte_normalized_at diff --git a/models/generated/airbyte_ctes/unibag/orders_ab2.sql b/models/generated/airbyte_ctes/unibag/orders_ab2.sql index 1435977..3f36ad2 100644 --- a/models/generated/airbyte_ctes/unibag/orders_ab2.sql +++ b/models/generated/airbyte_ctes/unibag/orders_ab2.sql @@ -12,59 +12,54 @@ select cast({{ adapter.quote('date') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('date') }}, cast({{ adapter.quote('hour') }} as {{ dbt_utils.type_float() }}) as {{ adapter.quote('hour') }}, cast(note as {{ dbt_utils.type_string() }}) as note, + skus, tags, cast({{ adapter.quote('user') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('user') }}, - cast(price as {{ dbt_utils.type_string() }}) as price, + cast(price as {{ type_json() }}) as price, {{ cast_to_boolean('banned') }} as banned, cast(reason as {{ dbt_utils.type_string() }}) as reason, cast({{ adapter.quote('source') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('source') }}, cast(status as {{ dbt_utils.type_string() }}) as status, - cast(teamid as {{ dbt_utils.type_string() }}) as teamid, - cast(payment as {{ dbt_utils.type_string() }}) as payment, + cast({{ adapter.quote('update') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('update') }}, + cast(payment as {{ type_json() }}) as payment, cast(remarks as {{ dbt_utils.type_string() }}) as remarks, cast(customer as {{ dbt_utils.type_string() }}) as customer, - cast(delivery as {{ dbt_utils.type_string() }}) as delivery, - {{ cast_to_boolean('iscalled') }} as iscalled, - cast(merchant as {{ dbt_utils.type_string() }}) as merchant, + cast(delivery as {{ type_json() }}) as delivery, cast(pickupat as {{ dbt_utils.type_string() }}) as pickupat, - cast(supplier as {{ dbt_utils.type_string() }}) as supplier, + products, + cast(supplier as {{ type_json() }}) as supplier, + cast(approveat as {{ dbt_utils.type_string() }}) as approveat, cast(createdat as {{ dbt_utils.type_string() }}) as createdat, - cast(inventory as {{ dbt_utils.type_string() }}) as inventory, - cast(invoiceid as {{ dbt_utils.type_string() }}) as invoiceid, + cast(inventory as {{ type_json() }}) as inventory, {{ cast_to_boolean('isdeleted') }} as isdeleted, - cast(promotion as {{ dbt_utils.type_string() }}) as promotion, + cast(promotion as {{ type_json() }}) as promotion, cast(requestid as {{ dbt_utils.type_string() }}) as requestid, - cast(restockat as {{ dbt_utils.type_string() }}) as restockat, - cast(sendemail as {{ dbt_utils.type_string() }}) as sendemail, + cast(sendemail as {{ type_json() }}) as sendemail, cast(totalitem as {{ dbt_utils.type_float() }}) as totalitem, cast(updatedat as {{ dbt_utils.type_string() }}) as updatedat, - cast(useragent as {{ dbt_utils.type_string() }}) as useragent, + cast(useragent as {{ type_json() }}) as useragent, {{ cast_to_boolean('wholesale') }} as wholesale, cast(approvedat as {{ dbt_utils.type_string() }}) as approvedat, cast(cashbackat as {{ dbt_utils.type_string() }}) as cashbackat, + cast(codeosiris as {{ dbt_utils.type_string() }}) as codeosiris, {{ cast_to_boolean('ispreorder') }} as ispreorder, - {{ cast_to_boolean('isreviewed') }} as isreviewed, + cast(membership as {{ dbt_utils.type_string() }}) as membership, cast(rejectedat as {{ dbt_utils.type_string() }}) as rejectedat, cast(deliveredat as {{ dbt_utils.type_string() }}) as deliveredat, cast(deliveringat as {{ dbt_utils.type_string() }}) as deliveringat, cast(deliverycode as {{ dbt_utils.type_string() }}) as deliverycode, cast(searchstring as {{ dbt_utils.type_string() }}) as searchstring, cast(staffapprove as {{ dbt_utils.type_string() }}) as staffapprove, - cast(teammemberid as {{ dbt_utils.type_string() }}) as teammemberid, + cast(trackingcode as {{ dbt_utils.type_string() }}) as trackingcode, cast(processstatus as {{ dbt_utils.type_string() }}) as processstatus, cast(hooktimelastat as {{ dbt_utils.type_string() }}) as hooktimelastat, - {{ cast_to_boolean('isassigncoupon') }} as isassigncoupon, - {{ cast_to_boolean('isautoapproved') }} as isautoapproved, - cast(outboundrequest as {{ dbt_utils.type_string() }}) as outboundrequest, cast(trackingcodeurl as {{ dbt_utils.type_string() }}) as trackingcodeurl, - cast(trackingcode as {{ dbt_utils.type_string() }}) as trackingcode, - cast(waitingcancelby as {{ dbt_utils.type_string() }}) as waitingcancelby, + cast(approvepaymentat as {{ dbt_utils.type_string() }}) as approvepaymentat, {{ cast_to_boolean('ischangedelivery') }} as ischangedelivery, + cast(trackingordercode as {{ dbt_utils.type_string() }}) as trackingordercode, cast(estimatecashbackat as {{ dbt_utils.type_string() }}) as estimatecashbackat, - {{ cast_to_boolean('fromnewactivebuyer') }} as fromnewactivebuyer, {{ cast_to_boolean('iswaitingcancelled') }} as iswaitingcancelled, {{ cast_to_boolean('fromnewactiveseller') }} as fromnewactiveseller, - cast(waitingcancelreason as {{ dbt_utils.type_string() }}) as waitingcancelreason, _airbyte_ab_id, _airbyte_emitted_at, {{ current_timestamp() }} as _airbyte_normalized_at diff --git a/models/generated/airbyte_ctes/unibag/orders_ab3.sql b/models/generated/airbyte_ctes/unibag/orders_ab3.sql index c222dbd..1d40234 100644 --- a/models/generated/airbyte_ctes/unibag/orders_ab3.sql +++ b/models/generated/airbyte_ctes/unibag/orders_ab3.sql @@ -13,59 +13,54 @@ select adapter.quote('date'), adapter.quote('hour'), 'note', + array_to_string('skus'), array_to_string('tags'), adapter.quote('user'), - 'price', + object_to_string('price'), boolean_to_string('banned'), 'reason', adapter.quote('source'), 'status', - 'teamid', - 'payment', + adapter.quote('update'), + object_to_string('payment'), 'remarks', 'customer', - 'delivery', - boolean_to_string('iscalled'), - 'merchant', + object_to_string('delivery'), 'pickupat', - 'supplier', + array_to_string('products'), + object_to_string('supplier'), + 'approveat', 'createdat', - 'inventory', - 'invoiceid', + object_to_string('inventory'), boolean_to_string('isdeleted'), - 'promotion', + object_to_string('promotion'), 'requestid', - 'restockat', - 'sendemail', + object_to_string('sendemail'), 'totalitem', 'updatedat', - 'useragent', + object_to_string('useragent'), boolean_to_string('wholesale'), 'approvedat', 'cashbackat', + 'codeosiris', boolean_to_string('ispreorder'), - boolean_to_string('isreviewed'), + 'membership', 'rejectedat', 'deliveredat', 'deliveringat', 'deliverycode', 'searchstring', 'staffapprove', - 'teammemberid', + 'trackingcode', 'processstatus', 'hooktimelastat', - boolean_to_string('isassigncoupon'), - boolean_to_string('isautoapproved'), - 'outboundrequest', 'trackingcodeurl', - 'trackingcode', - 'waitingcancelby', + 'approvepaymentat', boolean_to_string('ischangedelivery'), + 'trackingordercode', 'estimatecashbackat', - boolean_to_string('fromnewactivebuyer'), boolean_to_string('iswaitingcancelled'), boolean_to_string('fromnewactiveseller'), - 'waitingcancelreason', ]) }} as _airbyte_orders_hashid, tmp.* from {{ ref('orders_ab2') }} tmp diff --git a/models/generated/airbyte_ctes/unibag/orders_delivery_ab1.sql b/models/generated/airbyte_ctes/unibag/orders_delivery_ab1.sql new file mode 100644 index 0000000..3d68a4c --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/orders_delivery_ab1.sql @@ -0,0 +1,40 @@ +{{ 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('orders') }} +select + _airbyte_orders_hashid, + {{ json_extract_scalar('delivery', ['_id'], ['_id']) }} as _id, + {{ json_extract_scalar('delivery', ['fee'], ['fee']) }} as fee, + {{ json_extract_scalar('delivery', ['code'], ['code']) }} as code, + {{ json_extract_scalar('delivery', ['note'], ['note']) }} as note, + {{ json_extract_scalar('delivery', ['title'], ['title']) }} as title, + {{ json_extract_scalar('delivery', ['status'], ['status']) }} as status, + {{ json_extract('table_alias', 'delivery', ['weight'], ['weight']) }} as weight, + {{ json_extract('table_alias', 'delivery', ['feeShip'], ['feeShip']) }} as feeship, + {{ json_extract_scalar('delivery', ['currency'], ['currency']) }} as currency, + {{ json_extract_scalar('delivery', ['freeShip'], ['freeShip']) }} as freeship, + {{ json_extract('table_alias', 'delivery', ['location'], ['location']) }} as {{ adapter.quote('location') }}, + {{ json_extract_scalar('delivery', ['sourceId'], ['sourceId']) }} as sourceid, + {{ json_extract_scalar('delivery', ['courierName'], ['courierName']) }} as couriername, + {{ json_extract_scalar('delivery', ['serviceCode'], ['serviceCode']) }} as servicecode, + {{ json_extract_scalar('delivery', ['serviceName'], ['serviceName']) }} as servicename, + {{ json_extract_scalar('delivery', ['customerName'], ['customerName']) }} as customername, + {{ json_extract_scalar('delivery', ['customerPhone'], ['customerPhone']) }} as customerphone, + {{ json_extract_scalar('delivery', ['discountValue'], ['discountValue']) }} as discountvalue, + {{ json_extract_scalar('delivery', ['serviceDelivery'], ['serviceDelivery']) }} as servicedelivery, + {{ json_extract_scalar('delivery', ['estimateDeliveryAt'], ['estimateDeliveryAt']) }} as estimatedeliveryat, + {{ json_extract_scalar('delivery', ['estimateTimeDelivery'], ['estimateTimeDelivery']) }} as estimatetimedelivery, + {{ json_extract_scalar('delivery', ['maxDeliveryDay_aibyte_transform'], ['maxDeliveryDay_aibyte_transform']) }} as maxdeliveryday_aibyte_transform, + {{ json_extract_scalar('delivery', ['minDeliveryDay_aibyte_transform'], ['minDeliveryDay_aibyte_transform']) }} as mindeliveryday_aibyte_transform, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('orders') }} as table_alias +-- delivery at orders/delivery +where 1 = 1 +and delivery is not null + diff --git a/models/generated/airbyte_ctes/unibag/orders_delivery_ab2.sql b/models/generated/airbyte_ctes/unibag/orders_delivery_ab2.sql new file mode 100644 index 0000000..ef9fea6 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/orders_delivery_ab2.sql @@ -0,0 +1,39 @@ +{{ 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('orders_delivery_ab1') }} +select + _airbyte_orders_hashid, + cast(_id as {{ dbt_utils.type_string() }}) as _id, + cast(fee as {{ dbt_utils.type_float() }}) as fee, + cast(code as {{ dbt_utils.type_string() }}) as code, + cast(note as {{ dbt_utils.type_string() }}) as note, + cast(title as {{ dbt_utils.type_string() }}) as title, + cast(status as {{ dbt_utils.type_string() }}) as status, + cast(weight as {{ type_json() }}) as weight, + cast(feeship as {{ type_json() }}) as feeship, + cast(currency as {{ dbt_utils.type_string() }}) as currency, + {{ cast_to_boolean('freeship') }} as freeship, + cast({{ adapter.quote('location') }} as {{ type_json() }}) as {{ adapter.quote('location') }}, + cast(sourceid as {{ dbt_utils.type_float() }}) as sourceid, + cast(couriername as {{ dbt_utils.type_string() }}) as couriername, + cast(servicecode as {{ dbt_utils.type_string() }}) as servicecode, + cast(servicename as {{ dbt_utils.type_string() }}) as servicename, + cast(customername as {{ dbt_utils.type_string() }}) as customername, + cast(customerphone as {{ dbt_utils.type_string() }}) as customerphone, + cast(discountvalue as {{ dbt_utils.type_float() }}) as discountvalue, + cast(servicedelivery as {{ dbt_utils.type_string() }}) as servicedelivery, + cast(estimatedeliveryat as {{ dbt_utils.type_string() }}) as estimatedeliveryat, + cast(estimatetimedelivery as {{ dbt_utils.type_string() }}) as estimatetimedelivery, + cast(maxdeliveryday_aibyte_transform as {{ dbt_utils.type_string() }}) as maxdeliveryday_aibyte_transform, + cast(mindeliveryday_aibyte_transform as {{ dbt_utils.type_string() }}) as mindeliveryday_aibyte_transform, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('orders_delivery_ab1') }} +-- delivery at orders/delivery +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/orders_delivery_ab3.sql b/models/generated/airbyte_ctes/unibag/orders_delivery_ab3.sql new file mode 100644 index 0000000..2e4d9f0 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/orders_delivery_ab3.sql @@ -0,0 +1,39 @@ +{{ 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('orders_delivery_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_orders_hashid', + '_id', + 'fee', + 'code', + 'note', + 'title', + 'status', + object_to_string('weight'), + object_to_string('feeship'), + 'currency', + boolean_to_string('freeship'), + object_to_string(adapter.quote('location')), + 'sourceid', + 'couriername', + 'servicecode', + 'servicename', + 'customername', + 'customerphone', + 'discountvalue', + 'servicedelivery', + 'estimatedeliveryat', + 'estimatetimedelivery', + 'maxdeliveryday_aibyte_transform', + 'mindeliveryday_aibyte_transform', + ]) }} as _airbyte_delivery_hashid, + tmp.* +from {{ ref('orders_delivery_ab2') }} tmp +-- delivery at orders/delivery +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/orders_delivery_feeship_ab1.sql b/models/generated/airbyte_ctes/unibag/orders_delivery_feeship_ab1.sql new file mode 100644 index 0000000..799a1d4 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/orders_delivery_feeship_ab1.sql @@ -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('orders_delivery') }} +select + _airbyte_delivery_hashid, + {{ json_extract_scalar('feeship', ['cod'], ['cod']) }} as cod, + {{ json_extract_scalar('feeship', ['total'], ['total']) }} as total, + {{ json_extract_scalar('feeship', ['shipping'], ['shipping']) }} as shipping, + {{ json_extract_scalar('feeship', ['insurance'], ['insurance']) }} as insurance, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('orders_delivery') }} as table_alias +-- feeship at orders/delivery/feeShip +where 1 = 1 +and feeship is not null + diff --git a/models/generated/airbyte_ctes/unibag/orders_delivery_feeship_ab2.sql b/models/generated/airbyte_ctes/unibag/orders_delivery_feeship_ab2.sql new file mode 100644 index 0000000..0c7a645 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/orders_delivery_feeship_ab2.sql @@ -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('orders_delivery_feeship_ab1') }} +select + _airbyte_delivery_hashid, + cast(cod as {{ dbt_utils.type_float() }}) as cod, + cast(total as {{ dbt_utils.type_float() }}) as total, + cast(shipping as {{ dbt_utils.type_float() }}) as shipping, + cast(insurance as {{ dbt_utils.type_float() }}) as insurance, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('orders_delivery_feeship_ab1') }} +-- feeship at orders/delivery/feeShip +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/orders_delivery_feeship_ab3.sql b/models/generated/airbyte_ctes/unibag/orders_delivery_feeship_ab3.sql new file mode 100644 index 0000000..1a36d22 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/orders_delivery_feeship_ab3.sql @@ -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('orders_delivery_feeship_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_delivery_hashid', + 'cod', + 'total', + 'shipping', + 'insurance', + ]) }} as _airbyte_feeship_hashid, + tmp.* +from {{ ref('orders_delivery_feeship_ab2') }} tmp +-- feeship at orders/delivery/feeShip +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/orders_delivery_location_ab1.sql b/models/generated/airbyte_ctes/unibag/orders_delivery_location_ab1.sql new file mode 100644 index 0000000..5e877d7 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/orders_delivery_location_ab1.sql @@ -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('orders_delivery') }} +select + _airbyte_delivery_hashid, + {{ json_extract_scalar(adapter.quote('location'), ['_id'], ['_id']) }} as _id, + {{ 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_scalar(adapter.quote('location'), ['province'], ['province']) }} as province, + {{ json_extract_scalar(adapter.quote('location'), ['fullAddress'], ['fullAddress']) }} as fulladdress, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('orders_delivery') }} as table_alias +-- location at orders/delivery/location +where 1 = 1 +and {{ adapter.quote('location') }} is not null + diff --git a/models/generated/airbyte_ctes/unibag/orders_delivery_location_ab2.sql b/models/generated/airbyte_ctes/unibag/orders_delivery_location_ab2.sql new file mode 100644 index 0000000..b9475c1 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/orders_delivery_location_ab2.sql @@ -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('orders_delivery_location_ab1') }} +select + _airbyte_delivery_hashid, + cast(_id as {{ dbt_utils.type_string() }}) as _id, + cast(ward as {{ dbt_utils.type_float() }}) as ward, + cast(address as {{ dbt_utils.type_string() }}) as address, + cast(district as {{ dbt_utils.type_float() }}) as district, + cast(province as {{ dbt_utils.type_float() }}) as province, + cast(fulladdress as {{ dbt_utils.type_string() }}) as fulladdress, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('orders_delivery_location_ab1') }} +-- location at orders/delivery/location +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/orders_delivery_location_ab3.sql b/models/generated/airbyte_ctes/unibag/orders_delivery_location_ab3.sql new file mode 100644 index 0000000..5ff7a3f --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/orders_delivery_location_ab3.sql @@ -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('orders_delivery_location_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_delivery_hashid', + '_id', + 'ward', + 'address', + 'district', + 'province', + 'fulladdress', + ]) }} as _airbyte_location_hashid, + tmp.* +from {{ ref('orders_delivery_location_ab2') }} tmp +-- location at orders/delivery/location +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/orders_delivery_weight_ab1.sql b/models/generated/airbyte_ctes/unibag/orders_delivery_weight_ab1.sql new file mode 100644 index 0000000..06ed5cf --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/orders_delivery_weight_ab1.sql @@ -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('orders_delivery') }} +select + _airbyte_delivery_hashid, + {{ json_extract_scalar('weight', ['real'], ['real']) }} as {{ adapter.quote('real') }}, + {{ json_extract_scalar('weight', ['sent'], ['sent']) }} as sent, + {{ json_extract_scalar('weight', ['converted'], ['converted']) }} as converted, + {{ json_extract_scalar('weight', ['multiplier'], ['multiplier']) }} as multiplier, + {{ json_extract_scalar('weight', ['convertedWithMultiplier'], ['convertedWithMultiplier']) }} as convertedwithmultiplier, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('orders_delivery') }} as table_alias +-- weight at orders/delivery/weight +where 1 = 1 +and weight is not null + diff --git a/models/generated/airbyte_ctes/unibag/orders_delivery_weight_ab2.sql b/models/generated/airbyte_ctes/unibag/orders_delivery_weight_ab2.sql new file mode 100644 index 0000000..7e993da --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/orders_delivery_weight_ab2.sql @@ -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('orders_delivery_weight_ab1') }} +select + _airbyte_delivery_hashid, + cast({{ adapter.quote('real') }} as {{ dbt_utils.type_float() }}) as {{ adapter.quote('real') }}, + cast(sent as {{ dbt_utils.type_float() }}) as sent, + cast(converted as {{ dbt_utils.type_float() }}) as converted, + cast(multiplier as {{ dbt_utils.type_float() }}) as multiplier, + cast(convertedwithmultiplier as {{ dbt_utils.type_float() }}) as convertedwithmultiplier, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('orders_delivery_weight_ab1') }} +-- weight at orders/delivery/weight +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/orders_delivery_weight_ab3.sql b/models/generated/airbyte_ctes/unibag/orders_delivery_weight_ab3.sql new file mode 100644 index 0000000..4cae173 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/orders_delivery_weight_ab3.sql @@ -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('orders_delivery_weight_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_delivery_hashid', + adapter.quote('real'), + 'sent', + 'converted', + 'multiplier', + 'convertedwithmultiplier', + ]) }} as _airbyte_weight_hashid, + tmp.* +from {{ ref('orders_delivery_weight_ab2') }} tmp +-- weight at orders/delivery/weight +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/orders_inventory_ab1.sql b/models/generated/airbyte_ctes/unibag/orders_inventory_ab1.sql new file mode 100644 index 0000000..4656824 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/orders_inventory_ab1.sql @@ -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('orders') }} +select + _airbyte_orders_hashid, + {{ json_extract_scalar('inventory', ['id'], ['id']) }} as {{ adapter.quote('id') }}, + {{ json_extract_scalar('inventory', ['_id'], ['_id']) }} as _id, + {{ json_extract_scalar('inventory', ['name'], ['name']) }} as {{ adapter.quote('name') }}, + {{ json_extract_scalar('inventory', ['canIssueInvoice'], ['canIssueInvoice']) }} as canissueinvoice, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('orders') }} as table_alias +-- inventory at orders/inventory +where 1 = 1 +and inventory is not null + diff --git a/models/generated/airbyte_ctes/unibag/orders_inventory_ab2.sql b/models/generated/airbyte_ctes/unibag/orders_inventory_ab2.sql new file mode 100644 index 0000000..d75f00f --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/orders_inventory_ab2.sql @@ -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('orders_inventory_ab1') }} +select + _airbyte_orders_hashid, + cast({{ adapter.quote('id') }} as {{ dbt_utils.type_float() }}) as {{ adapter.quote('id') }}, + cast(_id as {{ dbt_utils.type_string() }}) as _id, + cast({{ adapter.quote('name') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('name') }}, + {{ cast_to_boolean('canissueinvoice') }} as canissueinvoice, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('orders_inventory_ab1') }} +-- inventory at orders/inventory +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/orders_inventory_ab3.sql b/models/generated/airbyte_ctes/unibag/orders_inventory_ab3.sql new file mode 100644 index 0000000..22bb404 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/orders_inventory_ab3.sql @@ -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('orders_inventory_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_orders_hashid', + adapter.quote('id'), + '_id', + adapter.quote('name'), + boolean_to_string('canissueinvoice'), + ]) }} as _airbyte_inventory_hashid, + tmp.* +from {{ ref('orders_inventory_ab2') }} tmp +-- inventory at orders/inventory +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/orders_payment_ab1.sql b/models/generated/airbyte_ctes/unibag/orders_payment_ab1.sql new file mode 100644 index 0000000..ab82277 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/orders_payment_ab1.sql @@ -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('orders') }} +select + _airbyte_orders_hashid, + {{ json_extract_scalar('payment', ['_id'], ['_id']) }} as _id, + {{ json_extract_scalar('payment', ['method'], ['method']) }} as {{ adapter.quote('method') }}, + {{ json_extract_scalar('payment', ['status'], ['status']) }} as status, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('orders') }} as table_alias +-- payment at orders/payment +where 1 = 1 +and payment is not null + diff --git a/models/generated/airbyte_ctes/unibag/orders_payment_ab2.sql b/models/generated/airbyte_ctes/unibag/orders_payment_ab2.sql new file mode 100644 index 0000000..0f69d3b --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/orders_payment_ab2.sql @@ -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('orders_payment_ab1') }} +select + _airbyte_orders_hashid, + cast(_id as {{ dbt_utils.type_string() }}) as _id, + cast({{ adapter.quote('method') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('method') }}, + cast(status as {{ dbt_utils.type_string() }}) as status, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('orders_payment_ab1') }} +-- payment at orders/payment +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/orders_payment_ab3.sql b/models/generated/airbyte_ctes/unibag/orders_payment_ab3.sql new file mode 100644 index 0000000..57e0452 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/orders_payment_ab3.sql @@ -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('orders_payment_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_orders_hashid', + '_id', + adapter.quote('method'), + 'status', + ]) }} as _airbyte_payment_hashid, + tmp.* +from {{ ref('orders_payment_ab2') }} tmp +-- payment at orders/payment +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/orders_price_ab1.sql b/models/generated/airbyte_ctes/unibag/orders_price_ab1.sql new file mode 100644 index 0000000..8120d52 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/orders_price_ab1.sql @@ -0,0 +1,31 @@ +{{ 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('orders') }} +select + _airbyte_orders_hashid, + {{ json_extract_scalar('price', ['sell'], ['sell']) }} as sell, + {{ json_extract_scalar('price', ['total'], ['total']) }} as total, + {{ json_extract_scalar('price', ['market'], ['market']) }} as market, + {{ json_extract_scalar('price', ['weight'], ['weight']) }} as weight, + {{ json_extract_scalar('price', ['maximum'], ['maximum']) }} as maximum, + {{ json_extract_scalar('price', ['minimum'], ['minimum']) }} as minimum, + {{ json_extract_scalar('price', ['profitUni'], ['profitUni']) }} as profituni, + {{ json_extract_scalar('price', ['promotion'], ['promotion']) }} as promotion, + {{ json_extract_scalar('price', ['supplierPrice'], ['supplierPrice']) }} as supplierprice, + {{ json_extract_scalar('price', ['wholesaleBonus'], ['wholesaleBonus']) }} as wholesalebonus, + {{ json_extract_scalar('price', ['membershipPercent'], ['membershipPercent']) }} as membershippercent, + {{ json_extract_scalar('price', ['membershipCommission'], ['membershipCommission']) }} as membershipcommission, + {{ json_extract_scalar('price', ['base_aibyte_transform'], ['base_aibyte_transform']) }} as base_aibyte_transform, + {{ json_extract_scalar('price', ['profit_aibyte_transform'], ['profit_aibyte_transform']) }} as profit_aibyte_transform, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('orders') }} as table_alias +-- price at orders/price +where 1 = 1 +and price is not null + diff --git a/models/generated/airbyte_ctes/unibag/orders_price_ab2.sql b/models/generated/airbyte_ctes/unibag/orders_price_ab2.sql new file mode 100644 index 0000000..ba0500d --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/orders_price_ab2.sql @@ -0,0 +1,30 @@ +{{ 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('orders_price_ab1') }} +select + _airbyte_orders_hashid, + cast(sell as {{ dbt_utils.type_float() }}) as sell, + cast(total as {{ dbt_utils.type_float() }}) as total, + cast(market as {{ dbt_utils.type_float() }}) as market, + cast(weight as {{ dbt_utils.type_float() }}) as weight, + cast(maximum as {{ dbt_utils.type_float() }}) as maximum, + cast(minimum as {{ dbt_utils.type_float() }}) as minimum, + cast(profituni as {{ dbt_utils.type_float() }}) as profituni, + cast(promotion as {{ dbt_utils.type_float() }}) as promotion, + cast(supplierprice as {{ dbt_utils.type_float() }}) as supplierprice, + cast(wholesalebonus as {{ dbt_utils.type_float() }}) as wholesalebonus, + cast(membershippercent as {{ dbt_utils.type_float() }}) as membershippercent, + cast(membershipcommission as {{ dbt_utils.type_float() }}) as membershipcommission, + cast(base_aibyte_transform as {{ dbt_utils.type_string() }}) as base_aibyte_transform, + cast(profit_aibyte_transform as {{ dbt_utils.type_string() }}) as profit_aibyte_transform, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('orders_price_ab1') }} +-- price at orders/price +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/orders_price_ab3.sql b/models/generated/airbyte_ctes/unibag/orders_price_ab3.sql new file mode 100644 index 0000000..5225393 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/orders_price_ab3.sql @@ -0,0 +1,30 @@ +{{ 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('orders_price_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_orders_hashid', + 'sell', + 'total', + 'market', + 'weight', + 'maximum', + 'minimum', + 'profituni', + 'promotion', + 'supplierprice', + 'wholesalebonus', + 'membershippercent', + 'membershipcommission', + 'base_aibyte_transform', + 'profit_aibyte_transform', + ]) }} as _airbyte_price_hashid, + tmp.* +from {{ ref('orders_price_ab2') }} tmp +-- price at orders/price +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/orders_promotion_ab1.sql b/models/generated/airbyte_ctes/unibag/orders_promotion_ab1.sql new file mode 100644 index 0000000..303b17a --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/orders_promotion_ab1.sql @@ -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('orders') }} +select + _airbyte_orders_hashid, + {{ json_extract_scalar('promotion', ['type'], ['type']) }} as {{ adapter.quote('type') }}, + {{ json_extract_scalar('promotion', ['discount'], ['discount']) }} as discount, + {{ json_extract_scalar('promotion', ['isApplied'], ['isApplied']) }} as isapplied, + {{ json_extract_scalar('promotion', ['minOrderValue'], ['minOrderValue']) }} as minordervalue, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('orders') }} as table_alias +-- promotion at orders/promotion +where 1 = 1 +and promotion is not null + diff --git a/models/generated/airbyte_ctes/unibag/orders_promotion_ab2.sql b/models/generated/airbyte_ctes/unibag/orders_promotion_ab2.sql new file mode 100644 index 0000000..6836493 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/orders_promotion_ab2.sql @@ -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('orders_promotion_ab1') }} +select + _airbyte_orders_hashid, + cast({{ adapter.quote('type') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('type') }}, + cast(discount as {{ dbt_utils.type_float() }}) as discount, + {{ cast_to_boolean('isapplied') }} as isapplied, + cast(minordervalue as {{ dbt_utils.type_float() }}) as minordervalue, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('orders_promotion_ab1') }} +-- promotion at orders/promotion +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/orders_promotion_ab3.sql b/models/generated/airbyte_ctes/unibag/orders_promotion_ab3.sql new file mode 100644 index 0000000..80d8732 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/orders_promotion_ab3.sql @@ -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('orders_promotion_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_orders_hashid', + adapter.quote('type'), + 'discount', + boolean_to_string('isapplied'), + 'minordervalue', + ]) }} as _airbyte_promotion_hashid, + tmp.* +from {{ ref('orders_promotion_ab2') }} tmp +-- promotion at orders/promotion +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/orders_sendemail_ab1.sql b/models/generated/airbyte_ctes/unibag/orders_sendemail_ab1.sql new file mode 100644 index 0000000..d4cbe0a --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/orders_sendemail_ab1.sql @@ -0,0 +1,18 @@ +{{ 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('orders') }} +select + _airbyte_orders_hashid, + {{ json_extract_scalar('sendemail', ['status'], ['status']) }} as status, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('orders') }} as table_alias +-- sendemail at orders/sendEmail +where 1 = 1 +and sendemail is not null + diff --git a/models/generated/airbyte_ctes/unibag/orders_sendemail_ab2.sql b/models/generated/airbyte_ctes/unibag/orders_sendemail_ab2.sql new file mode 100644 index 0000000..dd99b65 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/orders_sendemail_ab2.sql @@ -0,0 +1,17 @@ +{{ 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('orders_sendemail_ab1') }} +select + _airbyte_orders_hashid, + cast(status as {{ dbt_utils.type_string() }}) as status, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('orders_sendemail_ab1') }} +-- sendemail at orders/sendEmail +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/orders_sendemail_ab3.sql b/models/generated/airbyte_ctes/unibag/orders_sendemail_ab3.sql new file mode 100644 index 0000000..97600ae --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/orders_sendemail_ab3.sql @@ -0,0 +1,17 @@ +{{ 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('orders_sendemail_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_orders_hashid', + 'status', + ]) }} as _airbyte_sendemail_hashid, + tmp.* +from {{ ref('orders_sendemail_ab2') }} tmp +-- sendemail at orders/sendEmail +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/orders_supplier_ab1.sql b/models/generated/airbyte_ctes/unibag/orders_supplier_ab1.sql new file mode 100644 index 0000000..e251015 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/orders_supplier_ab1.sql @@ -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('orders') }} +select + _airbyte_orders_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('orders') }} as table_alias +-- supplier at orders/supplier +where 1 = 1 +and supplier is not null + diff --git a/models/generated/airbyte_ctes/unibag/orders_supplier_ab2.sql b/models/generated/airbyte_ctes/unibag/orders_supplier_ab2.sql new file mode 100644 index 0000000..49bde74 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/orders_supplier_ab2.sql @@ -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('orders_supplier_ab1') }} +select + _airbyte_orders_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('orders_supplier_ab1') }} +-- supplier at orders/supplier +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/orders_supplier_ab3.sql b/models/generated/airbyte_ctes/unibag/orders_supplier_ab3.sql new file mode 100644 index 0000000..13f427c --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/orders_supplier_ab3.sql @@ -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('orders_supplier_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_orders_hashid', + '_id', + adapter.quote('name'), + 'searchstring', + ]) }} as _airbyte_supplier_hashid, + tmp.* +from {{ ref('orders_supplier_ab2') }} tmp +-- supplier at orders/supplier +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/orders_useragent_ab1.sql b/models/generated/airbyte_ctes/unibag/orders_useragent_ab1.sql new file mode 100644 index 0000000..5371696 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/orders_useragent_ab1.sql @@ -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('orders') }} +select + _airbyte_orders_hashid, + {{ json_extract_scalar('useragent', ['ip'], ['ip']) }} as ip, + {{ json_extract_scalar('useragent', ['version'], ['version']) }} as {{ adapter.quote('version') }}, + {{ json_extract_scalar('useragent', ['platform'], ['platform']) }} as platform, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('orders') }} as table_alias +-- useragent at orders/userAgent +where 1 = 1 +and useragent is not null + diff --git a/models/generated/airbyte_ctes/unibag/orders_useragent_ab2.sql b/models/generated/airbyte_ctes/unibag/orders_useragent_ab2.sql new file mode 100644 index 0000000..4db6224 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/orders_useragent_ab2.sql @@ -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('orders_useragent_ab1') }} +select + _airbyte_orders_hashid, + cast(ip as {{ dbt_utils.type_string() }}) as ip, + cast({{ adapter.quote('version') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('version') }}, + cast(platform as {{ dbt_utils.type_string() }}) as platform, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('orders_useragent_ab1') }} +-- useragent at orders/userAgent +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/orders_useragent_ab3.sql b/models/generated/airbyte_ctes/unibag/orders_useragent_ab3.sql new file mode 100644 index 0000000..7f8f71a --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/orders_useragent_ab3.sql @@ -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('orders_useragent_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_orders_hashid', + 'ip', + adapter.quote('version'), + 'platform', + ]) }} as _airbyte_useragent_hashid, + tmp.* +from {{ ref('orders_useragent_ab2') }} tmp +-- useragent at orders/userAgent +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/product_categories_ab1.sql b/models/generated/airbyte_ctes/unibag/product_categories_ab1.sql index 3b71d62..6fd50c8 100644 --- a/models/generated/airbyte_ctes/unibag/product_categories_ab1.sql +++ b/models/generated/airbyte_ctes/unibag/product_categories_ab1.sql @@ -8,7 +8,7 @@ -- depends_on: {{ source('unibag', '_airbyte_raw_product_categories') }} select {{ json_extract_scalar('_airbyte_data', ['_id'], ['_id']) }} as _id, - {{ 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', ['color'], ['color']) }} as color, {{ json_extract_scalar('_airbyte_data', ['order'], ['order']) }} as {{ adapter.quote('order') }}, @@ -16,6 +16,7 @@ select {{ json_extract_array('_airbyte_data', ['covers'], ['covers']) }} as covers, {{ json_extract_scalar('_airbyte_data', ['featured'], ['featured']) }} as featured, {{ json_extract_scalar('_airbyte_data', ['createdAt'], ['createdAt']) }} as createdat, + {{ json_extract('table_alias', '_airbyte_data', ['statistic'], ['statistic']) }} as statistic, {{ json_extract_scalar('_airbyte_data', ['updatedAt'], ['updatedAt']) }} as updatedat, {{ json_extract_scalar('_airbyte_data', ['totalProduct'], ['totalProduct']) }} as totalproduct, _airbyte_ab_id, diff --git a/models/generated/airbyte_ctes/unibag/product_categories_ab2.sql b/models/generated/airbyte_ctes/unibag/product_categories_ab2.sql index ccdf80e..372cd94 100644 --- a/models/generated/airbyte_ctes/unibag/product_categories_ab2.sql +++ b/models/generated/airbyte_ctes/unibag/product_categories_ab2.sql @@ -8,7 +8,7 @@ -- depends_on: {{ ref('product_categories_ab1') }} select cast(_id as {{ dbt_utils.type_string() }}) as _id, - 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(color as {{ dbt_utils.type_string() }}) as color, cast({{ adapter.quote('order') }} as {{ dbt_utils.type_float() }}) as {{ adapter.quote('order') }}, @@ -16,6 +16,7 @@ select covers, {{ cast_to_boolean('featured') }} as featured, cast(createdat as {{ dbt_utils.type_string() }}) as createdat, + cast(statistic as {{ type_json() }}) as statistic, cast(updatedat as {{ dbt_utils.type_string() }}) as updatedat, cast(totalproduct as {{ dbt_utils.type_float() }}) as totalproduct, _airbyte_ab_id, diff --git a/models/generated/airbyte_ctes/unibag/product_categories_ab3.sql b/models/generated/airbyte_ctes/unibag/product_categories_ab3.sql index 4efd8d0..054708f 100644 --- a/models/generated/airbyte_ctes/unibag/product_categories_ab3.sql +++ b/models/generated/airbyte_ctes/unibag/product_categories_ab3.sql @@ -9,7 +9,7 @@ select {{ dbt_utils.surrogate_key([ '_id', - 'icon', + object_to_string('icon'), adapter.quote('name'), 'color', adapter.quote('order'), @@ -17,6 +17,7 @@ select array_to_string('covers'), boolean_to_string('featured'), 'createdat', + object_to_string('statistic'), 'updatedat', 'totalproduct', ]) }} as _airbyte_product_categories_hashid, diff --git a/models/generated/airbyte_ctes/unibag/product_categories_icon_ab1.sql b/models/generated/airbyte_ctes/unibag/product_categories_icon_ab1.sql new file mode 100644 index 0000000..0eb2ff9 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_categories_icon_ab1.sql @@ -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('product_categories') }} +select + _airbyte_product_categories_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('product_categories') }} as table_alias +-- icon at product-categories/icon +where 1 = 1 +and icon is not null + diff --git a/models/generated/airbyte_ctes/unibag/product_categories_icon_ab2.sql b/models/generated/airbyte_ctes/unibag/product_categories_icon_ab2.sql new file mode 100644 index 0000000..e737558 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_categories_icon_ab2.sql @@ -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('product_categories_icon_ab1') }} +select + _airbyte_product_categories_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('product_categories_icon_ab1') }} +-- icon at product-categories/icon +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/product_categories_icon_ab3.sql b/models/generated/airbyte_ctes/unibag/product_categories_icon_ab3.sql new file mode 100644 index 0000000..63d59ba --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_categories_icon_ab3.sql @@ -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('product_categories_icon_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_product_categories_hashid', + '_id', + adapter.quote('name'), + object_to_string('dimensions'), + ]) }} as _airbyte_icon_hashid, + tmp.* +from {{ ref('product_categories_icon_ab2') }} tmp +-- icon at product-categories/icon +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/product_categories_icon_dimensions_ab1.sql b/models/generated/airbyte_ctes/unibag/product_categories_icon_dimensions_ab1.sql new file mode 100644 index 0000000..de3b9b2 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_categories_icon_dimensions_ab1.sql @@ -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('product_categories_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('product_categories_icon') }} as table_alias +-- dimensions at product-categories/icon/dimensions +where 1 = 1 +and dimensions is not null + diff --git a/models/generated/airbyte_ctes/unibag/product_categories_icon_dimensions_ab2.sql b/models/generated/airbyte_ctes/unibag/product_categories_icon_dimensions_ab2.sql new file mode 100644 index 0000000..aaf15de --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_categories_icon_dimensions_ab2.sql @@ -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('product_categories_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('product_categories_icon_dimensions_ab1') }} +-- dimensions at product-categories/icon/dimensions +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/product_categories_icon_dimensions_ab3.sql b/models/generated/airbyte_ctes/unibag/product_categories_icon_dimensions_ab3.sql new file mode 100644 index 0000000..ba255cd --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_categories_icon_dimensions_ab3.sql @@ -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('product_categories_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('product_categories_icon_dimensions_ab2') }} tmp +-- dimensions at product-categories/icon/dimensions +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/product_categories_icon_dimensions_md_ab1.sql b/models/generated/airbyte_ctes/unibag/product_categories_icon_dimensions_md_ab1.sql new file mode 100644 index 0000000..c7535f3 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_categories_icon_dimensions_md_ab1.sql @@ -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('product_categories_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('product_categories_icon_dimensions') }} as table_alias +-- md at product-categories/icon/dimensions/md +where 1 = 1 +and md is not null + diff --git a/models/generated/airbyte_ctes/unibag/product_categories_icon_dimensions_md_ab2.sql b/models/generated/airbyte_ctes/unibag/product_categories_icon_dimensions_md_ab2.sql new file mode 100644 index 0000000..f2a27c6 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_categories_icon_dimensions_md_ab2.sql @@ -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('product_categories_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('product_categories_icon_dimensions_md_ab1') }} +-- md at product-categories/icon/dimensions/md +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/product_categories_icon_dimensions_md_ab3.sql b/models/generated/airbyte_ctes/unibag/product_categories_icon_dimensions_md_ab3.sql new file mode 100644 index 0000000..f813dc5 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_categories_icon_dimensions_md_ab3.sql @@ -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('product_categories_icon_dimensions_md_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_dimensions_hashid', + 'url', + 'width', + 'height', + ]) }} as _airbyte_md_hashid, + tmp.* +from {{ ref('product_categories_icon_dimensions_md_ab2') }} tmp +-- md at product-categories/icon/dimensions/md +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/product_categories_icon_dimensions_sm_ab1.sql b/models/generated/airbyte_ctes/unibag/product_categories_icon_dimensions_sm_ab1.sql new file mode 100644 index 0000000..66c656a --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_categories_icon_dimensions_sm_ab1.sql @@ -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('product_categories_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('product_categories_icon_dimensions') }} as table_alias +-- sm at product-categories/icon/dimensions/sm +where 1 = 1 +and sm is not null + diff --git a/models/generated/airbyte_ctes/unibag/product_categories_icon_dimensions_sm_ab2.sql b/models/generated/airbyte_ctes/unibag/product_categories_icon_dimensions_sm_ab2.sql new file mode 100644 index 0000000..5657222 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_categories_icon_dimensions_sm_ab2.sql @@ -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('product_categories_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('product_categories_icon_dimensions_sm_ab1') }} +-- sm at product-categories/icon/dimensions/sm +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/product_categories_icon_dimensions_sm_ab3.sql b/models/generated/airbyte_ctes/unibag/product_categories_icon_dimensions_sm_ab3.sql new file mode 100644 index 0000000..577dfd1 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_categories_icon_dimensions_sm_ab3.sql @@ -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('product_categories_icon_dimensions_sm_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_dimensions_hashid', + 'url', + 'width', + 'height', + ]) }} as _airbyte_sm_hashid, + tmp.* +from {{ ref('product_categories_icon_dimensions_sm_ab2') }} tmp +-- sm at product-categories/icon/dimensions/sm +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/product_categories_statistic_ab1.sql b/models/generated/airbyte_ctes/unibag/product_categories_statistic_ab1.sql new file mode 100644 index 0000000..41b942a --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_categories_statistic_ab1.sql @@ -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('product_categories') }} +select + _airbyte_product_categories_hashid, + {{ json_extract_scalar('statistic', ['salesTotal'], ['salesTotal']) }} as salestotal, + {{ json_extract_scalar('statistic', ['totalShare'], ['totalShare']) }} as totalshare, + {{ json_extract_scalar('statistic', ['salesWeekTotal'], ['salesWeekTotal']) }} as salesweektotal, + {{ json_extract_scalar('statistic', ['salesYearTotal'], ['salesYearTotal']) }} as salesyeartotal, + {{ json_extract_scalar('statistic', ['salesMonthTotal'], ['salesMonthTotal']) }} as salesmonthtotal, + {{ json_extract_scalar('statistic', ['salesTwoMonthTotal'], ['salesTwoMonthTotal']) }} as salestwomonthtotal, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('product_categories') }} as table_alias +-- statistic at product-categories/statistic +where 1 = 1 +and statistic is not null + diff --git a/models/generated/airbyte_ctes/unibag/product_categories_statistic_ab2.sql b/models/generated/airbyte_ctes/unibag/product_categories_statistic_ab2.sql new file mode 100644 index 0000000..d89987d --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_categories_statistic_ab2.sql @@ -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('product_categories_statistic_ab1') }} +select + _airbyte_product_categories_hashid, + cast(salestotal as {{ dbt_utils.type_float() }}) as salestotal, + cast(totalshare as {{ dbt_utils.type_float() }}) as totalshare, + cast(salesweektotal as {{ dbt_utils.type_float() }}) as salesweektotal, + cast(salesyeartotal as {{ dbt_utils.type_float() }}) as salesyeartotal, + cast(salesmonthtotal as {{ dbt_utils.type_float() }}) as salesmonthtotal, + cast(salestwomonthtotal as {{ dbt_utils.type_float() }}) as salestwomonthtotal, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('product_categories_statistic_ab1') }} +-- statistic at product-categories/statistic +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/product_categories_statistic_ab3.sql b/models/generated/airbyte_ctes/unibag/product_categories_statistic_ab3.sql new file mode 100644 index 0000000..444c227 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_categories_statistic_ab3.sql @@ -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('product_categories_statistic_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_product_categories_hashid', + 'salestotal', + 'totalshare', + 'salesweektotal', + 'salesyeartotal', + 'salesmonthtotal', + 'salestwomonthtotal', + ]) }} as _airbyte_statistic_hashid, + tmp.* +from {{ ref('product_categories_statistic_ab2') }} tmp +-- statistic at product-categories/statistic +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/product_sku_ab1.sql b/models/generated/airbyte_ctes/unibag/product_sku_ab1.sql index 9a8e52a..0fc77fb 100644 --- a/models/generated/airbyte_ctes/unibag/product_sku_ab1.sql +++ b/models/generated/airbyte_ctes/unibag/product_sku_ab1.sql @@ -9,14 +9,15 @@ select {{ json_extract_scalar('_airbyte_data', ['_id'], ['_id']) }} as _id, {{ json_extract_scalar('_airbyte_data', ['sku'], ['sku']) }} as sku, - {{ 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', ['type'], ['type']) }} as {{ adapter.quote('type') }}, {{ json_extract_scalar('_airbyte_data', ['brand'], ['brand']) }} as brand, {{ json_extract_scalar('_airbyte_data', ['cover'], ['cover']) }} as cover, - {{ json_extract_scalar('_airbyte_data', ['price'], ['price']) }} as price, + {{ json_extract('table_alias', '_airbyte_data', ['price'], ['price']) }} as price, {{ json_extract_scalar('_airbyte_data', ['active'], ['active']) }} as active, {{ json_extract_scalar('_airbyte_data', ['author'], ['author']) }} as author, + {{ json_extract_scalar('_airbyte_data', ['manual'], ['manual']) }} as manual, {{ json_extract_scalar('_airbyte_data', ['source'], ['source']) }} as {{ adapter.quote('source') }}, {{ json_extract_scalar('_airbyte_data', ['display'], ['display']) }} as display, {{ json_extract_scalar('_airbyte_data', ['picture'], ['picture']) }} as picture, @@ -26,16 +27,16 @@ select {{ json_extract_scalar('_airbyte_data', ['unitCode'], ['unitCode']) }} as unitcode, {{ json_extract_scalar('_airbyte_data', ['createdAt'], ['createdAt']) }} as createdat, {{ json_extract_scalar('_airbyte_data', ['restockAt'], ['restockAt']) }} as restockat, - {{ 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', ['couponInfo'], ['couponInfo']) }} as couponinfo, {{ json_extract_array('_airbyte_data', ['properties'], ['properties']) }} as properties, {{ json_extract_scalar('_airbyte_data', ['canPreorder'], ['canPreorder']) }} as canpreorder, {{ json_extract_scalar('_airbyte_data', ['supplierSku'], ['supplierSku']) }} as suppliersku, {{ json_extract_scalar('_airbyte_data', ['isOutOfStock'], ['isOutOfStock']) }} as isoutofstock, - {{ json_extract_scalar('_airbyte_data', ['pricePercent'], ['pricePercent']) }} as pricepercent, + {{ json_extract('table_alias', '_airbyte_data', ['pricePercent'], ['pricePercent']) }} as pricepercent, {{ json_extract_scalar('_airbyte_data', ['searchString'], ['searchString']) }} as searchstring, - {{ json_extract_scalar('_airbyte_data', ['quantity'], ['quantity']) }} as quantity, + {{ json_extract_scalar('_airbyte_data', ['updateReason'], ['updateReason']) }} as updatereason, + {{ json_extract_scalar('_airbyte_data', ['updateActiveId'], ['updateActiveId']) }} as updateactiveid, {{ json_extract_scalar('_airbyte_data', ['displayInventory'], ['displayInventory']) }} as displayinventory, {{ json_extract_scalar('_airbyte_data', ['showRemainingQuantity'], ['showRemainingQuantity']) }} as showremainingquantity, {{ json_extract_scalar('_airbyte_data', ['quantity_aibyte_transform'], ['quantity_aibyte_transform']) }} as quantity_aibyte_transform, diff --git a/models/generated/airbyte_ctes/unibag/product_sku_ab2.sql b/models/generated/airbyte_ctes/unibag/product_sku_ab2.sql index 4a1fb08..8a11d7a 100644 --- a/models/generated/airbyte_ctes/unibag/product_sku_ab2.sql +++ b/models/generated/airbyte_ctes/unibag/product_sku_ab2.sql @@ -9,14 +9,15 @@ select cast(_id as {{ dbt_utils.type_string() }}) as _id, cast(sku as {{ dbt_utils.type_string() }}) as sku, - 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('type') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('type') }}, cast(brand as {{ dbt_utils.type_string() }}) as brand, cast(cover as {{ dbt_utils.type_string() }}) as cover, - cast(price as {{ dbt_utils.type_string() }}) as price, + cast(price as {{ type_json() }}) as price, {{ cast_to_boolean('active') }} as active, cast(author as {{ dbt_utils.type_string() }}) as author, + {{ cast_to_boolean('manual') }} as manual, cast({{ adapter.quote('source') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('source') }}, {{ cast_to_boolean('display') }} as display, cast(picture as {{ dbt_utils.type_string() }}) as picture, @@ -26,18 +27,18 @@ select cast(unitcode as {{ dbt_utils.type_string() }}) as unitcode, cast(createdat as {{ dbt_utils.type_string() }}) as createdat, cast(restockat as {{ dbt_utils.type_string() }}) as restockat, - 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(couponinfo as {{ dbt_utils.type_string() }}) as couponinfo, properties, {{ cast_to_boolean('canpreorder') }} as canpreorder, cast(suppliersku as {{ dbt_utils.type_string() }}) as suppliersku, {{ cast_to_boolean('isoutofstock') }} as isoutofstock, - cast(pricepercent as {{ dbt_utils.type_string() }}) as pricepercent, + cast(pricepercent as {{ type_json() }}) as pricepercent, cast(searchstring as {{ dbt_utils.type_string() }}) as searchstring, + cast(updatereason as {{ dbt_utils.type_string() }}) as updatereason, + cast(updateactiveid as {{ dbt_utils.type_string() }}) as updateactiveid, {{ cast_to_boolean('displayinventory') }} as displayinventory, {{ cast_to_boolean('showremainingquantity') }} as showremainingquantity, - cast(quantity as {{ dbt_utils.type_string() }}) as quantity, cast(quantity_aibyte_transform as {{ dbt_utils.type_string() }}) as quantity_aibyte_transform, _airbyte_ab_id, _airbyte_emitted_at, diff --git a/models/generated/airbyte_ctes/unibag/product_sku_ab3.sql b/models/generated/airbyte_ctes/unibag/product_sku_ab3.sql index 9323cba..9edcc72 100644 --- a/models/generated/airbyte_ctes/unibag/product_sku_ab3.sql +++ b/models/generated/airbyte_ctes/unibag/product_sku_ab3.sql @@ -10,14 +10,15 @@ select {{ dbt_utils.surrogate_key([ '_id', 'sku', - 'info', + object_to_string('info'), adapter.quote('name'), adapter.quote('type'), 'brand', 'cover', - 'price', + object_to_string('price'), boolean_to_string('active'), 'author', + boolean_to_string('manual'), adapter.quote('source'), boolean_to_string('display'), 'picture', @@ -27,16 +28,16 @@ select 'unitcode', 'createdat', 'restockat', - 'statistic', + object_to_string('statistic'), 'updatedat', - 'couponinfo', array_to_string('properties'), boolean_to_string('canpreorder'), 'suppliersku', boolean_to_string('isoutofstock'), - 'pricepercent', + object_to_string('pricepercent'), 'searchstring', - 'quantity', + 'updatereason', + 'updateactiveid', boolean_to_string('displayinventory'), boolean_to_string('showremainingquantity'), 'quantity_aibyte_transform', diff --git a/models/generated/airbyte_ctes/unibag/product_sku_info_ab1.sql b/models/generated/airbyte_ctes/unibag/product_sku_info_ab1.sql new file mode 100644 index 0000000..f9224d4 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_sku_info_ab1.sql @@ -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('product_sku') }} +select + _airbyte_product_sku_hashid, + {{ json_extract_scalar('info', ['weight'], ['weight']) }} as weight, + {{ json_extract('table_alias', 'info', ['category'], ['category']) }} as category, + {{ json_extract('table_alias', 'info', ['supplier'], ['supplier']) }} as supplier, + {{ json_extract_scalar('info', ['dimension'], ['dimension']) }} as dimension, + {{ json_extract('table_alias', 'info', ['inventory'], ['inventory']) }} as inventory, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('product_sku') }} as table_alias +-- info at product-sku/info +where 1 = 1 +and info is not null + diff --git a/models/generated/airbyte_ctes/unibag/product_sku_info_ab2.sql b/models/generated/airbyte_ctes/unibag/product_sku_info_ab2.sql new file mode 100644 index 0000000..297347b --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_sku_info_ab2.sql @@ -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('product_sku_info_ab1') }} +select + _airbyte_product_sku_hashid, + cast(weight as {{ dbt_utils.type_float() }}) as weight, + cast(category as {{ type_json() }}) as category, + cast(supplier as {{ type_json() }}) as supplier, + cast(dimension as {{ dbt_utils.type_string() }}) as dimension, + cast(inventory as {{ type_json() }}) as inventory, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('product_sku_info_ab1') }} +-- info at product-sku/info +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/product_sku_info_ab3.sql b/models/generated/airbyte_ctes/unibag/product_sku_info_ab3.sql new file mode 100644 index 0000000..e2a30e1 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_sku_info_ab3.sql @@ -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('product_sku_info_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_product_sku_hashid', + 'weight', + object_to_string('category'), + object_to_string('supplier'), + 'dimension', + object_to_string('inventory'), + ]) }} as _airbyte_info_hashid, + tmp.* +from {{ ref('product_sku_info_ab2') }} tmp +-- info at product-sku/info +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/product_sku_info_category_ab1.sql b/models/generated/airbyte_ctes/unibag/product_sku_info_category_ab1.sql new file mode 100644 index 0000000..670aea2 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_sku_info_category_ab1.sql @@ -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('product_sku_info') }} +select + _airbyte_info_hashid, + {{ json_extract_scalar('category', ['id'], ['id']) }} as {{ adapter.quote('id') }}, + {{ json_extract_scalar('category', ['_id'], ['_id']) }} as _id, + {{ json_extract_scalar('category', ['name'], ['name']) }} as {{ adapter.quote('name') }}, + {{ json_extract_scalar('category', ['searchString'], ['searchString']) }} as searchstring, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('product_sku_info') }} as table_alias +-- category at product-sku/info/category +where 1 = 1 +and category is not null + diff --git a/models/generated/airbyte_ctes/unibag/product_sku_info_category_ab2.sql b/models/generated/airbyte_ctes/unibag/product_sku_info_category_ab2.sql new file mode 100644 index 0000000..b8187ac --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_sku_info_category_ab2.sql @@ -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('product_sku_info_category_ab1') }} +select + _airbyte_info_hashid, + cast({{ adapter.quote('id') }} as {{ dbt_utils.type_float() }}) as {{ adapter.quote('id') }}, + 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('product_sku_info_category_ab1') }} +-- category at product-sku/info/category +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/product_sku_info_category_ab3.sql b/models/generated/airbyte_ctes/unibag/product_sku_info_category_ab3.sql new file mode 100644 index 0000000..b1012eb --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_sku_info_category_ab3.sql @@ -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('product_sku_info_category_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_info_hashid', + adapter.quote('id'), + '_id', + adapter.quote('name'), + 'searchstring', + ]) }} as _airbyte_category_hashid, + tmp.* +from {{ ref('product_sku_info_category_ab2') }} tmp +-- category at product-sku/info/category +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/product_sku_info_inv__ory_location_location_ab1.sql b/models/generated/airbyte_ctes/unibag/product_sku_info_inv__ory_location_location_ab1.sql new file mode 100644 index 0000000..e7902d9 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_sku_info_inv__ory_location_location_ab1.sql @@ -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('product_sku_info_inventory_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('product_sku_info_inventory_location') }} as table_alias +-- location at product-sku/info/inventory/location/location +where 1 = 1 +and {{ adapter.quote('location') }} is not null + diff --git a/models/generated/airbyte_ctes/unibag/product_sku_info_inv__ory_location_location_ab2.sql b/models/generated/airbyte_ctes/unibag/product_sku_info_inv__ory_location_location_ab2.sql new file mode 100644 index 0000000..2b41134 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_sku_info_inv__ory_location_location_ab2.sql @@ -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('product_sku_info_inv__ory_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('product_sku_info_inv__ory_location_location_ab1') }} +-- location at product-sku/info/inventory/location/location +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/product_sku_info_inv__ory_location_location_ab3.sql b/models/generated/airbyte_ctes/unibag/product_sku_info_inv__ory_location_location_ab3.sql new file mode 100644 index 0000000..e6608f2 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_sku_info_inv__ory_location_location_ab3.sql @@ -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('product_sku_info_inv__ory_location_location_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_location_hashid', + adapter.quote('type'), + array_to_string('coordinates'), + ]) }} as _airbyte_location_5_hashid, + tmp.* +from {{ ref('product_sku_info_inv__ory_location_location_ab2') }} tmp +-- location at product-sku/info/inventory/location/location +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/product_sku_info_inventory_ab1.sql b/models/generated/airbyte_ctes/unibag/product_sku_info_inventory_ab1.sql new file mode 100644 index 0000000..5bf7389 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_sku_info_inventory_ab1.sql @@ -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('product_sku_info') }} +select + _airbyte_info_hashid, + {{ json_extract_scalar('inventory', ['id'], ['id']) }} as {{ adapter.quote('id') }}, + {{ json_extract_scalar('inventory', ['_id'], ['_id']) }} as _id, + {{ json_extract_scalar('inventory', ['name'], ['name']) }} as {{ adapter.quote('name') }}, + {{ json_extract('table_alias', 'inventory', ['location'], ['location']) }} as {{ adapter.quote('location') }}, + {{ json_extract_scalar('inventory', ['searchString'], ['searchString']) }} as searchstring, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('product_sku_info') }} as table_alias +-- inventory at product-sku/info/inventory +where 1 = 1 +and inventory is not null + diff --git a/models/generated/airbyte_ctes/unibag/product_sku_info_inventory_ab2.sql b/models/generated/airbyte_ctes/unibag/product_sku_info_inventory_ab2.sql new file mode 100644 index 0000000..671aa7d --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_sku_info_inventory_ab2.sql @@ -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('product_sku_info_inventory_ab1') }} +select + _airbyte_info_hashid, + cast({{ adapter.quote('id') }} as {{ dbt_utils.type_float() }}) as {{ adapter.quote('id') }}, + cast(_id as {{ dbt_utils.type_string() }}) as _id, + cast({{ adapter.quote('name') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('name') }}, + cast({{ adapter.quote('location') }} as {{ type_json() }}) as {{ adapter.quote('location') }}, + cast(searchstring as {{ dbt_utils.type_string() }}) as searchstring, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('product_sku_info_inventory_ab1') }} +-- inventory at product-sku/info/inventory +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/product_sku_info_inventory_ab3.sql b/models/generated/airbyte_ctes/unibag/product_sku_info_inventory_ab3.sql new file mode 100644 index 0000000..fe12a68 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_sku_info_inventory_ab3.sql @@ -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('product_sku_info_inventory_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_info_hashid', + adapter.quote('id'), + '_id', + adapter.quote('name'), + object_to_string(adapter.quote('location')), + 'searchstring', + ]) }} as _airbyte_inventory_hashid, + tmp.* +from {{ ref('product_sku_info_inventory_ab2') }} tmp +-- inventory at product-sku/info/inventory +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/product_sku_info_inventory_location_ab1.sql b/models/generated/airbyte_ctes/unibag/product_sku_info_inventory_location_ab1.sql new file mode 100644 index 0000000..72aa508 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_sku_info_inventory_location_ab1.sql @@ -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('product_sku_info_inventory') }} +select + _airbyte_inventory_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('product_sku_info_inventory') }} as table_alias +-- location at product-sku/info/inventory/location +where 1 = 1 +and {{ adapter.quote('location') }} is not null + diff --git a/models/generated/airbyte_ctes/unibag/product_sku_info_inventory_location_ab2.sql b/models/generated/airbyte_ctes/unibag/product_sku_info_inventory_location_ab2.sql new file mode 100644 index 0000000..93b2b61 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_sku_info_inventory_location_ab2.sql @@ -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('product_sku_info_inventory_location_ab1') }} +select + _airbyte_inventory_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('product_sku_info_inventory_location_ab1') }} +-- location at product-sku/info/inventory/location +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/product_sku_info_inventory_location_ab3.sql b/models/generated/airbyte_ctes/unibag/product_sku_info_inventory_location_ab3.sql new file mode 100644 index 0000000..7ffcd58 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_sku_info_inventory_location_ab3.sql @@ -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('product_sku_info_inventory_location_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_inventory_hashid', + 'ward', + 'address', + 'district', + object_to_string(adapter.quote('location')), + 'province', + ]) }} as _airbyte_location_hashid, + tmp.* +from {{ ref('product_sku_info_inventory_location_ab2') }} tmp +-- location at product-sku/info/inventory/location +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/product_sku_info_supplier_ab1.sql b/models/generated/airbyte_ctes/unibag/product_sku_info_supplier_ab1.sql new file mode 100644 index 0000000..a08d2c2 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_sku_info_supplier_ab1.sql @@ -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('product_sku_info') }} +select + _airbyte_info_hashid, + {{ json_extract_scalar('supplier', ['id'], ['id']) }} as {{ adapter.quote('id') }}, + {{ 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('product_sku_info') }} as table_alias +-- supplier at product-sku/info/supplier +where 1 = 1 +and supplier is not null + diff --git a/models/generated/airbyte_ctes/unibag/product_sku_info_supplier_ab2.sql b/models/generated/airbyte_ctes/unibag/product_sku_info_supplier_ab2.sql new file mode 100644 index 0000000..a1d48bd --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_sku_info_supplier_ab2.sql @@ -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('product_sku_info_supplier_ab1') }} +select + _airbyte_info_hashid, + cast({{ adapter.quote('id') }} as {{ dbt_utils.type_float() }}) as {{ adapter.quote('id') }}, + 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('product_sku_info_supplier_ab1') }} +-- supplier at product-sku/info/supplier +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/product_sku_info_supplier_ab3.sql b/models/generated/airbyte_ctes/unibag/product_sku_info_supplier_ab3.sql new file mode 100644 index 0000000..21f47e0 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_sku_info_supplier_ab3.sql @@ -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('product_sku_info_supplier_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_info_hashid', + adapter.quote('id'), + '_id', + adapter.quote('name'), + 'searchstring', + ]) }} as _airbyte_supplier_hashid, + tmp.* +from {{ ref('product_sku_info_supplier_ab2') }} tmp +-- supplier at product-sku/info/supplier +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/product_sku_price_ab1.sql b/models/generated/airbyte_ctes/unibag/product_sku_price_ab1.sql new file mode 100644 index 0000000..d0a140b --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_sku_price_ab1.sql @@ -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('product_sku') }} +select + _airbyte_product_sku_hashid, + {{ json_extract_scalar('price', ['base'], ['base']) }} as base, + {{ json_extract_scalar('price', ['market'], ['market']) }} as market, + {{ json_extract_scalar('price', ['profit'], ['profit']) }} as profit, + {{ json_extract_scalar('price', ['maximum'], ['maximum']) }} as maximum, + {{ json_extract_scalar('price', ['minimum'], ['minimum']) }} as minimum, + {{ json_extract_scalar('price', ['supplier'], ['supplier']) }} as supplier, + {{ json_extract_scalar('price', ['wholesaleBonus'], ['wholesaleBonus']) }} as wholesalebonus, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('product_sku') }} as table_alias +-- price at product-sku/price +where 1 = 1 +and price is not null + diff --git a/models/generated/airbyte_ctes/unibag/product_sku_price_ab2.sql b/models/generated/airbyte_ctes/unibag/product_sku_price_ab2.sql new file mode 100644 index 0000000..109962f --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_sku_price_ab2.sql @@ -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('product_sku_price_ab1') }} +select + _airbyte_product_sku_hashid, + cast(base as {{ dbt_utils.type_float() }}) as base, + cast(market as {{ dbt_utils.type_float() }}) as market, + cast(profit as {{ dbt_utils.type_float() }}) as profit, + cast(maximum as {{ dbt_utils.type_float() }}) as maximum, + cast(minimum as {{ dbt_utils.type_float() }}) as minimum, + cast(supplier as {{ dbt_utils.type_float() }}) as supplier, + cast(wholesalebonus as {{ dbt_utils.type_float() }}) as wholesalebonus, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('product_sku_price_ab1') }} +-- price at product-sku/price +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/product_sku_price_ab3.sql b/models/generated/airbyte_ctes/unibag/product_sku_price_ab3.sql new file mode 100644 index 0000000..d6732a1 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_sku_price_ab3.sql @@ -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('product_sku_price_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_product_sku_hashid', + 'base', + 'market', + 'profit', + 'maximum', + 'minimum', + 'supplier', + 'wholesalebonus', + ]) }} as _airbyte_price_hashid, + tmp.* +from {{ ref('product_sku_price_ab2') }} tmp +-- price at product-sku/price +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/product_sku_pricepercent_ab1.sql b/models/generated/airbyte_ctes/unibag/product_sku_pricepercent_ab1.sql new file mode 100644 index 0000000..290b5b8 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_sku_pricepercent_ab1.sql @@ -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('product_sku') }} +select + _airbyte_product_sku_hashid, + {{ json_extract_scalar('pricepercent', ['supplier'], ['supplier']) }} as supplier, + {{ json_extract_scalar('pricepercent', ['minimumPriceDifferential'], ['minimumPriceDifferential']) }} as minimumpricedifferential, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('product_sku') }} as table_alias +-- pricepercent at product-sku/pricePercent +where 1 = 1 +and pricepercent is not null + diff --git a/models/generated/airbyte_ctes/unibag/product_sku_pricepercent_ab2.sql b/models/generated/airbyte_ctes/unibag/product_sku_pricepercent_ab2.sql new file mode 100644 index 0000000..d26ac2f --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_sku_pricepercent_ab2.sql @@ -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('product_sku_pricepercent_ab1') }} +select + _airbyte_product_sku_hashid, + cast(supplier as {{ dbt_utils.type_float() }}) as supplier, + cast(minimumpricedifferential as {{ dbt_utils.type_float() }}) as minimumpricedifferential, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('product_sku_pricepercent_ab1') }} +-- pricepercent at product-sku/pricePercent +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/product_sku_pricepercent_ab3.sql b/models/generated/airbyte_ctes/unibag/product_sku_pricepercent_ab3.sql new file mode 100644 index 0000000..dd2d8e5 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_sku_pricepercent_ab3.sql @@ -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('product_sku_pricepercent_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_product_sku_hashid', + 'supplier', + 'minimumpricedifferential', + ]) }} as _airbyte_pricepercent_hashid, + tmp.* +from {{ ref('product_sku_pricepercent_ab2') }} tmp +-- pricepercent at product-sku/pricePercent +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/product_sku_statistic_ab1.sql b/models/generated/airbyte_ctes/unibag/product_sku_statistic_ab1.sql new file mode 100644 index 0000000..42ec518 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_sku_statistic_ab1.sql @@ -0,0 +1,25 @@ +{{ 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('product_sku') }} +select + _airbyte_product_sku_hashid, + {{ json_extract_scalar('statistic', ['saleTotal'], ['saleTotal']) }} as saletotal, + {{ json_extract_scalar('statistic', ['salePending'], ['salePending']) }} as salepending, + {{ json_extract_scalar('statistic', ['saleWaiting'], ['saleWaiting']) }} as salewaiting, + {{ json_extract_scalar('statistic', ['saleCashback'], ['saleCashback']) }} as salecashback, + {{ json_extract_scalar('statistic', ['saleCancelled'], ['saleCancelled']) }} as salecancelled, + {{ json_extract_scalar('statistic', ['saleDelivered'], ['saleDelivered']) }} as saledelivered, + {{ json_extract_scalar('statistic', ['saleDelivering'], ['saleDelivering']) }} as saledelivering, + {{ json_extract_scalar('statistic', ['salePaymentProcessing'], ['salePaymentProcessing']) }} as salepaymentprocessing, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('product_sku') }} as table_alias +-- statistic at product-sku/statistic +where 1 = 1 +and statistic is not null + diff --git a/models/generated/airbyte_ctes/unibag/product_sku_statistic_ab2.sql b/models/generated/airbyte_ctes/unibag/product_sku_statistic_ab2.sql new file mode 100644 index 0000000..9abd832 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_sku_statistic_ab2.sql @@ -0,0 +1,24 @@ +{{ 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('product_sku_statistic_ab1') }} +select + _airbyte_product_sku_hashid, + cast(saletotal as {{ dbt_utils.type_float() }}) as saletotal, + cast(salepending as {{ dbt_utils.type_float() }}) as salepending, + cast(salewaiting as {{ dbt_utils.type_float() }}) as salewaiting, + cast(salecashback as {{ dbt_utils.type_float() }}) as salecashback, + cast(salecancelled as {{ dbt_utils.type_float() }}) as salecancelled, + cast(saledelivered as {{ dbt_utils.type_float() }}) as saledelivered, + cast(saledelivering as {{ dbt_utils.type_float() }}) as saledelivering, + cast(salepaymentprocessing as {{ dbt_utils.type_float() }}) as salepaymentprocessing, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('product_sku_statistic_ab1') }} +-- statistic at product-sku/statistic +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/product_sku_statistic_ab3.sql b/models/generated/airbyte_ctes/unibag/product_sku_statistic_ab3.sql new file mode 100644 index 0000000..247383b --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_sku_statistic_ab3.sql @@ -0,0 +1,24 @@ +{{ 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('product_sku_statistic_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_product_sku_hashid', + 'saletotal', + 'salepending', + 'salewaiting', + 'salecashback', + 'salecancelled', + 'saledelivered', + 'saledelivering', + 'salepaymentprocessing', + ]) }} as _airbyte_statistic_hashid, + tmp.* +from {{ ref('product_sku_statistic_ab2') }} tmp +-- statistic at product-sku/statistic +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/product_sku_versions_ab1.sql b/models/generated/airbyte_ctes/unibag/product_sku_versions_ab1.sql index 5cbd21e..38ba6ae 100644 --- a/models/generated/airbyte_ctes/unibag/product_sku_versions_ab1.sql +++ b/models/generated/airbyte_ctes/unibag/product_sku_versions_ab1.sql @@ -9,16 +9,16 @@ select {{ json_extract_scalar('_airbyte_data', ['_id'], ['_id']) }} as _id, {{ json_extract_scalar('_airbyte_data', ['sku'], ['sku']) }} as sku, - {{ 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', ['price'], ['price']) }} as price, + {{ json_extract('table_alias', '_airbyte_data', ['price'], ['price']) }} as price, {{ json_extract_scalar('_airbyte_data', ['source'], ['source']) }} as {{ adapter.quote('source') }}, {{ json_extract_scalar('_airbyte_data', ['codeSku'], ['codeSku']) }} as codesku, {{ json_extract_scalar('_airbyte_data', ['picture'], ['picture']) }} as picture, {{ json_extract_scalar('_airbyte_data', ['product'], ['product']) }} as product, - {{ json_extract_scalar('_airbyte_data', ['statistic'], ['statistic']) }} as statistic, {{ json_extract_scalar('_airbyte_data', ['version'], ['version']) }} as {{ adapter.quote('version') }}, {{ json_extract_scalar('_airbyte_data', ['createdAt'], ['createdAt']) }} as createdat, + {{ json_extract('table_alias', '_airbyte_data', ['statistic'], ['statistic']) }} as statistic, {{ json_extract_scalar('_airbyte_data', ['updatedAt'], ['updatedAt']) }} as updatedat, {{ json_extract_array('_airbyte_data', ['properties'], ['properties']) }} as properties, _airbyte_ab_id, diff --git a/models/generated/airbyte_ctes/unibag/product_sku_versions_ab2.sql b/models/generated/airbyte_ctes/unibag/product_sku_versions_ab2.sql index f30d961..91cb7e2 100644 --- a/models/generated/airbyte_ctes/unibag/product_sku_versions_ab2.sql +++ b/models/generated/airbyte_ctes/unibag/product_sku_versions_ab2.sql @@ -9,16 +9,16 @@ select cast(_id as {{ dbt_utils.type_string() }}) as _id, cast(sku as {{ dbt_utils.type_string() }}) as sku, - 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(price as {{ dbt_utils.type_string() }}) as price, + cast(price as {{ type_json() }}) as price, cast({{ adapter.quote('source') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('source') }}, cast(codesku as {{ dbt_utils.type_string() }}) as codesku, cast(picture as {{ dbt_utils.type_string() }}) as picture, cast(product as {{ dbt_utils.type_string() }}) as product, cast({{ adapter.quote('version') }} as {{ dbt_utils.type_float() }}) as {{ adapter.quote('version') }}, - cast(statistic as {{ dbt_utils.type_string() }}) as statistic, cast(createdat as {{ dbt_utils.type_string() }}) as createdat, + cast(statistic as {{ type_json() }}) as statistic, cast(updatedat as {{ dbt_utils.type_string() }}) as updatedat, properties, _airbyte_ab_id, diff --git a/models/generated/airbyte_ctes/unibag/product_sku_versions_ab3.sql b/models/generated/airbyte_ctes/unibag/product_sku_versions_ab3.sql index 5582374..6e74d4b 100644 --- a/models/generated/airbyte_ctes/unibag/product_sku_versions_ab3.sql +++ b/models/generated/airbyte_ctes/unibag/product_sku_versions_ab3.sql @@ -10,16 +10,16 @@ select {{ dbt_utils.surrogate_key([ '_id', 'sku', - 'info', + object_to_string('info'), adapter.quote('name'), - 'price', + object_to_string('price'), adapter.quote('source'), 'codesku', 'picture', 'product', - 'statistic', adapter.quote('version'), 'createdat', + object_to_string('statistic'), 'updatedat', array_to_string('properties'), ]) }} as _airbyte_product_sku_versions_hashid, diff --git a/models/generated/airbyte_ctes/unibag/product_sku_versions_info_ab1.sql b/models/generated/airbyte_ctes/unibag/product_sku_versions_info_ab1.sql new file mode 100644 index 0000000..537a4ae --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_sku_versions_info_ab1.sql @@ -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('product_sku_versions') }} +select + _airbyte_product_sku_versions_hashid, + {{ json_extract_scalar('info', ['weight'], ['weight']) }} as weight, + {{ json_extract('table_alias', 'info', ['category'], ['category']) }} as category, + {{ json_extract('table_alias', 'info', ['supplier'], ['supplier']) }} as supplier, + {{ json_extract_scalar('info', ['dimension'], ['dimension']) }} as dimension, + {{ json_extract('table_alias', 'info', ['inventory'], ['inventory']) }} as inventory, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('product_sku_versions') }} as table_alias +-- info at product-sku-versions/info +where 1 = 1 +and info is not null + diff --git a/models/generated/airbyte_ctes/unibag/product_sku_versions_info_ab2.sql b/models/generated/airbyte_ctes/unibag/product_sku_versions_info_ab2.sql new file mode 100644 index 0000000..094d452 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_sku_versions_info_ab2.sql @@ -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('product_sku_versions_info_ab1') }} +select + _airbyte_product_sku_versions_hashid, + cast(weight as {{ dbt_utils.type_float() }}) as weight, + cast(category as {{ type_json() }}) as category, + cast(supplier as {{ type_json() }}) as supplier, + cast(dimension as {{ dbt_utils.type_string() }}) as dimension, + cast(inventory as {{ type_json() }}) as inventory, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('product_sku_versions_info_ab1') }} +-- info at product-sku-versions/info +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/product_sku_versions_info_ab3.sql b/models/generated/airbyte_ctes/unibag/product_sku_versions_info_ab3.sql new file mode 100644 index 0000000..a164eed --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_sku_versions_info_ab3.sql @@ -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('product_sku_versions_info_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_product_sku_versions_hashid', + 'weight', + object_to_string('category'), + object_to_string('supplier'), + 'dimension', + object_to_string('inventory'), + ]) }} as _airbyte_info_hashid, + tmp.* +from {{ ref('product_sku_versions_info_ab2') }} tmp +-- info at product-sku-versions/info +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/product_sku_versions_info_category_ab1.sql b/models/generated/airbyte_ctes/unibag/product_sku_versions_info_category_ab1.sql new file mode 100644 index 0000000..bca6380 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_sku_versions_info_category_ab1.sql @@ -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('product_sku_versions_info') }} +select + _airbyte_info_hashid, + {{ json_extract_scalar('category', ['id'], ['id']) }} as {{ adapter.quote('id') }}, + {{ json_extract_scalar('category', ['name'], ['name']) }} as {{ adapter.quote('name') }}, + {{ json_extract_scalar('category', ['searchString'], ['searchString']) }} as searchstring, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('product_sku_versions_info') }} as table_alias +-- category at product-sku-versions/info/category +where 1 = 1 +and category is not null + diff --git a/models/generated/airbyte_ctes/unibag/product_sku_versions_info_category_ab2.sql b/models/generated/airbyte_ctes/unibag/product_sku_versions_info_category_ab2.sql new file mode 100644 index 0000000..64bf306 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_sku_versions_info_category_ab2.sql @@ -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('product_sku_versions_info_category_ab1') }} +select + _airbyte_info_hashid, + cast({{ adapter.quote('id') }} as {{ dbt_utils.type_float() }}) as {{ adapter.quote('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('product_sku_versions_info_category_ab1') }} +-- category at product-sku-versions/info/category +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/product_sku_versions_info_category_ab3.sql b/models/generated/airbyte_ctes/unibag/product_sku_versions_info_category_ab3.sql new file mode 100644 index 0000000..534c109 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_sku_versions_info_category_ab3.sql @@ -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('product_sku_versions_info_category_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_info_hashid', + adapter.quote('id'), + adapter.quote('name'), + 'searchstring', + ]) }} as _airbyte_category_hashid, + tmp.* +from {{ ref('product_sku_versions_info_category_ab2') }} tmp +-- category at product-sku-versions/info/category +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/product_sku_versions_info_inventory_ab1.sql b/models/generated/airbyte_ctes/unibag/product_sku_versions_info_inventory_ab1.sql new file mode 100644 index 0000000..2a4de6b --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_sku_versions_info_inventory_ab1.sql @@ -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('product_sku_versions_info') }} +select + _airbyte_info_hashid, + {{ json_extract_scalar('inventory', ['id'], ['id']) }} as {{ adapter.quote('id') }}, + {{ json_extract_scalar('inventory', ['_id'], ['_id']) }} as _id, + {{ json_extract_scalar('inventory', ['name'], ['name']) }} as {{ adapter.quote('name') }}, + {{ json_extract_scalar('inventory', ['searchString'], ['searchString']) }} as searchstring, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('product_sku_versions_info') }} as table_alias +-- inventory at product-sku-versions/info/inventory +where 1 = 1 +and inventory is not null + diff --git a/models/generated/airbyte_ctes/unibag/product_sku_versions_info_inventory_ab2.sql b/models/generated/airbyte_ctes/unibag/product_sku_versions_info_inventory_ab2.sql new file mode 100644 index 0000000..71b0dac --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_sku_versions_info_inventory_ab2.sql @@ -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('product_sku_versions_info_inventory_ab1') }} +select + _airbyte_info_hashid, + cast({{ adapter.quote('id') }} as {{ dbt_utils.type_float() }}) as {{ adapter.quote('id') }}, + 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('product_sku_versions_info_inventory_ab1') }} +-- inventory at product-sku-versions/info/inventory +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/product_sku_versions_info_inventory_ab3.sql b/models/generated/airbyte_ctes/unibag/product_sku_versions_info_inventory_ab3.sql new file mode 100644 index 0000000..672f9d8 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_sku_versions_info_inventory_ab3.sql @@ -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('product_sku_versions_info_inventory_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_info_hashid', + adapter.quote('id'), + '_id', + adapter.quote('name'), + 'searchstring', + ]) }} as _airbyte_inventory_hashid, + tmp.* +from {{ ref('product_sku_versions_info_inventory_ab2') }} tmp +-- inventory at product-sku-versions/info/inventory +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/product_sku_versions_info_supplier_ab1.sql b/models/generated/airbyte_ctes/unibag/product_sku_versions_info_supplier_ab1.sql new file mode 100644 index 0000000..6d32f5f --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_sku_versions_info_supplier_ab1.sql @@ -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('product_sku_versions_info') }} +select + _airbyte_info_hashid, + {{ json_extract_scalar('supplier', ['id'], ['id']) }} as {{ adapter.quote('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('product_sku_versions_info') }} as table_alias +-- supplier at product-sku-versions/info/supplier +where 1 = 1 +and supplier is not null + diff --git a/models/generated/airbyte_ctes/unibag/product_sku_versions_info_supplier_ab2.sql b/models/generated/airbyte_ctes/unibag/product_sku_versions_info_supplier_ab2.sql new file mode 100644 index 0000000..2100316 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_sku_versions_info_supplier_ab2.sql @@ -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('product_sku_versions_info_supplier_ab1') }} +select + _airbyte_info_hashid, + cast({{ adapter.quote('id') }} as {{ dbt_utils.type_float() }}) as {{ adapter.quote('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('product_sku_versions_info_supplier_ab1') }} +-- supplier at product-sku-versions/info/supplier +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/product_sku_versions_info_supplier_ab3.sql b/models/generated/airbyte_ctes/unibag/product_sku_versions_info_supplier_ab3.sql new file mode 100644 index 0000000..196663f --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_sku_versions_info_supplier_ab3.sql @@ -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('product_sku_versions_info_supplier_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_info_hashid', + adapter.quote('id'), + adapter.quote('name'), + 'searchstring', + ]) }} as _airbyte_supplier_hashid, + tmp.* +from {{ ref('product_sku_versions_info_supplier_ab2') }} tmp +-- supplier at product-sku-versions/info/supplier +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/product_sku_versions_price_ab1.sql b/models/generated/airbyte_ctes/unibag/product_sku_versions_price_ab1.sql new file mode 100644 index 0000000..ad15173 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_sku_versions_price_ab1.sql @@ -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('product_sku_versions') }} +select + _airbyte_product_sku_versions_hashid, + {{ json_extract_scalar('price', ['base'], ['base']) }} as base, + {{ json_extract_scalar('price', ['market'], ['market']) }} as market, + {{ json_extract_scalar('price', ['maximum'], ['maximum']) }} as maximum, + {{ json_extract_scalar('price', ['minimum'], ['minimum']) }} as minimum, + {{ json_extract_scalar('price', ['supplier'], ['supplier']) }} as supplier, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('product_sku_versions') }} as table_alias +-- price at product-sku-versions/price +where 1 = 1 +and price is not null + diff --git a/models/generated/airbyte_ctes/unibag/product_sku_versions_price_ab2.sql b/models/generated/airbyte_ctes/unibag/product_sku_versions_price_ab2.sql new file mode 100644 index 0000000..e9429cb --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_sku_versions_price_ab2.sql @@ -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('product_sku_versions_price_ab1') }} +select + _airbyte_product_sku_versions_hashid, + cast(base as {{ dbt_utils.type_float() }}) as base, + cast(market as {{ dbt_utils.type_float() }}) as market, + cast(maximum as {{ dbt_utils.type_float() }}) as maximum, + cast(minimum as {{ dbt_utils.type_float() }}) as minimum, + cast(supplier as {{ dbt_utils.type_float() }}) as supplier, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('product_sku_versions_price_ab1') }} +-- price at product-sku-versions/price +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/product_sku_versions_price_ab3.sql b/models/generated/airbyte_ctes/unibag/product_sku_versions_price_ab3.sql new file mode 100644 index 0000000..bae849d --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_sku_versions_price_ab3.sql @@ -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('product_sku_versions_price_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_product_sku_versions_hashid', + 'base', + 'market', + 'maximum', + 'minimum', + 'supplier', + ]) }} as _airbyte_price_hashid, + tmp.* +from {{ ref('product_sku_versions_price_ab2') }} tmp +-- price at product-sku-versions/price +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/product_sku_versions_statistic_ab1.sql b/models/generated/airbyte_ctes/unibag/product_sku_versions_statistic_ab1.sql new file mode 100644 index 0000000..83d2921 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_sku_versions_statistic_ab1.sql @@ -0,0 +1,25 @@ +{{ 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('product_sku_versions') }} +select + _airbyte_product_sku_versions_hashid, + {{ json_extract_scalar('statistic', ['saleTotal'], ['saleTotal']) }} as saletotal, + {{ json_extract_scalar('statistic', ['salePending'], ['salePending']) }} as salepending, + {{ json_extract_scalar('statistic', ['saleWaiting'], ['saleWaiting']) }} as salewaiting, + {{ json_extract_scalar('statistic', ['saleCashback'], ['saleCashback']) }} as salecashback, + {{ json_extract_scalar('statistic', ['saleCancelled'], ['saleCancelled']) }} as salecancelled, + {{ json_extract_scalar('statistic', ['saleDelivered'], ['saleDelivered']) }} as saledelivered, + {{ json_extract_scalar('statistic', ['saleDelivering'], ['saleDelivering']) }} as saledelivering, + {{ json_extract_scalar('statistic', ['salePaymentProcessing'], ['salePaymentProcessing']) }} as salepaymentprocessing, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('product_sku_versions') }} as table_alias +-- statistic at product-sku-versions/statistic +where 1 = 1 +and statistic is not null + diff --git a/models/generated/airbyte_ctes/unibag/product_sku_versions_statistic_ab2.sql b/models/generated/airbyte_ctes/unibag/product_sku_versions_statistic_ab2.sql new file mode 100644 index 0000000..ec2413f --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_sku_versions_statistic_ab2.sql @@ -0,0 +1,24 @@ +{{ 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('product_sku_versions_statistic_ab1') }} +select + _airbyte_product_sku_versions_hashid, + cast(saletotal as {{ dbt_utils.type_float() }}) as saletotal, + cast(salepending as {{ dbt_utils.type_float() }}) as salepending, + cast(salewaiting as {{ dbt_utils.type_float() }}) as salewaiting, + cast(salecashback as {{ dbt_utils.type_float() }}) as salecashback, + cast(salecancelled as {{ dbt_utils.type_float() }}) as salecancelled, + cast(saledelivered as {{ dbt_utils.type_float() }}) as saledelivered, + cast(saledelivering as {{ dbt_utils.type_float() }}) as saledelivering, + cast(salepaymentprocessing as {{ dbt_utils.type_float() }}) as salepaymentprocessing, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('product_sku_versions_statistic_ab1') }} +-- statistic at product-sku-versions/statistic +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/product_sku_versions_statistic_ab3.sql b/models/generated/airbyte_ctes/unibag/product_sku_versions_statistic_ab3.sql new file mode 100644 index 0000000..a1f8294 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/product_sku_versions_statistic_ab3.sql @@ -0,0 +1,24 @@ +{{ 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('product_sku_versions_statistic_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_product_sku_versions_hashid', + 'saletotal', + 'salepending', + 'salewaiting', + 'salecashback', + 'salecancelled', + 'saledelivered', + 'saledelivering', + 'salepaymentprocessing', + ]) }} as _airbyte_statistic_hashid, + tmp.* +from {{ ref('product_sku_versions_statistic_ab2') }} tmp +-- statistic at product-sku-versions/statistic +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/products_ab1.sql b/models/generated/airbyte_ctes/unibag/products_ab1.sql index c09bfa8..eaeab04 100644 --- a/models/generated/airbyte_ctes/unibag/products_ab1.sql +++ b/models/generated/airbyte_ctes/unibag/products_ab1.sql @@ -9,13 +9,13 @@ select {{ json_extract_scalar('_airbyte_data', ['_id'], ['_id']) }} as _id, {{ json_extract_scalar('_airbyte_data', ['desc'], ['desc']) }} as {{ adapter.quote('desc') }}, - {{ json_extract_scalar('_airbyte_data', ['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', ['temp'], ['temp']) }} as {{ adapter.quote('temp') }}, {{ json_extract_scalar('_airbyte_data', ['brand'], ['brand']) }} as brand, - {{ json_extract_scalar('_airbyte_data', ['order'], ['order']) }} as {{ adapter.quote('order') }}, - {{ json_extract_scalar('_airbyte_data', ['price'], ['price']) }} as price, - {{ json_extract_scalar('_airbyte_data', ['score'], ['score']) }} as score, + {{ json_extract('table_alias', '_airbyte_data', ['order'], ['order']) }} as {{ adapter.quote('order') }}, + {{ json_extract('table_alias', '_airbyte_data', ['price'], ['price']) }} as price, + {{ json_extract('table_alias', '_airbyte_data', ['score'], ['score']) }} as score, {{ json_extract_scalar('_airbyte_data', ['active'], ['active']) }} as active, {{ json_extract_scalar('_airbyte_data', ['author'], ['author']) }} as author, {{ json_extract_array('_airbyte_data', ['guides'], ['guides']) }} as guides, @@ -25,23 +25,25 @@ select {{ json_extract_scalar('_airbyte_data', ['createdAt'], ['createdAt']) }} as createdat, {{ json_extract_array('_airbyte_data', ['documents'], ['documents']) }} as documents, {{ json_extract_scalar('_airbyte_data', ['shareDesc'], ['shareDesc']) }} as sharedesc, - {{ 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_array('_airbyte_data', ['categories'], ['categories']) }} as categories, + {{ json_extract_scalar('_airbyte_data', ['inactiveAt'], ['inactiveAt']) }} as inactiveat, {{ json_extract_array('_airbyte_data', ['properties'], ['properties']) }} as properties, {{ json_extract_scalar('_airbyte_data', ['reActiveAt'], ['reActiveAt']) }} as reactiveat, {{ json_extract_array('_airbyte_data', ['inventories'], ['inventories']) }} as inventories, + {{ json_extract_scalar('_airbyte_data', ['displaySKUId'], ['displaySKUId']) }} as displayskuid, {{ json_extract_scalar('_airbyte_data', ['isOutOfStock'], ['isOutOfStock']) }} as isoutofstock, - {{ json_extract_scalar('_airbyte_data', ['pricePercent'], ['pricePercent']) }} as pricepercent, + {{ json_extract('table_alias', '_airbyte_data', ['pricePercent'], ['pricePercent']) }} as pricepercent, {{ json_extract_scalar('_airbyte_data', ['searchString'], ['searchString']) }} as searchstring, {{ json_extract_array('_airbyte_data', ['subCategories'], ['subCategories']) }} as subcategories, {{ json_extract_scalar('_airbyte_data', ['inactiveReason'], ['inactiveReason']) }} as inactivereason, {{ json_extract_scalar('_airbyte_data', ['propertiesMain'], ['propertiesMain']) }} as propertiesmain, - {{ json_extract_scalar('_airbyte_data', ['shareStatistic'], ['shareStatistic']) }} as sharestatistic, + {{ json_extract('table_alias', '_airbyte_data', ['shareStatistic'], ['shareStatistic']) }} as sharestatistic, + {{ json_extract_scalar('_airbyte_data', ['updateActiveId'], ['updateActiveId']) }} as updateactiveid, {{ json_extract_scalar('_airbyte_data', ['canIssueInvoice'], ['canIssueInvoice']) }} as canissueinvoice, {{ json_extract_scalar('_airbyte_data', ['pendingInactive'], ['pendingInactive']) }} as pendinginactive, - {{ json_extract_scalar('_airbyte_data', ['reviewStatistic'], ['reviewStatistic']) }} as reviewstatistic, - {{ json_extract_scalar('_airbyte_data', ['pendingInactiveAt'], ['pendingInactiveAt']) }} as pendinginactiveat, + {{ json_extract('table_alias', '_airbyte_data', ['reviewStatistic'], ['reviewStatistic']) }} as reviewstatistic, {{ json_extract_array('_airbyte_data', ['highlightProperties'], ['highlightProperties']) }} as highlightproperties, _airbyte_ab_id, _airbyte_emitted_at, diff --git a/models/generated/airbyte_ctes/unibag/products_ab2.sql b/models/generated/airbyte_ctes/unibag/products_ab2.sql index f0402a6..512d49b 100644 --- a/models/generated/airbyte_ctes/unibag/products_ab2.sql +++ b/models/generated/airbyte_ctes/unibag/products_ab2.sql @@ -9,13 +9,13 @@ select cast(_id as {{ dbt_utils.type_string() }}) as _id, cast({{ adapter.quote('desc') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('desc') }}, - 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('temp') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('temp') }}, cast(brand as {{ dbt_utils.type_string() }}) as brand, - cast({{ adapter.quote('order') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('order') }}, - cast(price as {{ dbt_utils.type_string() }}) as price, - cast(score as {{ dbt_utils.type_string() }}) as score, + cast({{ adapter.quote('order') }} as {{ type_json() }}) as {{ adapter.quote('order') }}, + cast(price as {{ type_json() }}) as price, + cast(score as {{ type_json() }}) as score, {{ cast_to_boolean('active') }} as active, cast(author as {{ dbt_utils.type_string() }}) as author, guides, @@ -25,23 +25,25 @@ select cast(createdat as {{ dbt_utils.type_string() }}) as createdat, documents, cast(sharedesc as {{ dbt_utils.type_string() }}) as sharedesc, - 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, categories, + cast(inactiveat as {{ dbt_utils.type_string() }}) as inactiveat, properties, cast(reactiveat as {{ dbt_utils.type_string() }}) as reactiveat, inventories, + cast(displayskuid as {{ dbt_utils.type_string() }}) as displayskuid, {{ cast_to_boolean('isoutofstock') }} as isoutofstock, - cast(pricepercent as {{ dbt_utils.type_string() }}) as pricepercent, + cast(pricepercent as {{ type_json() }}) as pricepercent, cast(searchstring as {{ dbt_utils.type_string() }}) as searchstring, subcategories, cast(inactivereason as {{ dbt_utils.type_string() }}) as inactivereason, cast(propertiesmain as {{ dbt_utils.type_string() }}) as propertiesmain, - cast(sharestatistic as {{ dbt_utils.type_string() }}) as sharestatistic, + cast(sharestatistic as {{ type_json() }}) as sharestatistic, + cast(updateactiveid as {{ dbt_utils.type_string() }}) as updateactiveid, {{ cast_to_boolean('canissueinvoice') }} as canissueinvoice, {{ cast_to_boolean('pendinginactive') }} as pendinginactive, - cast(reviewstatistic as {{ dbt_utils.type_string() }}) as reviewstatistic, - cast(pendinginactiveat as {{ dbt_utils.type_string() }}) as pendinginactiveat, + cast(reviewstatistic as {{ type_json() }}) as reviewstatistic, highlightproperties, _airbyte_ab_id, _airbyte_emitted_at, diff --git a/models/generated/airbyte_ctes/unibag/products_ab3.sql b/models/generated/airbyte_ctes/unibag/products_ab3.sql index 1f52628..73fe929 100644 --- a/models/generated/airbyte_ctes/unibag/products_ab3.sql +++ b/models/generated/airbyte_ctes/unibag/products_ab3.sql @@ -10,13 +10,13 @@ select {{ dbt_utils.surrogate_key([ '_id', adapter.quote('desc'), - 'info', + object_to_string('info'), adapter.quote('name'), adapter.quote('temp'), 'brand', - adapter.quote('order'), - 'price', - 'score', + object_to_string(adapter.quote('order')), + object_to_string('price'), + object_to_string('score'), boolean_to_string('active'), 'author', array_to_string('guides'), @@ -26,23 +26,25 @@ select 'createdat', array_to_string('documents'), 'sharedesc', - 'statistic', + object_to_string('statistic'), 'updatedat', array_to_string('categories'), + 'inactiveat', array_to_string('properties'), 'reactiveat', array_to_string('inventories'), + 'displayskuid', boolean_to_string('isoutofstock'), - 'pricepercent', + object_to_string('pricepercent'), 'searchstring', array_to_string('subcategories'), 'inactivereason', 'propertiesmain', - 'sharestatistic', + object_to_string('sharestatistic'), + 'updateactiveid', boolean_to_string('canissueinvoice'), boolean_to_string('pendinginactive'), - 'reviewstatistic', - 'pendinginactiveat', + object_to_string('reviewstatistic'), array_to_string('highlightproperties'), ]) }} as _airbyte_products_hashid, tmp.* diff --git a/models/generated/airbyte_ctes/unibag/products_info_ab1.sql b/models/generated/airbyte_ctes/unibag/products_info_ab1.sql new file mode 100644 index 0000000..1212403 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/products_info_ab1.sql @@ -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('products') }} +select + _airbyte_products_hashid, + {{ json_extract_scalar('info', ['profit'], ['profit']) }} as profit, + {{ json_extract('table_alias', 'info', ['category'], ['category']) }} as category, + {{ json_extract('table_alias', 'info', ['supplier'], ['supplier']) }} as supplier, + {{ json_extract('table_alias', 'info', ['inventory'], ['inventory']) }} as inventory, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('products') }} as table_alias +-- info at products/info +where 1 = 1 +and info is not null + diff --git a/models/generated/airbyte_ctes/unibag/products_info_ab2.sql b/models/generated/airbyte_ctes/unibag/products_info_ab2.sql new file mode 100644 index 0000000..8293cb9 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/products_info_ab2.sql @@ -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('products_info_ab1') }} +select + _airbyte_products_hashid, + cast(profit as {{ dbt_utils.type_float() }}) as profit, + cast(category as {{ type_json() }}) as category, + cast(supplier as {{ type_json() }}) as supplier, + cast(inventory as {{ type_json() }}) as inventory, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('products_info_ab1') }} +-- info at products/info +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/products_info_ab3.sql b/models/generated/airbyte_ctes/unibag/products_info_ab3.sql new file mode 100644 index 0000000..117899f --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/products_info_ab3.sql @@ -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('products_info_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_products_hashid', + 'profit', + object_to_string('category'), + object_to_string('supplier'), + object_to_string('inventory'), + ]) }} as _airbyte_info_hashid, + tmp.* +from {{ ref('products_info_ab2') }} tmp +-- info at products/info +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/products_info_category_ab1.sql b/models/generated/airbyte_ctes/unibag/products_info_category_ab1.sql new file mode 100644 index 0000000..88c5a63 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/products_info_category_ab1.sql @@ -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('products_info') }} +select + _airbyte_info_hashid, + {{ json_extract_scalar('category', ['id'], ['id']) }} as {{ adapter.quote('id') }}, + {{ json_extract_scalar('category', ['_id'], ['_id']) }} as _id, + {{ json_extract_scalar('category', ['name'], ['name']) }} as {{ adapter.quote('name') }}, + {{ json_extract_scalar('category', ['searchString'], ['searchString']) }} as searchstring, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('products_info') }} as table_alias +-- category at products/info/category +where 1 = 1 +and category is not null + diff --git a/models/generated/airbyte_ctes/unibag/products_info_category_ab2.sql b/models/generated/airbyte_ctes/unibag/products_info_category_ab2.sql new file mode 100644 index 0000000..fdaaeff --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/products_info_category_ab2.sql @@ -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('products_info_category_ab1') }} +select + _airbyte_info_hashid, + cast({{ adapter.quote('id') }} as {{ dbt_utils.type_float() }}) as {{ adapter.quote('id') }}, + 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('products_info_category_ab1') }} +-- category at products/info/category +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/products_info_category_ab3.sql b/models/generated/airbyte_ctes/unibag/products_info_category_ab3.sql new file mode 100644 index 0000000..c8e6816 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/products_info_category_ab3.sql @@ -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('products_info_category_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_info_hashid', + adapter.quote('id'), + '_id', + adapter.quote('name'), + 'searchstring', + ]) }} as _airbyte_category_hashid, + tmp.* +from {{ ref('products_info_category_ab2') }} tmp +-- category at products/info/category +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/products_info_inventory_ab1.sql b/models/generated/airbyte_ctes/unibag/products_info_inventory_ab1.sql new file mode 100644 index 0000000..a396e34 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/products_info_inventory_ab1.sql @@ -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('products_info') }} +select + _airbyte_info_hashid, + {{ json_extract_scalar('inventory', ['id'], ['id']) }} as {{ adapter.quote('id') }}, + {{ json_extract_scalar('inventory', ['_id'], ['_id']) }} as _id, + {{ json_extract_scalar('inventory', ['name'], ['name']) }} as {{ adapter.quote('name') }}, + {{ json_extract('table_alias', 'inventory', ['location'], ['location']) }} as {{ adapter.quote('location') }}, + {{ json_extract_scalar('inventory', ['searchString'], ['searchString']) }} as searchstring, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('products_info') }} as table_alias +-- inventory at products/info/inventory +where 1 = 1 +and inventory is not null + diff --git a/models/generated/airbyte_ctes/unibag/products_info_inventory_ab2.sql b/models/generated/airbyte_ctes/unibag/products_info_inventory_ab2.sql new file mode 100644 index 0000000..195e377 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/products_info_inventory_ab2.sql @@ -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('products_info_inventory_ab1') }} +select + _airbyte_info_hashid, + cast({{ adapter.quote('id') }} as {{ dbt_utils.type_float() }}) as {{ adapter.quote('id') }}, + cast(_id as {{ dbt_utils.type_string() }}) as _id, + cast({{ adapter.quote('name') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('name') }}, + cast({{ adapter.quote('location') }} as {{ type_json() }}) as {{ adapter.quote('location') }}, + cast(searchstring as {{ dbt_utils.type_string() }}) as searchstring, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('products_info_inventory_ab1') }} +-- inventory at products/info/inventory +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/products_info_inventory_ab3.sql b/models/generated/airbyte_ctes/unibag/products_info_inventory_ab3.sql new file mode 100644 index 0000000..a59442d --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/products_info_inventory_ab3.sql @@ -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('products_info_inventory_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_info_hashid', + adapter.quote('id'), + '_id', + adapter.quote('name'), + object_to_string(adapter.quote('location')), + 'searchstring', + ]) }} as _airbyte_inventory_hashid, + tmp.* +from {{ ref('products_info_inventory_ab2') }} tmp +-- inventory at products/info/inventory +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/products_info_inventory_location_ab1.sql b/models/generated/airbyte_ctes/unibag/products_info_inventory_location_ab1.sql new file mode 100644 index 0000000..aa362c5 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/products_info_inventory_location_ab1.sql @@ -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('products_info_inventory') }} +select + _airbyte_inventory_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, + {{ json_extract_scalar(adapter.quote('location'), ['provinceName'], ['provinceName']) }} as provincename, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('products_info_inventory') }} as table_alias +-- location at products/info/inventory/location +where 1 = 1 +and {{ adapter.quote('location') }} is not null + diff --git a/models/generated/airbyte_ctes/unibag/products_info_inventory_location_ab2.sql b/models/generated/airbyte_ctes/unibag/products_info_inventory_location_ab2.sql new file mode 100644 index 0000000..38bfde7 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/products_info_inventory_location_ab2.sql @@ -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('products_info_inventory_location_ab1') }} +select + _airbyte_inventory_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, + cast(provincename as {{ dbt_utils.type_string() }}) as provincename, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('products_info_inventory_location_ab1') }} +-- location at products/info/inventory/location +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/products_info_inventory_location_ab3.sql b/models/generated/airbyte_ctes/unibag/products_info_inventory_location_ab3.sql new file mode 100644 index 0000000..75502f4 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/products_info_inventory_location_ab3.sql @@ -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('products_info_inventory_location_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_inventory_hashid', + 'ward', + 'address', + 'district', + object_to_string(adapter.quote('location')), + 'province', + 'provincename', + ]) }} as _airbyte_location_hashid, + tmp.* +from {{ ref('products_info_inventory_location_ab2') }} tmp +-- location at products/info/inventory/location +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/products_info_inventory_location_location_ab1.sql b/models/generated/airbyte_ctes/unibag/products_info_inventory_location_location_ab1.sql new file mode 100644 index 0000000..ec3978d --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/products_info_inventory_location_location_ab1.sql @@ -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('products_info_inventory_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('products_info_inventory_location') }} as table_alias +-- location at products/info/inventory/location/location +where 1 = 1 +and {{ adapter.quote('location') }} is not null + diff --git a/models/generated/airbyte_ctes/unibag/products_info_inventory_location_location_ab2.sql b/models/generated/airbyte_ctes/unibag/products_info_inventory_location_location_ab2.sql new file mode 100644 index 0000000..a4e0761 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/products_info_inventory_location_location_ab2.sql @@ -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('products_info_inventory_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('products_info_inventory_location_location_ab1') }} +-- location at products/info/inventory/location/location +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/products_info_inventory_location_location_ab3.sql b/models/generated/airbyte_ctes/unibag/products_info_inventory_location_location_ab3.sql new file mode 100644 index 0000000..3012273 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/products_info_inventory_location_location_ab3.sql @@ -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('products_info_inventory_location_location_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_location_hashid', + adapter.quote('type'), + array_to_string('coordinates'), + ]) }} as _airbyte_location_5_hashid, + tmp.* +from {{ ref('products_info_inventory_location_location_ab2') }} tmp +-- location at products/info/inventory/location/location +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/products_info_supplier_ab1.sql b/models/generated/airbyte_ctes/unibag/products_info_supplier_ab1.sql new file mode 100644 index 0000000..3979248 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/products_info_supplier_ab1.sql @@ -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('products_info') }} +select + _airbyte_info_hashid, + {{ json_extract_scalar('supplier', ['id'], ['id']) }} as {{ adapter.quote('id') }}, + {{ 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('products_info') }} as table_alias +-- supplier at products/info/supplier +where 1 = 1 +and supplier is not null + diff --git a/models/generated/airbyte_ctes/unibag/products_info_supplier_ab2.sql b/models/generated/airbyte_ctes/unibag/products_info_supplier_ab2.sql new file mode 100644 index 0000000..47e2d4d --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/products_info_supplier_ab2.sql @@ -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('products_info_supplier_ab1') }} +select + _airbyte_info_hashid, + cast({{ adapter.quote('id') }} as {{ dbt_utils.type_float() }}) as {{ adapter.quote('id') }}, + 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('products_info_supplier_ab1') }} +-- supplier at products/info/supplier +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/products_info_supplier_ab3.sql b/models/generated/airbyte_ctes/unibag/products_info_supplier_ab3.sql new file mode 100644 index 0000000..f25d173 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/products_info_supplier_ab3.sql @@ -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('products_info_supplier_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_info_hashid', + adapter.quote('id'), + '_id', + adapter.quote('name'), + 'searchstring', + ]) }} as _airbyte_supplier_hashid, + tmp.* +from {{ ref('products_info_supplier_ab2') }} tmp +-- supplier at products/info/supplier +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/products_order_ab1.sql b/models/generated/airbyte_ctes/unibag/products_order_ab1.sql new file mode 100644 index 0000000..ed35823 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/products_order_ab1.sql @@ -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('products') }} +select + _airbyte_products_hashid, + {{ json_extract_scalar(adapter.quote('order'), ['newest'], ['newest']) }} as newest, + {{ json_extract_scalar(adapter.quote('order'), ['profit'], ['profit']) }} as profit, + {{ json_extract_scalar(adapter.quote('order'), ['topSale'], ['topSale']) }} as topsale, + {{ json_extract_scalar(adapter.quote('order'), ['scoreYesterday'], ['scoreYesterday']) }} as scoreyesterday, + {{ json_extract_scalar(adapter.quote('order'), ['region_aibyte_transform'], ['region_aibyte_transform']) }} as region_aibyte_transform, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('products') }} as table_alias +-- order at products/order +where 1 = 1 +and {{ adapter.quote('order') }} is not null + diff --git a/models/generated/airbyte_ctes/unibag/products_order_ab2.sql b/models/generated/airbyte_ctes/unibag/products_order_ab2.sql new file mode 100644 index 0000000..35d481d --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/products_order_ab2.sql @@ -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('products_order_ab1') }} +select + _airbyte_products_hashid, + cast(newest as {{ dbt_utils.type_float() }}) as newest, + cast(profit as {{ dbt_utils.type_float() }}) as profit, + cast(topsale as {{ dbt_utils.type_float() }}) as topsale, + cast(scoreyesterday as {{ dbt_utils.type_float() }}) as scoreyesterday, + cast(region_aibyte_transform as {{ dbt_utils.type_string() }}) as region_aibyte_transform, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('products_order_ab1') }} +-- order at products/order +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/products_order_ab3.sql b/models/generated/airbyte_ctes/unibag/products_order_ab3.sql new file mode 100644 index 0000000..123d245 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/products_order_ab3.sql @@ -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('products_order_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_products_hashid', + 'newest', + 'profit', + 'topsale', + 'scoreyesterday', + 'region_aibyte_transform', + ]) }} as _airbyte_order_hashid, + tmp.* +from {{ ref('products_order_ab2') }} tmp +-- order at products/order +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/products_price_ab1.sql b/models/generated/airbyte_ctes/unibag/products_price_ab1.sql new file mode 100644 index 0000000..1af7377 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/products_price_ab1.sql @@ -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('products') }} +select + _airbyte_products_hashid, + {{ json_extract_scalar('price', ['base'], ['base']) }} as base, + {{ json_extract_scalar('price', ['market'], ['market']) }} as market, + {{ json_extract_scalar('price', ['profit'], ['profit']) }} as profit, + {{ json_extract_scalar('price', ['maximum'], ['maximum']) }} as maximum, + {{ json_extract_scalar('price', ['minimum'], ['minimum']) }} as minimum, + {{ json_extract_scalar('price', ['supplier'], ['supplier']) }} as supplier, + {{ json_extract_scalar('price', ['wholesaleBonus'], ['wholesaleBonus']) }} as wholesalebonus, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('products') }} as table_alias +-- price at products/price +where 1 = 1 +and price is not null + diff --git a/models/generated/airbyte_ctes/unibag/products_price_ab2.sql b/models/generated/airbyte_ctes/unibag/products_price_ab2.sql new file mode 100644 index 0000000..1b07ce9 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/products_price_ab2.sql @@ -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('products_price_ab1') }} +select + _airbyte_products_hashid, + cast(base as {{ dbt_utils.type_float() }}) as base, + cast(market as {{ dbt_utils.type_float() }}) as market, + cast(profit as {{ dbt_utils.type_float() }}) as profit, + cast(maximum as {{ dbt_utils.type_float() }}) as maximum, + cast(minimum as {{ dbt_utils.type_float() }}) as minimum, + cast(supplier as {{ dbt_utils.type_float() }}) as supplier, + cast(wholesalebonus as {{ dbt_utils.type_float() }}) as wholesalebonus, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('products_price_ab1') }} +-- price at products/price +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/products_price_ab3.sql b/models/generated/airbyte_ctes/unibag/products_price_ab3.sql new file mode 100644 index 0000000..722fa85 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/products_price_ab3.sql @@ -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('products_price_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_products_hashid', + 'base', + 'market', + 'profit', + 'maximum', + 'minimum', + 'supplier', + 'wholesalebonus', + ]) }} as _airbyte_price_hashid, + tmp.* +from {{ ref('products_price_ab2') }} tmp +-- price at products/price +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/products_pricepercent_ab1.sql b/models/generated/airbyte_ctes/unibag/products_pricepercent_ab1.sql new file mode 100644 index 0000000..bf9474d --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/products_pricepercent_ab1.sql @@ -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('products') }} +select + _airbyte_products_hashid, + {{ json_extract_scalar('pricepercent', ['base'], ['base']) }} as base, + {{ json_extract_scalar('pricepercent', ['selly'], ['selly']) }} as selly, + {{ json_extract_scalar('pricepercent', ['market'], ['market']) }} as market, + {{ json_extract_scalar('pricepercent', ['maximum'], ['maximum']) }} as maximum, + {{ json_extract_scalar('pricepercent', ['minimum'], ['minimum']) }} as minimum, + {{ json_extract_scalar('pricepercent', ['supplier'], ['supplier']) }} as supplier, + {{ json_extract_scalar('pricepercent', ['minimumPriceDifferential'], ['minimumPriceDifferential']) }} as minimumpricedifferential, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('products') }} as table_alias +-- pricepercent at products/pricePercent +where 1 = 1 +and pricepercent is not null + diff --git a/models/generated/airbyte_ctes/unibag/products_pricepercent_ab2.sql b/models/generated/airbyte_ctes/unibag/products_pricepercent_ab2.sql new file mode 100644 index 0000000..9516caa --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/products_pricepercent_ab2.sql @@ -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('products_pricepercent_ab1') }} +select + _airbyte_products_hashid, + cast(base as {{ dbt_utils.type_float() }}) as base, + cast(selly as {{ dbt_utils.type_float() }}) as selly, + cast(market as {{ dbt_utils.type_float() }}) as market, + cast(maximum as {{ dbt_utils.type_float() }}) as maximum, + cast(minimum as {{ dbt_utils.type_float() }}) as minimum, + cast(supplier as {{ dbt_utils.type_float() }}) as supplier, + cast(minimumpricedifferential as {{ dbt_utils.type_float() }}) as minimumpricedifferential, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('products_pricepercent_ab1') }} +-- pricepercent at products/pricePercent +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/products_pricepercent_ab3.sql b/models/generated/airbyte_ctes/unibag/products_pricepercent_ab3.sql new file mode 100644 index 0000000..a7e53b2 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/products_pricepercent_ab3.sql @@ -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('products_pricepercent_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_products_hashid', + 'base', + 'selly', + 'market', + 'maximum', + 'minimum', + 'supplier', + 'minimumpricedifferential', + ]) }} as _airbyte_pricepercent_hashid, + tmp.* +from {{ ref('products_pricepercent_ab2') }} tmp +-- pricepercent at products/pricePercent +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/products_reviewstatistic_ab1.sql b/models/generated/airbyte_ctes/unibag/products_reviewstatistic_ab1.sql new file mode 100644 index 0000000..aaedc98 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/products_reviewstatistic_ab1.sql @@ -0,0 +1,31 @@ +{{ 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('products') }} +select + _airbyte_products_hashid, + {{ json_extract_scalar('reviewstatistic', ['total'], ['total']) }} as total, + {{ json_extract_scalar('reviewstatistic', ['totalReview'], ['totalReview']) }} as totalreview, + {{ json_extract_scalar('reviewstatistic', ['totalScore1'], ['totalScore1']) }} as totalscore1, + {{ json_extract_scalar('reviewstatistic', ['totalScore2'], ['totalScore2']) }} as totalscore2, + {{ json_extract_scalar('reviewstatistic', ['totalScore3'], ['totalScore3']) }} as totalscore3, + {{ json_extract_scalar('reviewstatistic', ['totalScore4'], ['totalScore4']) }} as totalscore4, + {{ json_extract_scalar('reviewstatistic', ['totalScore5'], ['totalScore5']) }} as totalscore5, + {{ json_extract_scalar('reviewstatistic', ['scoreAverage'], ['scoreAverage']) }} as scoreaverage, + {{ json_extract_scalar('reviewstatistic', ['totalHasMedia'], ['totalHasMedia']) }} as totalhasmedia, + {{ json_extract_scalar('reviewstatistic', ['totalHasContent'], ['totalHasContent']) }} as totalhascontent, + {{ json_extract_scalar('reviewstatistic', ['scoreAverageWeekTotal'], ['scoreAverageWeekTotal']) }} as scoreaverageweektotal, + {{ json_extract_scalar('reviewstatistic', ['scoreAverageYearTotal'], ['scoreAverageYearTotal']) }} as scoreaverageyeartotal, + {{ json_extract_scalar('reviewstatistic', ['scoreAverageMonthTotal'], ['scoreAverageMonthTotal']) }} as scoreaveragemonthtotal, + {{ json_extract_scalar('reviewstatistic', ['scoreAverageTwoMonthTotal'], ['scoreAverageTwoMonthTotal']) }} as scoreaveragetwomonthtotal, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('products') }} as table_alias +-- reviewstatistic at products/reviewStatistic +where 1 = 1 +and reviewstatistic is not null + diff --git a/models/generated/airbyte_ctes/unibag/products_reviewstatistic_ab2.sql b/models/generated/airbyte_ctes/unibag/products_reviewstatistic_ab2.sql new file mode 100644 index 0000000..e5f7569 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/products_reviewstatistic_ab2.sql @@ -0,0 +1,30 @@ +{{ 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('products_reviewstatistic_ab1') }} +select + _airbyte_products_hashid, + cast(total as {{ dbt_utils.type_float() }}) as total, + cast(totalreview as {{ dbt_utils.type_float() }}) as totalreview, + cast(totalscore1 as {{ dbt_utils.type_float() }}) as totalscore1, + cast(totalscore2 as {{ dbt_utils.type_float() }}) as totalscore2, + cast(totalscore3 as {{ dbt_utils.type_float() }}) as totalscore3, + cast(totalscore4 as {{ dbt_utils.type_float() }}) as totalscore4, + cast(totalscore5 as {{ dbt_utils.type_float() }}) as totalscore5, + cast(scoreaverage as {{ dbt_utils.type_float() }}) as scoreaverage, + cast(totalhasmedia as {{ dbt_utils.type_float() }}) as totalhasmedia, + cast(totalhascontent as {{ dbt_utils.type_float() }}) as totalhascontent, + cast(scoreaverageweektotal as {{ dbt_utils.type_float() }}) as scoreaverageweektotal, + cast(scoreaverageyeartotal as {{ dbt_utils.type_float() }}) as scoreaverageyeartotal, + cast(scoreaveragemonthtotal as {{ dbt_utils.type_float() }}) as scoreaveragemonthtotal, + cast(scoreaveragetwomonthtotal as {{ dbt_utils.type_float() }}) as scoreaveragetwomonthtotal, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('products_reviewstatistic_ab1') }} +-- reviewstatistic at products/reviewStatistic +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/products_reviewstatistic_ab3.sql b/models/generated/airbyte_ctes/unibag/products_reviewstatistic_ab3.sql new file mode 100644 index 0000000..253484d --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/products_reviewstatistic_ab3.sql @@ -0,0 +1,30 @@ +{{ 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('products_reviewstatistic_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_products_hashid', + 'total', + 'totalreview', + 'totalscore1', + 'totalscore2', + 'totalscore3', + 'totalscore4', + 'totalscore5', + 'scoreaverage', + 'totalhasmedia', + 'totalhascontent', + 'scoreaverageweektotal', + 'scoreaverageyeartotal', + 'scoreaveragemonthtotal', + 'scoreaveragetwomonthtotal', + ]) }} as _airbyte_reviewstatistic_hashid, + tmp.* +from {{ ref('products_reviewstatistic_ab2') }} tmp +-- reviewstatistic at products/reviewStatistic +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/products_score_ab1.sql b/models/generated/airbyte_ctes/unibag/products_score_ab1.sql new file mode 100644 index 0000000..384889e --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/products_score_ab1.sql @@ -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('products') }} +select + _airbyte_products_hashid, + {{ json_extract_scalar('score', ['view'], ['view']) }} as {{ adapter.quote('view') }}, + {{ json_extract_scalar('score', ['order'], ['order']) }} as {{ adapter.quote('order') }}, + {{ json_extract_scalar('score', ['profit'], ['profit']) }} as profit, + {{ json_extract_scalar('score', ['current'], ['current']) }} as {{ adapter.quote('current') }}, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('products') }} as table_alias +-- score at products/score +where 1 = 1 +and score is not null + diff --git a/models/generated/airbyte_ctes/unibag/products_score_ab2.sql b/models/generated/airbyte_ctes/unibag/products_score_ab2.sql new file mode 100644 index 0000000..6d45ee1 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/products_score_ab2.sql @@ -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('products_score_ab1') }} +select + _airbyte_products_hashid, + cast({{ adapter.quote('view') }} as {{ dbt_utils.type_float() }}) as {{ adapter.quote('view') }}, + cast({{ adapter.quote('order') }} as {{ dbt_utils.type_float() }}) as {{ adapter.quote('order') }}, + cast(profit as {{ dbt_utils.type_float() }}) as profit, + cast({{ adapter.quote('current') }} as {{ dbt_utils.type_float() }}) as {{ adapter.quote('current') }}, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('products_score_ab1') }} +-- score at products/score +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/products_score_ab3.sql b/models/generated/airbyte_ctes/unibag/products_score_ab3.sql new file mode 100644 index 0000000..9afd9b7 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/products_score_ab3.sql @@ -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('products_score_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_products_hashid', + adapter.quote('view'), + adapter.quote('order'), + 'profit', + adapter.quote('current'), + ]) }} as _airbyte_score_hashid, + tmp.* +from {{ ref('products_score_ab2') }} tmp +-- score at products/score +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/products_sharestatistic_ab1.sql b/models/generated/airbyte_ctes/unibag/products_sharestatistic_ab1.sql new file mode 100644 index 0000000..e6ee713 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/products_sharestatistic_ab1.sql @@ -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('products') }} +select + _airbyte_products_hashid, + {{ json_extract_scalar('sharestatistic', ['totalShare'], ['totalShare']) }} as totalshare, + {{ json_extract_scalar('sharestatistic', ['totalShareFromSocialPost'], ['totalShareFromSocialPost']) }} as totalsharefromsocialpost, + {{ json_extract_scalar('sharestatistic', ['totalShareFromProductDetail'], ['totalShareFromProductDetail']) }} as totalsharefromproductdetail, + {{ json_extract_scalar('sharestatistic', ['totalUniqueShareFromSocialPost'], ['totalUniqueShareFromSocialPost']) }} as totaluniquesharefromsocialpost, + {{ json_extract_scalar('sharestatistic', ['totalUniqueShareFromProductDetail'], ['totalUniqueShareFromProductDetail']) }} as totaluniquesharefromproductdetail, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('products') }} as table_alias +-- sharestatistic at products/shareStatistic +where 1 = 1 +and sharestatistic is not null + diff --git a/models/generated/airbyte_ctes/unibag/products_sharestatistic_ab2.sql b/models/generated/airbyte_ctes/unibag/products_sharestatistic_ab2.sql new file mode 100644 index 0000000..12214cd --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/products_sharestatistic_ab2.sql @@ -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('products_sharestatistic_ab1') }} +select + _airbyte_products_hashid, + cast(totalshare as {{ dbt_utils.type_float() }}) as totalshare, + cast(totalsharefromsocialpost as {{ dbt_utils.type_float() }}) as totalsharefromsocialpost, + cast(totalsharefromproductdetail as {{ dbt_utils.type_float() }}) as totalsharefromproductdetail, + cast(totaluniquesharefromsocialpost as {{ dbt_utils.type_float() }}) as totaluniquesharefromsocialpost, + cast(totaluniquesharefromproductdetail as {{ dbt_utils.type_float() }}) as totaluniquesharefromproductdetail, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('products_sharestatistic_ab1') }} +-- sharestatistic at products/shareStatistic +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/products_sharestatistic_ab3.sql b/models/generated/airbyte_ctes/unibag/products_sharestatistic_ab3.sql new file mode 100644 index 0000000..f4b882d --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/products_sharestatistic_ab3.sql @@ -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('products_sharestatistic_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_products_hashid', + 'totalshare', + 'totalsharefromsocialpost', + 'totalsharefromproductdetail', + 'totaluniquesharefromsocialpost', + 'totaluniquesharefromproductdetail', + ]) }} as _airbyte_sharestatistic_hashid, + tmp.* +from {{ ref('products_sharestatistic_ab2') }} tmp +-- sharestatistic at products/shareStatistic +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/products_statistic_ab1.sql b/models/generated/airbyte_ctes/unibag/products_statistic_ab1.sql new file mode 100644 index 0000000..788159c --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/products_statistic_ab1.sql @@ -0,0 +1,39 @@ +{{ 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('products') }} +select + _airbyte_products_hashid, + {{ json_extract_scalar('statistic', ['view'], ['view']) }} as {{ adapter.quote('view') }}, + {{ json_extract_scalar('statistic', ['skuTotal'], ['skuTotal']) }} as skutotal, + {{ json_extract_scalar('statistic', ['saleTotal'], ['saleTotal']) }} as saletotal, + {{ json_extract_scalar('statistic', ['skuActive'], ['skuActive']) }} as skuactive, + {{ json_extract_scalar('statistic', ['totalPost'], ['totalPost']) }} as totalpost, + {{ json_extract_scalar('statistic', ['salesTotal'], ['salesTotal']) }} as salestotal, + {{ json_extract_scalar('statistic', ['salePending'], ['salePending']) }} as salepending, + {{ json_extract_scalar('statistic', ['saleWaiting'], ['saleWaiting']) }} as salewaiting, + {{ json_extract_scalar('statistic', ['saleCashback'], ['saleCashback']) }} as salecashback, + {{ json_extract_scalar('statistic', ['saleCancelled'], ['saleCancelled']) }} as salecancelled, + {{ json_extract_scalar('statistic', ['saleDelivered'], ['saleDelivered']) }} as saledelivered, + {{ json_extract_scalar('statistic', ['saleWeekTotal'], ['saleWeekTotal']) }} as saleweektotal, + {{ json_extract_scalar('statistic', ['saleYearTotal'], ['saleYearTotal']) }} as saleyeartotal, + {{ json_extract_scalar('statistic', ['saleDelivering'], ['saleDelivering']) }} as saledelivering, + {{ json_extract_scalar('statistic', ['saleMonthTotal'], ['saleMonthTotal']) }} as salemonthtotal, + {{ json_extract_scalar('statistic', ['salesWeekTotal'], ['salesWeekTotal']) }} as salesweektotal, + {{ json_extract_scalar('statistic', ['salesYearTotal'], ['salesYearTotal']) }} as salesyeartotal, + {{ json_extract_scalar('statistic', ['salesMonthTotal'], ['salesMonthTotal']) }} as salesmonthtotal, + {{ json_extract_scalar('statistic', ['saleTwoMonthTotal'], ['saleTwoMonthTotal']) }} as saletwomonthtotal, + {{ json_extract_scalar('statistic', ['salesTwoMonthTotal'], ['salesTwoMonthTotal']) }} as salestwomonthtotal, + {{ json_extract_scalar('statistic', ['salePaymentProcessing'], ['salePaymentProcessing']) }} as salepaymentprocessing, + {{ json_extract_scalar('statistic', ['totalInventory_aibyte_transform'], ['totalInventory_aibyte_transform']) }} as totalinventory_aibyte_transform, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('products') }} as table_alias +-- statistic at products/statistic +where 1 = 1 +and statistic is not null + diff --git a/models/generated/airbyte_ctes/unibag/products_statistic_ab2.sql b/models/generated/airbyte_ctes/unibag/products_statistic_ab2.sql new file mode 100644 index 0000000..e0cd400 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/products_statistic_ab2.sql @@ -0,0 +1,38 @@ +{{ 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('products_statistic_ab1') }} +select + _airbyte_products_hashid, + cast({{ adapter.quote('view') }} as {{ dbt_utils.type_float() }}) as {{ adapter.quote('view') }}, + cast(skutotal as {{ dbt_utils.type_float() }}) as skutotal, + cast(saletotal as {{ dbt_utils.type_float() }}) as saletotal, + cast(skuactive as {{ dbt_utils.type_float() }}) as skuactive, + cast(totalpost as {{ dbt_utils.type_float() }}) as totalpost, + cast(salestotal as {{ dbt_utils.type_float() }}) as salestotal, + cast(salepending as {{ dbt_utils.type_float() }}) as salepending, + cast(salewaiting as {{ dbt_utils.type_float() }}) as salewaiting, + cast(salecashback as {{ dbt_utils.type_float() }}) as salecashback, + cast(salecancelled as {{ dbt_utils.type_float() }}) as salecancelled, + cast(saledelivered as {{ dbt_utils.type_float() }}) as saledelivered, + cast(saleweektotal as {{ dbt_utils.type_float() }}) as saleweektotal, + cast(saleyeartotal as {{ dbt_utils.type_float() }}) as saleyeartotal, + cast(saledelivering as {{ dbt_utils.type_float() }}) as saledelivering, + cast(salemonthtotal as {{ dbt_utils.type_float() }}) as salemonthtotal, + cast(salesweektotal as {{ dbt_utils.type_float() }}) as salesweektotal, + cast(salesyeartotal as {{ dbt_utils.type_float() }}) as salesyeartotal, + cast(salesmonthtotal as {{ dbt_utils.type_float() }}) as salesmonthtotal, + cast(saletwomonthtotal as {{ dbt_utils.type_float() }}) as saletwomonthtotal, + cast(salestwomonthtotal as {{ dbt_utils.type_float() }}) as salestwomonthtotal, + cast(salepaymentprocessing as {{ dbt_utils.type_float() }}) as salepaymentprocessing, + cast(totalinventory_aibyte_transform as {{ dbt_utils.type_string() }}) as totalinventory_aibyte_transform, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('products_statistic_ab1') }} +-- statistic at products/statistic +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/products_statistic_ab3.sql b/models/generated/airbyte_ctes/unibag/products_statistic_ab3.sql new file mode 100644 index 0000000..0eea7ec --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/products_statistic_ab3.sql @@ -0,0 +1,38 @@ +{{ 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('products_statistic_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_products_hashid', + adapter.quote('view'), + 'skutotal', + 'saletotal', + 'skuactive', + 'totalpost', + 'salestotal', + 'salepending', + 'salewaiting', + 'salecashback', + 'salecancelled', + 'saledelivered', + 'saleweektotal', + 'saleyeartotal', + 'saledelivering', + 'salemonthtotal', + 'salesweektotal', + 'salesyeartotal', + 'salesmonthtotal', + 'saletwomonthtotal', + 'salestwomonthtotal', + 'salepaymentprocessing', + 'totalinventory_aibyte_transform', + ]) }} as _airbyte_statistic_hashid, + tmp.* +from {{ ref('products_statistic_ab2') }} tmp +-- statistic at products/statistic +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/promotion_orders_ab1.sql b/models/generated/airbyte_ctes/unibag/promotion_orders_ab1.sql index b4a9c1d..6062ced 100644 --- a/models/generated/airbyte_ctes/unibag/promotion_orders_ab1.sql +++ b/models/generated/airbyte_ctes/unibag/promotion_orders_ab1.sql @@ -12,16 +12,15 @@ select {{ json_extract_scalar('_airbyte_data', ['order'], ['order']) }} as {{ adapter.quote('order') }}, {{ json_extract_scalar('_airbyte_data', ['title'], ['title']) }} as title, {{ json_extract_scalar('_airbyte_data', ['status'], ['status']) }} as status, - {{ 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', ['promotion'], ['promotion']) }} as promotion, {{ json_extract_scalar('_airbyte_data', ['updatedAt'], ['updatedAt']) }} as updatedat, {{ json_extract_scalar('_airbyte_data', ['cashbackAt'], ['cashbackAt']) }} as cashbackat, {{ json_extract_scalar('_airbyte_data', ['commission'], ['commission']) }} as commission, {{ json_extract_scalar('_airbyte_data', ['isRejected'], ['isRejected']) }} as isrejected, + {{ json_extract_scalar('_airbyte_data', ['orderPriceTotal'], ['orderPriceTotal']) }} as orderpricetotal, {{ json_extract_scalar('_airbyte_data', ['quantityPromotion'], ['quantityPromotion']) }} as quantitypromotion, - {{ json_extract_scalar('_airbyte_data', ['supplierCommission'], ['supplierCommission']) }} as suppliercommission, - {{ json_extract_scalar('_airbyte_data', ['supplierCommissionTotal'], ['supplierCommissionTotal']) }} as suppliercommissiontotal, _airbyte_ab_id, _airbyte_emitted_at, {{ current_timestamp() }} as _airbyte_normalized_at diff --git a/models/generated/airbyte_ctes/unibag/promotion_orders_ab2.sql b/models/generated/airbyte_ctes/unibag/promotion_orders_ab2.sql index 0dff1ec..7386e50 100644 --- a/models/generated/airbyte_ctes/unibag/promotion_orders_ab2.sql +++ b/models/generated/airbyte_ctes/unibag/promotion_orders_ab2.sql @@ -12,16 +12,15 @@ select cast({{ adapter.quote('order') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('order') }}, cast(title as {{ dbt_utils.type_string() }}) as title, cast(status as {{ dbt_utils.type_string() }}) as status, - 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(promotion as {{ dbt_utils.type_string() }}) as promotion, cast(updatedat as {{ dbt_utils.type_string() }}) as updatedat, cast(cashbackat as {{ dbt_utils.type_string() }}) as cashbackat, cast(commission as {{ dbt_utils.type_float() }}) as commission, {{ cast_to_boolean('isrejected') }} as isrejected, + cast(orderpricetotal as {{ dbt_utils.type_float() }}) as orderpricetotal, cast(quantitypromotion as {{ dbt_utils.type_float() }}) as quantitypromotion, - cast(supplierCommission as {{ dbt_utils.type_string() }}) as supplierCommission, - cast(supplierCommissionTotal as {{ dbt_utils.type_float() }}) as supplierCommissionTotal, _airbyte_ab_id, _airbyte_emitted_at, {{ current_timestamp() }} as _airbyte_normalized_at diff --git a/models/generated/airbyte_ctes/unibag/promotion_orders_ab3.sql b/models/generated/airbyte_ctes/unibag/promotion_orders_ab3.sql index 1f7b933..3c35af3 100644 --- a/models/generated/airbyte_ctes/unibag/promotion_orders_ab3.sql +++ b/models/generated/airbyte_ctes/unibag/promotion_orders_ab3.sql @@ -13,16 +13,15 @@ select adapter.quote('order'), 'title', 'status', - 'supplier', + object_to_string('supplier'), 'createdat', 'promotion', 'updatedat', 'cashbackat', 'commission', boolean_to_string('isrejected'), + 'orderpricetotal', 'quantitypromotion', - 'supplierCommission', - 'supplierCommissionTotal', ]) }} as _airbyte_promotion_orders_hashid, tmp.* from {{ ref('promotion_orders_ab2') }} tmp diff --git a/models/generated/airbyte_ctes/unibag/promotion_orders_supplier_ab1.sql b/models/generated/airbyte_ctes/unibag/promotion_orders_supplier_ab1.sql new file mode 100644 index 0000000..9172e9b --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/promotion_orders_supplier_ab1.sql @@ -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('promotion_orders') }} +select + _airbyte_promotion_orders_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('promotion_orders') }} as table_alias +-- supplier at promotion-orders/supplier +where 1 = 1 +and supplier is not null + diff --git a/models/generated/airbyte_ctes/unibag/promotion_orders_supplier_ab2.sql b/models/generated/airbyte_ctes/unibag/promotion_orders_supplier_ab2.sql new file mode 100644 index 0000000..b4fa0fd --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/promotion_orders_supplier_ab2.sql @@ -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('promotion_orders_supplier_ab1') }} +select + _airbyte_promotion_orders_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('promotion_orders_supplier_ab1') }} +-- supplier at promotion-orders/supplier +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/promotion_orders_supplier_ab3.sql b/models/generated/airbyte_ctes/unibag/promotion_orders_supplier_ab3.sql new file mode 100644 index 0000000..d66909d --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/promotion_orders_supplier_ab3.sql @@ -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('promotion_orders_supplier_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_promotion_orders_hashid', + '_id', + adapter.quote('name'), + 'searchstring', + ]) }} as _airbyte_supplier_hashid, + tmp.* +from {{ ref('promotion_orders_supplier_ab2') }} tmp +-- supplier at promotion-orders/supplier +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/promotions_ab1.sql b/models/generated/airbyte_ctes/unibag/promotions_ab1.sql index 7d95d4e..c6c5b1b 100644 --- a/models/generated/airbyte_ctes/unibag/promotions_ab1.sql +++ b/models/generated/airbyte_ctes/unibag/promotions_ab1.sql @@ -8,24 +8,27 @@ -- depends_on: {{ source('unibag', '_airbyte_raw_promotions') }} select {{ json_extract_scalar('_airbyte_data', ['_id'], ['_id']) }} as _id, + {{ json_extract_scalar('_airbyte_data', ['code'], ['code']) }} as code, {{ json_extract_scalar('_airbyte_data', ['rest'], ['rest']) }} as rest, {{ json_extract_scalar('_airbyte_data', ['type'], ['type']) }} as {{ adapter.quote('type') }}, {{ json_extract_scalar('_airbyte_data', ['endAt'], ['endAt']) }} as endat, {{ json_extract_scalar('_airbyte_data', ['title'], ['title']) }} as title, {{ json_extract_scalar('_airbyte_data', ['active'], ['active']) }} as active, - {{ 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', ['applyFor'], ['applyFor']) }} as applyfor, + {{ json_extract('table_alias', '_airbyte_data', ['applyFor'], ['applyFor']) }} as applyfor, {{ json_extract_scalar('_airbyte_data', ['quantity'], ['quantity']) }} as quantity, {{ json_extract_scalar('_airbyte_data', ['articleID'], ['articleID']) }} as articleid, {{ json_extract_scalar('_airbyte_data', ['createdAt'], ['createdAt']) }} as createdat, + {{ json_extract('table_alias', '_airbyte_data', ['statistic'], ['statistic']) }} as statistic, {{ json_extract_scalar('_airbyte_data', ['updatedAt'], ['updatedAt']) }} as updatedat, {{ json_extract_scalar('_airbyte_data', ['searchString'], ['searchString']) }} as searchstring, - {{ json_extract_scalar('_airbyte_data', ['sharePercent'], ['sharePercent']) }} as sharepercent, - {{ json_extract_scalar('_airbyte_data', ['conditionForUser'], ['conditionForUser']) }} as conditionforuser, + {{ json_extract('table_alias', '_airbyte_data', ['conditionForUser'], ['conditionForUser']) }} as conditionforuser, + {{ json_extract('table_alias', '_airbyte_data', ['supplierCommission'], ['supplierCommission']) }} as suppliercommission, {{ json_extract_scalar('_airbyte_data', ['isUnlimitedQuantity'], ['isUnlimitedQuantity']) }} as isunlimitedquantity, + {{ json_extract_scalar('_airbyte_data', ['maximumLimitPerUser'], ['maximumLimitPerUser']) }} as maximumlimitperuser, + {{ json_extract_array('_airbyte_data', ['milestonesStatistic'], ['milestonesStatistic']) }} as milestonesstatistic, {{ json_extract_scalar('_airbyte_data', ['isApplyForOrderWholesale'], ['isApplyForOrderWholesale']) }} as isapplyfororderwholesale, - {{ json_extract_scalar('_airbyte_data', ['supplierCommission'], ['supplierCommission']) }} as suppliercommission, _airbyte_ab_id, _airbyte_emitted_at, {{ current_timestamp() }} as _airbyte_normalized_at diff --git a/models/generated/airbyte_ctes/unibag/promotions_ab2.sql b/models/generated/airbyte_ctes/unibag/promotions_ab2.sql index 16eaeb6..8a6e218 100644 --- a/models/generated/airbyte_ctes/unibag/promotions_ab2.sql +++ b/models/generated/airbyte_ctes/unibag/promotions_ab2.sql @@ -8,24 +8,27 @@ -- depends_on: {{ ref('promotions_ab1') }} select cast(_id as {{ dbt_utils.type_string() }}) as _id, + cast(code as {{ dbt_utils.type_string() }}) as code, cast(rest as {{ dbt_utils.type_float() }}) as rest, cast({{ adapter.quote('type') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('type') }}, cast(endat as {{ dbt_utils.type_string() }}) as endat, cast(title as {{ dbt_utils.type_string() }}) as title, {{ cast_to_boolean('active') }} as active, - 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(applyfor as {{ dbt_utils.type_string() }}) as applyfor, + cast(applyfor as {{ type_json() }}) as applyfor, cast(quantity as {{ dbt_utils.type_float() }}) as quantity, cast(articleid as {{ dbt_utils.type_string() }}) as articleid, cast(createdat as {{ dbt_utils.type_string() }}) as createdat, + cast(statistic as {{ type_json() }}) as statistic, cast(updatedat as {{ dbt_utils.type_string() }}) as updatedat, cast(searchstring as {{ dbt_utils.type_string() }}) as searchstring, - cast(sharepercent as {{ dbt_utils.type_string() }}) as sharepercent, - cast(conditionforuser as {{ dbt_utils.type_string() }}) as conditionforuser, + cast(conditionforuser as {{ type_json() }}) as conditionforuser, + cast(suppliercommission as {{ type_json() }}) as suppliercommission, {{ cast_to_boolean('isunlimitedquantity') }} as isunlimitedquantity, + cast(maximumlimitperuser as {{ dbt_utils.type_float() }}) as maximumlimitperuser, + milestonesstatistic, {{ cast_to_boolean('isapplyfororderwholesale') }} as isapplyfororderwholesale, - cast(supplierCommission as {{ dbt_utils.type_string() }}) as supplierCommission, _airbyte_ab_id, _airbyte_emitted_at, {{ current_timestamp() }} as _airbyte_normalized_at diff --git a/models/generated/airbyte_ctes/unibag/promotions_ab3.sql b/models/generated/airbyte_ctes/unibag/promotions_ab3.sql index 068abef..4d92dc8 100644 --- a/models/generated/airbyte_ctes/unibag/promotions_ab3.sql +++ b/models/generated/airbyte_ctes/unibag/promotions_ab3.sql @@ -9,24 +9,27 @@ select {{ dbt_utils.surrogate_key([ '_id', + 'code', 'rest', adapter.quote('type'), 'endat', 'title', boolean_to_string('active'), - adapter.quote('options'), + object_to_string(adapter.quote('options')), 'startat', - 'applyfor', + object_to_string('applyfor'), 'quantity', 'articleid', 'createdat', + object_to_string('statistic'), 'updatedat', 'searchstring', - 'sharepercent', - 'conditionforuser', + object_to_string('conditionforuser'), + object_to_string('suppliercommission'), boolean_to_string('isunlimitedquantity'), + 'maximumlimitperuser', + array_to_string('milestonesstatistic'), boolean_to_string('isapplyfororderwholesale'), - 'supplierCommission', ]) }} as _airbyte_promotions_hashid, tmp.* from {{ ref('promotions_ab2') }} tmp diff --git a/models/generated/airbyte_ctes/unibag/promotions_applyfor_ab1.sql b/models/generated/airbyte_ctes/unibag/promotions_applyfor_ab1.sql new file mode 100644 index 0000000..8c7bf85 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/promotions_applyfor_ab1.sql @@ -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('promotions') }} +select + _airbyte_promotions_hashid, + {{ json_extract_array('applyfor', ['list'], ['list']) }} as list, + {{ json_extract_scalar('applyfor', ['type'], ['type']) }} as {{ adapter.quote('type') }}, + {{ json_extract_array('applyfor', ['provinces'], ['provinces']) }} as provinces, + {{ json_extract_scalar('applyfor', ['isApplyAllOrder'], ['isApplyAllOrder']) }} as isapplyallorder, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('promotions') }} as table_alias +-- applyfor at promotions/applyFor +where 1 = 1 +and applyfor is not null + diff --git a/models/generated/airbyte_ctes/unibag/promotions_applyfor_ab2.sql b/models/generated/airbyte_ctes/unibag/promotions_applyfor_ab2.sql new file mode 100644 index 0000000..1e84d60 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/promotions_applyfor_ab2.sql @@ -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('promotions_applyfor_ab1') }} +select + _airbyte_promotions_hashid, + list, + cast({{ adapter.quote('type') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('type') }}, + provinces, + {{ cast_to_boolean('isapplyallorder') }} as isapplyallorder, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('promotions_applyfor_ab1') }} +-- applyfor at promotions/applyFor +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/promotions_applyfor_ab3.sql b/models/generated/airbyte_ctes/unibag/promotions_applyfor_ab3.sql new file mode 100644 index 0000000..aa4baa7 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/promotions_applyfor_ab3.sql @@ -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('promotions_applyfor_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_promotions_hashid', + array_to_string('list'), + adapter.quote('type'), + array_to_string('provinces'), + boolean_to_string('isapplyallorder'), + ]) }} as _airbyte_applyfor_hashid, + tmp.* +from {{ ref('promotions_applyfor_ab2') }} tmp +-- applyfor at promotions/applyFor +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/promotions_conditionforuser_ab1.sql b/models/generated/airbyte_ctes/unibag/promotions_conditionforuser_ab1.sql new file mode 100644 index 0000000..d5b39fb --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/promotions_conditionforuser_ab1.sql @@ -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('promotions') }} +select + _airbyte_promotions_hashid, + {{ json_extract_scalar('conditionforuser', ['gender'], ['gender']) }} as gender, + {{ json_extract_scalar('conditionforuser', ['applyFor'], ['applyFor']) }} as applyfor, + {{ json_extract_array('conditionforuser', ['segments'], ['segments']) }} as segments, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('promotions') }} as table_alias +-- conditionforuser at promotions/conditionForUser +where 1 = 1 +and conditionforuser is not null + diff --git a/models/generated/airbyte_ctes/unibag/promotions_conditionforuser_ab2.sql b/models/generated/airbyte_ctes/unibag/promotions_conditionforuser_ab2.sql new file mode 100644 index 0000000..fe8a868 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/promotions_conditionforuser_ab2.sql @@ -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('promotions_conditionforuser_ab1') }} +select + _airbyte_promotions_hashid, + cast(gender as {{ dbt_utils.type_string() }}) as gender, + cast(applyfor as {{ dbt_utils.type_string() }}) as applyfor, + segments, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('promotions_conditionforuser_ab1') }} +-- conditionforuser at promotions/conditionForUser +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/promotions_conditionforuser_ab3.sql b/models/generated/airbyte_ctes/unibag/promotions_conditionforuser_ab3.sql new file mode 100644 index 0000000..803db67 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/promotions_conditionforuser_ab3.sql @@ -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('promotions_conditionforuser_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_promotions_hashid', + 'gender', + 'applyfor', + array_to_string('segments'), + ]) }} as _airbyte_conditionforuser_hashid, + tmp.* +from {{ ref('promotions_conditionforuser_ab2') }} tmp +-- conditionforuser at promotions/conditionForUser +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/promotions_options_ab1.sql b/models/generated/airbyte_ctes/unibag/promotions_options_ab1.sql new file mode 100644 index 0000000..649ea3f --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/promotions_options_ab1.sql @@ -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('promotions') }} +select + _airbyte_promotions_hashid, + {{ json_extract('table_alias', adapter.quote('options'), ['bonus'], ['bonus']) }} as bonus, + {{ json_extract_array(adapter.quote('options'), ['milestones'], ['milestones']) }} as milestones, + {{ json_extract_array(adapter.quote('options'), ['supplierMilestones'], ['supplierMilestones']) }} as suppliermilestones, + {{ json_extract_scalar(adapter.quote('options'), ['transactionMinValue'], ['transactionMinValue']) }} as transactionminvalue, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('promotions') }} as table_alias +-- options at promotions/options +where 1 = 1 +and {{ adapter.quote('options') }} is not null + diff --git a/models/generated/airbyte_ctes/unibag/promotions_options_ab2.sql b/models/generated/airbyte_ctes/unibag/promotions_options_ab2.sql new file mode 100644 index 0000000..e598e4e --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/promotions_options_ab2.sql @@ -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('promotions_options_ab1') }} +select + _airbyte_promotions_hashid, + cast(bonus as {{ type_json() }}) as bonus, + milestones, + suppliermilestones, + cast(transactionminvalue as {{ dbt_utils.type_float() }}) as transactionminvalue, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('promotions_options_ab1') }} +-- options at promotions/options +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/promotions_options_ab3.sql b/models/generated/airbyte_ctes/unibag/promotions_options_ab3.sql new file mode 100644 index 0000000..a8b02ca --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/promotions_options_ab3.sql @@ -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('promotions_options_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_promotions_hashid', + object_to_string('bonus'), + array_to_string('milestones'), + array_to_string('suppliermilestones'), + 'transactionminvalue', + ]) }} as _airbyte_options_hashid, + tmp.* +from {{ ref('promotions_options_ab2') }} tmp +-- options at promotions/options +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/promotions_options_bonus_ab1.sql b/models/generated/airbyte_ctes/unibag/promotions_options_bonus_ab1.sql new file mode 100644 index 0000000..a1d98e6 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/promotions_options_bonus_ab1.sql @@ -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('promotions_options') }} +select + _airbyte_options_hashid, + {{ json_extract_scalar('bonus', ['type'], ['type']) }} as {{ adapter.quote('type') }}, + {{ json_extract_scalar('bonus', ['value'], ['value']) }} as {{ adapter.quote('value') }}, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('promotions_options') }} as table_alias +-- bonus at promotions/options/bonus +where 1 = 1 +and bonus is not null + diff --git a/models/generated/airbyte_ctes/unibag/promotions_options_bonus_ab2.sql b/models/generated/airbyte_ctes/unibag/promotions_options_bonus_ab2.sql new file mode 100644 index 0000000..d91be70 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/promotions_options_bonus_ab2.sql @@ -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('promotions_options_bonus_ab1') }} +select + _airbyte_options_hashid, + cast({{ adapter.quote('type') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('type') }}, + cast({{ adapter.quote('value') }} as {{ dbt_utils.type_float() }}) as {{ adapter.quote('value') }}, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('promotions_options_bonus_ab1') }} +-- bonus at promotions/options/bonus +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/promotions_options_bonus_ab3.sql b/models/generated/airbyte_ctes/unibag/promotions_options_bonus_ab3.sql new file mode 100644 index 0000000..0211fa6 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/promotions_options_bonus_ab3.sql @@ -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('promotions_options_bonus_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_options_hashid', + adapter.quote('type'), + adapter.quote('value'), + ]) }} as _airbyte_bonus_hashid, + tmp.* +from {{ ref('promotions_options_bonus_ab2') }} tmp +-- bonus at promotions/options/bonus +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/promotions_statistic_ab1.sql b/models/generated/airbyte_ctes/unibag/promotions_statistic_ab1.sql new file mode 100644 index 0000000..cabc49b --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/promotions_statistic_ab1.sql @@ -0,0 +1,30 @@ +{{ 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('promotions') }} +select + _airbyte_promotions_hashid, + {{ json_extract_scalar('statistic', ['nmv'], ['nmv']) }} as nmv, + {{ json_extract_scalar('statistic', ['userTotal'], ['userTotal']) }} as usertotal, + {{ json_extract_scalar('statistic', ['quantityPendingTotal'], ['quantityPendingTotal']) }} as quantitypendingtotal, + {{ json_extract_scalar('statistic', ['quantitySuccessTotal'], ['quantitySuccessTotal']) }} as quantitysuccesstotal, + {{ json_extract_scalar('statistic', ['quantityRejectedTotal'], ['quantityRejectedTotal']) }} as quantityrejectedtotal, + {{ json_extract_scalar('statistic', ['commissionPendingTotal'], ['commissionPendingTotal']) }} as commissionpendingtotal, + {{ json_extract_scalar('statistic', ['commissionSuccessTotal'], ['commissionSuccessTotal']) }} as commissionsuccesstotal, + {{ json_extract_scalar('statistic', ['commissionRejectedTotal'], ['commissionRejectedTotal']) }} as commissionrejectedtotal, + {{ json_extract_scalar('statistic', ['quantityNotRejectedTotal'], ['quantityNotRejectedTotal']) }} as quantitynotrejectedtotal, + {{ json_extract_scalar('statistic', ['supplierCommissionPending'], ['supplierCommissionPending']) }} as suppliercommissionpending, + {{ json_extract_scalar('statistic', ['supplierCommissionSuccess'], ['supplierCommissionSuccess']) }} as suppliercommissionsuccess, + {{ json_extract_scalar('statistic', ['commissionNotRejectedTotal'], ['commissionNotRejectedTotal']) }} as commissionnotrejectedtotal, + {{ json_extract_scalar('statistic', ['supplierCommissionNotRejected'], ['supplierCommissionNotRejected']) }} as suppliercommissionnotrejected, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('promotions') }} as table_alias +-- statistic at promotions/statistic +where 1 = 1 +and statistic is not null + diff --git a/models/generated/airbyte_ctes/unibag/promotions_statistic_ab2.sql b/models/generated/airbyte_ctes/unibag/promotions_statistic_ab2.sql new file mode 100644 index 0000000..be72de9 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/promotions_statistic_ab2.sql @@ -0,0 +1,29 @@ +{{ 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('promotions_statistic_ab1') }} +select + _airbyte_promotions_hashid, + cast(nmv as {{ dbt_utils.type_float() }}) as nmv, + cast(usertotal as {{ dbt_utils.type_float() }}) as usertotal, + cast(quantitypendingtotal as {{ dbt_utils.type_float() }}) as quantitypendingtotal, + cast(quantitysuccesstotal as {{ dbt_utils.type_float() }}) as quantitysuccesstotal, + cast(quantityrejectedtotal as {{ dbt_utils.type_float() }}) as quantityrejectedtotal, + cast(commissionpendingtotal as {{ dbt_utils.type_float() }}) as commissionpendingtotal, + cast(commissionsuccesstotal as {{ dbt_utils.type_float() }}) as commissionsuccesstotal, + cast(commissionrejectedtotal as {{ dbt_utils.type_float() }}) as commissionrejectedtotal, + cast(quantitynotrejectedtotal as {{ dbt_utils.type_float() }}) as quantitynotrejectedtotal, + cast(suppliercommissionpending as {{ dbt_utils.type_float() }}) as suppliercommissionpending, + cast(suppliercommissionsuccess as {{ dbt_utils.type_float() }}) as suppliercommissionsuccess, + cast(commissionnotrejectedtotal as {{ dbt_utils.type_float() }}) as commissionnotrejectedtotal, + cast(suppliercommissionnotrejected as {{ dbt_utils.type_float() }}) as suppliercommissionnotrejected, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('promotions_statistic_ab1') }} +-- statistic at promotions/statistic +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/promotions_statistic_ab3.sql b/models/generated/airbyte_ctes/unibag/promotions_statistic_ab3.sql new file mode 100644 index 0000000..b86cffe --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/promotions_statistic_ab3.sql @@ -0,0 +1,29 @@ +{{ 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('promotions_statistic_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_promotions_hashid', + 'nmv', + 'usertotal', + 'quantitypendingtotal', + 'quantitysuccesstotal', + 'quantityrejectedtotal', + 'commissionpendingtotal', + 'commissionsuccesstotal', + 'commissionrejectedtotal', + 'quantitynotrejectedtotal', + 'suppliercommissionpending', + 'suppliercommissionsuccess', + 'commissionnotrejectedtotal', + 'suppliercommissionnotrejected', + ]) }} as _airbyte_statistic_hashid, + tmp.* +from {{ ref('promotions_statistic_ab2') }} tmp +-- statistic at promotions/statistic +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/promotions_suppliercommission_ab1.sql b/models/generated/airbyte_ctes/unibag/promotions_suppliercommission_ab1.sql new file mode 100644 index 0000000..5be9750 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/promotions_suppliercommission_ab1.sql @@ -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('promotions') }} +select + _airbyte_promotions_hashid, + {{ json_extract_scalar('suppliercommission', ['type'], ['type']) }} as {{ adapter.quote('type') }}, + {{ json_extract_scalar('suppliercommission', ['value'], ['value']) }} as {{ adapter.quote('value') }}, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('promotions') }} as table_alias +-- suppliercommission at promotions/supplierCommission +where 1 = 1 +and suppliercommission is not null + diff --git a/models/generated/airbyte_ctes/unibag/promotions_suppliercommission_ab2.sql b/models/generated/airbyte_ctes/unibag/promotions_suppliercommission_ab2.sql new file mode 100644 index 0000000..7a8ab71 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/promotions_suppliercommission_ab2.sql @@ -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('promotions_suppliercommission_ab1') }} +select + _airbyte_promotions_hashid, + cast({{ adapter.quote('type') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('type') }}, + cast({{ adapter.quote('value') }} as {{ dbt_utils.type_float() }}) as {{ adapter.quote('value') }}, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('promotions_suppliercommission_ab1') }} +-- suppliercommission at promotions/supplierCommission +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/promotions_suppliercommission_ab3.sql b/models/generated/airbyte_ctes/unibag/promotions_suppliercommission_ab3.sql new file mode 100644 index 0000000..6cdd388 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/promotions_suppliercommission_ab3.sql @@ -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('promotions_suppliercommission_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_promotions_hashid', + adapter.quote('type'), + adapter.quote('value'), + ]) }} as _airbyte_suppliercommission_hashid, + tmp.* +from {{ ref('promotions_suppliercommission_ab2') }} tmp +-- suppliercommission at promotions/supplierCommission +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/session_deliveries_ab1.sql b/models/generated/airbyte_ctes/unibag/session_deliveries_ab1.sql new file mode 100644 index 0000000..9f16705 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/session_deliveries_ab1.sql @@ -0,0 +1,31 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + unique_key = '_airbyte_ab_id', + schema = "_airbyte_unibag", + tags = [ "top-level-intermediate" ] +) }} +-- SQL model to parse JSON blob stored in a single column and extract into separated field columns as described by the JSON Schema +-- depends_on: {{ source('unibag', '_airbyte_raw_session_deliveries') }} +select + {{ json_extract_scalar('_airbyte_data', ['_id'], ['_id']) }} as _id, + {{ json_extract_scalar('_airbyte_data', ['cart'], ['cart']) }} as cart, + {{ json_extract_scalar('_airbyte_data', ['note'], ['note']) }} as note, + {{ json_extract_scalar('_airbyte_data', ['title'], ['title']) }} as title, + {{ json_extract('table_alias', '_airbyte_data', ['request'], ['request']) }} as request, + {{ json_extract_scalar('_airbyte_data', ['service'], ['service']) }} as service, + {{ json_extract_scalar('_airbyte_data', ['currency'], ['currency']) }} as currency, + {{ json_extract('table_alias', '_airbyte_data', ['customer'], ['customer']) }} as customer, + {{ json_extract('table_alias', '_airbyte_data', ['delivery'], ['delivery']) }} as delivery, + {{ json_extract('table_alias', '_airbyte_data', ['location'], ['location']) }} as {{ adapter.quote('location') }}, + {{ json_extract_scalar('_airbyte_data', ['createdAt'], ['createdAt']) }} as createdat, + {{ json_extract('table_alias', '_airbyte_data', ['promotion'], ['promotion']) }} as promotion, + {{ json_extract_scalar('_airbyte_data', ['sessionOrder'], ['sessionOrder']) }} as sessionorder, + {{ json_extract_scalar('_airbyte_data', ['paymentMethod'], ['paymentMethod']) }} as paymentmethod, + {{ json_extract_scalar('_airbyte_data', ['estimateTimeDelivery'], ['estimateTimeDelivery']) }} as estimatetimedelivery, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ source('unibag', '_airbyte_raw_session_deliveries') }} as table_alias +-- session_deliveries +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/session_deliveries_ab2.sql b/models/generated/airbyte_ctes/unibag/session_deliveries_ab2.sql new file mode 100644 index 0000000..32f8f98 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/session_deliveries_ab2.sql @@ -0,0 +1,31 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + unique_key = '_airbyte_ab_id', + schema = "_airbyte_unibag", + tags = [ "top-level-intermediate" ] +) }} +-- SQL model to cast each column to its adequate SQL type converted from the JSON schema type +-- depends_on: {{ ref('session_deliveries_ab1') }} +select + cast(_id as {{ dbt_utils.type_string() }}) as _id, + cast(cart as {{ dbt_utils.type_string() }}) as cart, + cast(note as {{ dbt_utils.type_string() }}) as note, + cast(title as {{ dbt_utils.type_string() }}) as title, + cast(request as {{ type_json() }}) as request, + cast(service as {{ dbt_utils.type_string() }}) as service, + cast(currency as {{ dbt_utils.type_string() }}) as currency, + cast(customer as {{ type_json() }}) as customer, + cast(delivery as {{ type_json() }}) as delivery, + cast({{ adapter.quote('location') }} as {{ type_json() }}) as {{ adapter.quote('location') }}, + cast(createdat as {{ dbt_utils.type_string() }}) as createdat, + cast(promotion as {{ type_json() }}) as promotion, + cast(sessionorder as {{ dbt_utils.type_string() }}) as sessionorder, + cast(paymentmethod as {{ dbt_utils.type_string() }}) as paymentmethod, + cast(estimatetimedelivery as {{ dbt_utils.type_string() }}) as estimatetimedelivery, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('session_deliveries_ab1') }} +-- session_deliveries +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/session_deliveries_ab3.sql b/models/generated/airbyte_ctes/unibag/session_deliveries_ab3.sql new file mode 100644 index 0000000..deda432 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/session_deliveries_ab3.sql @@ -0,0 +1,31 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + unique_key = '_airbyte_ab_id', + schema = "_airbyte_unibag", + tags = [ "top-level-intermediate" ] +) }} +-- SQL model to build a hash column based on the values of this record +-- depends_on: {{ ref('session_deliveries_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_id', + 'cart', + 'note', + 'title', + object_to_string('request'), + 'service', + 'currency', + object_to_string('customer'), + object_to_string('delivery'), + object_to_string(adapter.quote('location')), + 'createdat', + object_to_string('promotion'), + 'sessionorder', + 'paymentmethod', + 'estimatetimedelivery', + ]) }} as _airbyte_session_deliveries_hashid, + tmp.* +from {{ ref('session_deliveries_ab2') }} tmp +-- session_deliveries +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/session_deliveries_customer_ab1.sql b/models/generated/airbyte_ctes/unibag/session_deliveries_customer_ab1.sql new file mode 100644 index 0000000..dff968e --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/session_deliveries_customer_ab1.sql @@ -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('session_deliveries') }} +select + _airbyte_session_deliveries_hashid, + {{ json_extract_scalar('customer', ['_id'], ['_id']) }} as _id, + {{ json_extract_scalar('customer', ['name'], ['name']) }} as {{ adapter.quote('name') }}, + {{ json_extract_scalar('customer', ['phone'], ['phone']) }} as phone, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('session_deliveries') }} as table_alias +-- customer at session-deliveries/customer +where 1 = 1 +and customer is not null + diff --git a/models/generated/airbyte_ctes/unibag/session_deliveries_customer_ab2.sql b/models/generated/airbyte_ctes/unibag/session_deliveries_customer_ab2.sql new file mode 100644 index 0000000..bad5357 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/session_deliveries_customer_ab2.sql @@ -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('session_deliveries_customer_ab1') }} +select + _airbyte_session_deliveries_hashid, + cast(_id as {{ dbt_utils.type_string() }}) as _id, + cast({{ adapter.quote('name') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('name') }}, + cast(phone as {{ dbt_utils.type_string() }}) as phone, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('session_deliveries_customer_ab1') }} +-- customer at session-deliveries/customer +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/session_deliveries_customer_ab3.sql b/models/generated/airbyte_ctes/unibag/session_deliveries_customer_ab3.sql new file mode 100644 index 0000000..dcaa602 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/session_deliveries_customer_ab3.sql @@ -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('session_deliveries_customer_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_session_deliveries_hashid', + '_id', + adapter.quote('name'), + 'phone', + ]) }} as _airbyte_customer_hashid, + tmp.* +from {{ ref('session_deliveries_customer_ab2') }} tmp +-- customer at session-deliveries/customer +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/session_deliveries_delivery_ab1.sql b/models/generated/airbyte_ctes/unibag/session_deliveries_delivery_ab1.sql new file mode 100644 index 0000000..eac3a7e --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/session_deliveries_delivery_ab1.sql @@ -0,0 +1,33 @@ +{{ 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('session_deliveries') }} +select + _airbyte_session_deliveries_hashid, + {{ json_extract_scalar('delivery', ['_id'], ['_id']) }} as _id, + {{ json_extract_scalar('delivery', ['fee'], ['fee']) }} as fee, + {{ json_extract_scalar('delivery', ['desc'], ['desc']) }} as {{ adapter.quote('desc') }}, + {{ json_extract_scalar('delivery', ['note'], ['note']) }} as note, + {{ json_extract_scalar('delivery', ['title'], ['title']) }} as title, + {{ json_extract('table_alias', 'delivery', ['feeShip'], ['feeShip']) }} as feeship, + {{ json_extract_scalar('delivery', ['currency'], ['currency']) }} as currency, + {{ json_extract_scalar('delivery', ['sourceId'], ['sourceId']) }} as sourceid, + {{ json_extract_scalar('delivery', ['courierName'], ['courierName']) }} as couriername, + {{ json_extract_scalar('delivery', ['serviceCode'], ['serviceCode']) }} as servicecode, + {{ json_extract_scalar('delivery', ['serviceName'], ['serviceName']) }} as servicename, + {{ json_extract_scalar('delivery', ['deliveryCode'], ['deliveryCode']) }} as deliverycode, + {{ json_extract_scalar('delivery', ['maxDeliveryDays'], ['maxDeliveryDays']) }} as maxdeliverydays, + {{ json_extract_scalar('delivery', ['minDeliveryDays'], ['minDeliveryDays']) }} as mindeliverydays, + {{ json_extract_scalar('delivery', ['realShippingFee'], ['realShippingFee']) }} as realshippingfee, + {{ json_extract_scalar('delivery', ['estimateTimeDelivery'], ['estimateTimeDelivery']) }} as estimatetimedelivery, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('session_deliveries') }} as table_alias +-- delivery at session-deliveries/delivery +where 1 = 1 +and delivery is not null + diff --git a/models/generated/airbyte_ctes/unibag/session_deliveries_delivery_ab2.sql b/models/generated/airbyte_ctes/unibag/session_deliveries_delivery_ab2.sql new file mode 100644 index 0000000..1e615ba --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/session_deliveries_delivery_ab2.sql @@ -0,0 +1,32 @@ +{{ 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('session_deliveries_delivery_ab1') }} +select + _airbyte_session_deliveries_hashid, + cast(_id as {{ dbt_utils.type_string() }}) as _id, + cast(fee as {{ dbt_utils.type_float() }}) as fee, + cast({{ adapter.quote('desc') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('desc') }}, + cast(note as {{ dbt_utils.type_string() }}) as note, + cast(title as {{ dbt_utils.type_string() }}) as title, + cast(feeship as {{ type_json() }}) as feeship, + cast(currency as {{ dbt_utils.type_string() }}) as currency, + cast(sourceid as {{ dbt_utils.type_float() }}) as sourceid, + cast(couriername as {{ dbt_utils.type_string() }}) as couriername, + cast(servicecode as {{ dbt_utils.type_string() }}) as servicecode, + cast(servicename as {{ dbt_utils.type_string() }}) as servicename, + cast(deliverycode as {{ dbt_utils.type_string() }}) as deliverycode, + cast(maxdeliverydays as {{ dbt_utils.type_float() }}) as maxdeliverydays, + cast(mindeliverydays as {{ dbt_utils.type_float() }}) as mindeliverydays, + cast(realshippingfee as {{ dbt_utils.type_float() }}) as realshippingfee, + cast(estimatetimedelivery as {{ dbt_utils.type_string() }}) as estimatetimedelivery, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('session_deliveries_delivery_ab1') }} +-- delivery at session-deliveries/delivery +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/session_deliveries_delivery_ab3.sql b/models/generated/airbyte_ctes/unibag/session_deliveries_delivery_ab3.sql new file mode 100644 index 0000000..1a61a67 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/session_deliveries_delivery_ab3.sql @@ -0,0 +1,32 @@ +{{ 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('session_deliveries_delivery_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_session_deliveries_hashid', + '_id', + 'fee', + adapter.quote('desc'), + 'note', + 'title', + object_to_string('feeship'), + 'currency', + 'sourceid', + 'couriername', + 'servicecode', + 'servicename', + 'deliverycode', + 'maxdeliverydays', + 'mindeliverydays', + 'realshippingfee', + 'estimatetimedelivery', + ]) }} as _airbyte_delivery_hashid, + tmp.* +from {{ ref('session_deliveries_delivery_ab2') }} tmp +-- delivery at session-deliveries/delivery +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/session_deliveries_delivery_feeship_ab1.sql b/models/generated/airbyte_ctes/unibag/session_deliveries_delivery_feeship_ab1.sql new file mode 100644 index 0000000..4f72d29 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/session_deliveries_delivery_feeship_ab1.sql @@ -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('session_deliveries_delivery') }} +select + _airbyte_delivery_hashid, + {{ json_extract_scalar('feeship', ['cod'], ['cod']) }} as cod, + {{ json_extract_scalar('feeship', ['total'], ['total']) }} as total, + {{ json_extract_scalar('feeship', ['shipping'], ['shipping']) }} as shipping, + {{ json_extract_scalar('feeship', ['insurance'], ['insurance']) }} as insurance, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('session_deliveries_delivery') }} as table_alias +-- feeship at session-deliveries/delivery/feeShip +where 1 = 1 +and feeship is not null + diff --git a/models/generated/airbyte_ctes/unibag/session_deliveries_delivery_feeship_ab2.sql b/models/generated/airbyte_ctes/unibag/session_deliveries_delivery_feeship_ab2.sql new file mode 100644 index 0000000..c2dfad9 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/session_deliveries_delivery_feeship_ab2.sql @@ -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('session_deliveries_delivery_feeship_ab1') }} +select + _airbyte_delivery_hashid, + cast(cod as {{ dbt_utils.type_float() }}) as cod, + cast(total as {{ dbt_utils.type_float() }}) as total, + cast(shipping as {{ dbt_utils.type_float() }}) as shipping, + cast(insurance as {{ dbt_utils.type_float() }}) as insurance, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('session_deliveries_delivery_feeship_ab1') }} +-- feeship at session-deliveries/delivery/feeShip +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/session_deliveries_delivery_feeship_ab3.sql b/models/generated/airbyte_ctes/unibag/session_deliveries_delivery_feeship_ab3.sql new file mode 100644 index 0000000..84a537d --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/session_deliveries_delivery_feeship_ab3.sql @@ -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('session_deliveries_delivery_feeship_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_delivery_hashid', + 'cod', + 'total', + 'shipping', + 'insurance', + ]) }} as _airbyte_feeship_hashid, + tmp.* +from {{ ref('session_deliveries_delivery_feeship_ab2') }} tmp +-- feeship at session-deliveries/delivery/feeShip +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/session_deliveries_location_ab1.sql b/models/generated/airbyte_ctes/unibag/session_deliveries_location_ab1.sql new file mode 100644 index 0000000..02f5024 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/session_deliveries_location_ab1.sql @@ -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('session_deliveries') }} +select + _airbyte_session_deliveries_hashid, + {{ json_extract_scalar(adapter.quote('location'), ['_id'], ['_id']) }} as _id, + {{ 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_scalar(adapter.quote('location'), ['province'], ['province']) }} as province, + {{ json_extract_scalar(adapter.quote('location'), ['fullAddress'], ['fullAddress']) }} as fulladdress, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('session_deliveries') }} as table_alias +-- location at session-deliveries/location +where 1 = 1 +and {{ adapter.quote('location') }} is not null + diff --git a/models/generated/airbyte_ctes/unibag/session_deliveries_location_ab2.sql b/models/generated/airbyte_ctes/unibag/session_deliveries_location_ab2.sql new file mode 100644 index 0000000..d702f19 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/session_deliveries_location_ab2.sql @@ -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('session_deliveries_location_ab1') }} +select + _airbyte_session_deliveries_hashid, + cast(_id as {{ dbt_utils.type_string() }}) as _id, + cast(ward as {{ dbt_utils.type_float() }}) as ward, + cast(address as {{ dbt_utils.type_string() }}) as address, + cast(district as {{ dbt_utils.type_float() }}) as district, + cast(province as {{ dbt_utils.type_float() }}) as province, + cast(fulladdress as {{ dbt_utils.type_string() }}) as fulladdress, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('session_deliveries_location_ab1') }} +-- location at session-deliveries/location +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/session_deliveries_location_ab3.sql b/models/generated/airbyte_ctes/unibag/session_deliveries_location_ab3.sql new file mode 100644 index 0000000..a54f604 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/session_deliveries_location_ab3.sql @@ -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('session_deliveries_location_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_session_deliveries_hashid', + '_id', + 'ward', + 'address', + 'district', + 'province', + 'fulladdress', + ]) }} as _airbyte_location_hashid, + tmp.* +from {{ ref('session_deliveries_location_ab2') }} tmp +-- location at session-deliveries/location +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/session_deliveries_promotion_ab1.sql b/models/generated/airbyte_ctes/unibag/session_deliveries_promotion_ab1.sql new file mode 100644 index 0000000..8c63cee --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/session_deliveries_promotion_ab1.sql @@ -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('session_deliveries') }} +select + _airbyte_session_deliveries_hashid, + {{ json_extract_scalar('promotion', ['type'], ['type']) }} as {{ adapter.quote('type') }}, + {{ json_extract_scalar('promotion', ['discount'], ['discount']) }} as discount, + {{ json_extract_scalar('promotion', ['isApplied'], ['isApplied']) }} as isapplied, + {{ json_extract_scalar('promotion', ['minOrderValue'], ['minOrderValue']) }} as minordervalue, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('session_deliveries') }} as table_alias +-- promotion at session-deliveries/promotion +where 1 = 1 +and promotion is not null + diff --git a/models/generated/airbyte_ctes/unibag/session_deliveries_promotion_ab2.sql b/models/generated/airbyte_ctes/unibag/session_deliveries_promotion_ab2.sql new file mode 100644 index 0000000..4f0a8bf --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/session_deliveries_promotion_ab2.sql @@ -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('session_deliveries_promotion_ab1') }} +select + _airbyte_session_deliveries_hashid, + cast({{ adapter.quote('type') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('type') }}, + cast(discount as {{ dbt_utils.type_float() }}) as discount, + {{ cast_to_boolean('isapplied') }} as isapplied, + cast(minordervalue as {{ dbt_utils.type_float() }}) as minordervalue, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('session_deliveries_promotion_ab1') }} +-- promotion at session-deliveries/promotion +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/session_deliveries_promotion_ab3.sql b/models/generated/airbyte_ctes/unibag/session_deliveries_promotion_ab3.sql new file mode 100644 index 0000000..9411be1 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/session_deliveries_promotion_ab3.sql @@ -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('session_deliveries_promotion_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_session_deliveries_hashid', + adapter.quote('type'), + 'discount', + boolean_to_string('isapplied'), + 'minordervalue', + ]) }} as _airbyte_promotion_hashid, + tmp.* +from {{ ref('session_deliveries_promotion_ab2') }} tmp +-- promotion at session-deliveries/promotion +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/session_deliveries_request_ab1.sql b/models/generated/airbyte_ctes/unibag/session_deliveries_request_ab1.sql new file mode 100644 index 0000000..7177427 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/session_deliveries_request_ab1.sql @@ -0,0 +1,27 @@ +{{ 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('session_deliveries') }} +select + _airbyte_session_deliveries_hashid, + {{ json_extract('table_alias', 'request', ['to'], ['to']) }} as {{ adapter.quote('to') }}, + {{ json_extract('table_alias', 'request', ['from'], ['from']) }} as {{ adapter.quote('from') }}, + {{ json_extract_array('request', ['items'], ['items']) }} as items, + {{ json_extract_scalar('request', ['checksum'], ['checksum']) }} as checksum, + {{ json_extract_scalar('request', ['codAmount'], ['codAmount']) }} as codamount, + {{ json_extract_scalar('request', ['orderCode'], ['orderCode']) }} as ordercode, + {{ json_extract_scalar('request', ['restockAt'], ['restockAt']) }} as restockat, + {{ json_extract_scalar('request', ['isPreorder'], ['isPreorder']) }} as ispreorder, + {{ json_extract_scalar('request', ['totalAmount'], ['totalAmount']) }} as totalamount, + {{ json_extract_scalar('request', ['paymentMethod'], ['paymentMethod']) }} as paymentmethod, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('session_deliveries') }} as table_alias +-- request at session-deliveries/request +where 1 = 1 +and request is not null + diff --git a/models/generated/airbyte_ctes/unibag/session_deliveries_request_ab2.sql b/models/generated/airbyte_ctes/unibag/session_deliveries_request_ab2.sql new file mode 100644 index 0000000..bc19197 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/session_deliveries_request_ab2.sql @@ -0,0 +1,26 @@ +{{ 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('session_deliveries_request_ab1') }} +select + _airbyte_session_deliveries_hashid, + cast({{ adapter.quote('to') }} as {{ type_json() }}) as {{ adapter.quote('to') }}, + cast({{ adapter.quote('from') }} as {{ type_json() }}) as {{ adapter.quote('from') }}, + items, + cast(checksum as {{ dbt_utils.type_string() }}) as checksum, + cast(codamount as {{ dbt_utils.type_float() }}) as codamount, + cast(ordercode as {{ dbt_utils.type_string() }}) as ordercode, + cast(restockat as {{ dbt_utils.type_string() }}) as restockat, + {{ cast_to_boolean('ispreorder') }} as ispreorder, + cast(totalamount as {{ dbt_utils.type_float() }}) as totalamount, + cast(paymentmethod as {{ dbt_utils.type_string() }}) as paymentmethod, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('session_deliveries_request_ab1') }} +-- request at session-deliveries/request +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/session_deliveries_request_ab3.sql b/models/generated/airbyte_ctes/unibag/session_deliveries_request_ab3.sql new file mode 100644 index 0000000..fa7ce53 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/session_deliveries_request_ab3.sql @@ -0,0 +1,26 @@ +{{ 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('session_deliveries_request_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_session_deliveries_hashid', + object_to_string(adapter.quote('to')), + object_to_string(adapter.quote('from')), + array_to_string('items'), + 'checksum', + 'codamount', + 'ordercode', + 'restockat', + boolean_to_string('ispreorder'), + 'totalamount', + 'paymentmethod', + ]) }} as _airbyte_request_hashid, + tmp.* +from {{ ref('session_deliveries_request_ab2') }} tmp +-- request at session-deliveries/request +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/session_deliveries_request_from_ab1.sql b/models/generated/airbyte_ctes/unibag/session_deliveries_request_from_ab1.sql new file mode 100644 index 0000000..e95b5de --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/session_deliveries_request_from_ab1.sql @@ -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('session_deliveries_request') }} +select + _airbyte_request_hashid, + {{ json_extract_scalar(adapter.quote('from'), ['userId'], ['userId']) }} as userid, + {{ json_extract_scalar(adapter.quote('from'), ['warehouseId'], ['warehouseId']) }} as warehouseid, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('session_deliveries_request') }} as table_alias +-- from at session-deliveries/request/from +where 1 = 1 +and {{ adapter.quote('from') }} is not null + diff --git a/models/generated/airbyte_ctes/unibag/session_deliveries_request_from_ab2.sql b/models/generated/airbyte_ctes/unibag/session_deliveries_request_from_ab2.sql new file mode 100644 index 0000000..a99524e --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/session_deliveries_request_from_ab2.sql @@ -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('session_deliveries_request_from_ab1') }} +select + _airbyte_request_hashid, + cast(userid as {{ dbt_utils.type_string() }}) as userid, + cast(warehouseid as {{ dbt_utils.type_string() }}) as warehouseid, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('session_deliveries_request_from_ab1') }} +-- from at session-deliveries/request/from +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/session_deliveries_request_from_ab3.sql b/models/generated/airbyte_ctes/unibag/session_deliveries_request_from_ab3.sql new file mode 100644 index 0000000..fcd2b83 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/session_deliveries_request_from_ab3.sql @@ -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('session_deliveries_request_from_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_request_hashid', + 'userid', + 'warehouseid', + ]) }} as _airbyte_from_hashid, + tmp.* +from {{ ref('session_deliveries_request_from_ab2') }} tmp +-- from at session-deliveries/request/from +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/session_deliveries_request_to_ab1.sql b/models/generated/airbyte_ctes/unibag/session_deliveries_request_to_ab1.sql new file mode 100644 index 0000000..a299714 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/session_deliveries_request_to_ab1.sql @@ -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('session_deliveries_request') }} +select + _airbyte_request_hashid, + {{ json_extract_scalar(adapter.quote('to'), ['name'], ['name']) }} as {{ adapter.quote('name') }}, + {{ json_extract_scalar(adapter.quote('to'), ['phone'], ['phone']) }} as phone, + {{ json_extract('table_alias', adapter.quote('to'), ['location'], ['location']) }} as {{ adapter.quote('location') }}, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('session_deliveries_request') }} as table_alias +-- to at session-deliveries/request/to +where 1 = 1 +and {{ adapter.quote('to') }} is not null + diff --git a/models/generated/airbyte_ctes/unibag/session_deliveries_request_to_ab2.sql b/models/generated/airbyte_ctes/unibag/session_deliveries_request_to_ab2.sql new file mode 100644 index 0000000..d1c4b09 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/session_deliveries_request_to_ab2.sql @@ -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('session_deliveries_request_to_ab1') }} +select + _airbyte_request_hashid, + cast({{ adapter.quote('name') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('name') }}, + cast(phone as {{ dbt_utils.type_string() }}) as phone, + cast({{ adapter.quote('location') }} as {{ type_json() }}) as {{ adapter.quote('location') }}, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('session_deliveries_request_to_ab1') }} +-- to at session-deliveries/request/to +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/session_deliveries_request_to_ab3.sql b/models/generated/airbyte_ctes/unibag/session_deliveries_request_to_ab3.sql new file mode 100644 index 0000000..31c07b9 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/session_deliveries_request_to_ab3.sql @@ -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('session_deliveries_request_to_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_request_hashid', + adapter.quote('name'), + 'phone', + object_to_string(adapter.quote('location')), + ]) }} as _airbyte_to_hashid, + tmp.* +from {{ ref('session_deliveries_request_to_ab2') }} tmp +-- to at session-deliveries/request/to +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/session_deliveries_request_to_location_ab1.sql b/models/generated/airbyte_ctes/unibag/session_deliveries_request_to_location_ab1.sql new file mode 100644 index 0000000..ae3e1c1 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/session_deliveries_request_to_location_ab1.sql @@ -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('session_deliveries_request_to') }} +select + _airbyte_to_hashid, + {{ json_extract_scalar(adapter.quote('location'), ['address'], ['address']) }} as address, + {{ json_extract_scalar(adapter.quote('location'), ['wardCode'], ['wardCode']) }} as wardcode, + {{ json_extract_scalar(adapter.quote('location'), ['districtCode'], ['districtCode']) }} as districtcode, + {{ json_extract_scalar(adapter.quote('location'), ['provinceCode'], ['provinceCode']) }} as provincecode, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('session_deliveries_request_to') }} as table_alias +-- location at session-deliveries/request/to/location +where 1 = 1 +and {{ adapter.quote('location') }} is not null + diff --git a/models/generated/airbyte_ctes/unibag/session_deliveries_request_to_location_ab2.sql b/models/generated/airbyte_ctes/unibag/session_deliveries_request_to_location_ab2.sql new file mode 100644 index 0000000..54bf1fa --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/session_deliveries_request_to_location_ab2.sql @@ -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('session_deliveries_request_to_location_ab1') }} +select + _airbyte_to_hashid, + cast(address as {{ dbt_utils.type_string() }}) as address, + cast(wardcode as {{ dbt_utils.type_float() }}) as wardcode, + cast(districtcode as {{ dbt_utils.type_float() }}) as districtcode, + cast(provincecode as {{ dbt_utils.type_float() }}) as provincecode, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('session_deliveries_request_to_location_ab1') }} +-- location at session-deliveries/request/to/location +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/session_deliveries_request_to_location_ab3.sql b/models/generated/airbyte_ctes/unibag/session_deliveries_request_to_location_ab3.sql new file mode 100644 index 0000000..8b99d10 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/session_deliveries_request_to_location_ab3.sql @@ -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('session_deliveries_request_to_location_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_to_hashid', + 'address', + 'wardcode', + 'districtcode', + 'provincecode', + ]) }} as _airbyte_location_hashid, + tmp.* +from {{ ref('session_deliveries_request_to_location_ab2') }} tmp +-- location at session-deliveries/request/to/location +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/social_posts_ab1.sql b/models/generated/airbyte_ctes/unibag/social_posts_ab1.sql index 9aad28d..e521a89 100644 --- a/models/generated/airbyte_ctes/unibag/social_posts_ab1.sql +++ b/models/generated/airbyte_ctes/unibag/social_posts_ab1.sql @@ -24,7 +24,7 @@ select {{ json_extract_array('_airbyte_data', ['products'], ['products']) }} as products, {{ json_extract_scalar('_airbyte_data', ['createdAt'], ['createdAt']) }} as createdat, {{ json_extract_scalar('_airbyte_data', ['hasUpdate'], ['hasUpdate']) }} as hasupdate, - {{ 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_array('_airbyte_data', ['categories'], ['categories']) }} as categories, {{ json_extract_scalar('_airbyte_data', ['fromSystem'], ['fromSystem']) }} as fromsystem, @@ -32,7 +32,7 @@ select {{ json_extract_scalar('_airbyte_data', ['publishedAt'], ['publishedAt']) }} as publishedat, {{ json_extract_scalar('_airbyte_data', ['searchString'], ['searchString']) }} as searchstring, {{ json_extract_scalar('_airbyte_data', ['updatedCount'], ['updatedCount']) }} as updatedcount, - {{ json_extract_scalar('_airbyte_data', ['shareStatistic'], ['shareStatistic']) }} as sharestatistic, + {{ json_extract('table_alias', '_airbyte_data', ['shareStatistic'], ['shareStatistic']) }} as sharestatistic, {{ json_extract_scalar('_airbyte_data', ['enableNotificationForContributor'], ['enableNotificationForContributor']) }} as enablenotificationforcontributor, _airbyte_ab_id, _airbyte_emitted_at, diff --git a/models/generated/airbyte_ctes/unibag/social_posts_ab2.sql b/models/generated/airbyte_ctes/unibag/social_posts_ab2.sql index 7300f1b..9b97e92 100644 --- a/models/generated/airbyte_ctes/unibag/social_posts_ab2.sql +++ b/models/generated/airbyte_ctes/unibag/social_posts_ab2.sql @@ -24,7 +24,7 @@ select products, cast(createdat as {{ dbt_utils.type_string() }}) as createdat, {{ cast_to_boolean('hasupdate') }} as hasupdate, - 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, categories, {{ cast_to_boolean('fromsystem') }} as fromsystem, @@ -32,7 +32,7 @@ select cast(publishedat as {{ dbt_utils.type_string() }}) as publishedat, cast(searchstring as {{ dbt_utils.type_string() }}) as searchstring, cast(updatedcount as {{ dbt_utils.type_float() }}) as updatedcount, - cast(sharestatistic as {{ dbt_utils.type_string() }}) as sharestatistic, + cast(sharestatistic as {{ type_json() }}) as sharestatistic, {{ cast_to_boolean('enablenotificationforcontributor') }} as enablenotificationforcontributor, _airbyte_ab_id, _airbyte_emitted_at, diff --git a/models/generated/airbyte_ctes/unibag/social_posts_ab3.sql b/models/generated/airbyte_ctes/unibag/social_posts_ab3.sql index 5b932f4..f887b65 100644 --- a/models/generated/airbyte_ctes/unibag/social_posts_ab3.sql +++ b/models/generated/airbyte_ctes/unibag/social_posts_ab3.sql @@ -25,7 +25,7 @@ select array_to_string('products'), 'createdat', boolean_to_string('hasupdate'), - 'statistic', + object_to_string('statistic'), 'updatedat', array_to_string('categories'), boolean_to_string('fromsystem'), @@ -33,7 +33,7 @@ select 'publishedat', 'searchstring', 'updatedcount', - 'sharestatistic', + object_to_string('sharestatistic'), boolean_to_string('enablenotificationforcontributor'), ]) }} as _airbyte_social_posts_hashid, tmp.* diff --git a/models/generated/airbyte_ctes/unibag/social_posts_sharestatistic_ab1.sql b/models/generated/airbyte_ctes/unibag/social_posts_sharestatistic_ab1.sql new file mode 100644 index 0000000..4892f5f --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/social_posts_sharestatistic_ab1.sql @@ -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('social_posts') }} +select + _airbyte_social_posts_hashid, + {{ json_extract_scalar('sharestatistic', ['totalShare'], ['totalShare']) }} as totalshare, + {{ json_extract_scalar('sharestatistic', ['totalShareFromSocialPost'], ['totalShareFromSocialPost']) }} as totalsharefromsocialpost, + {{ json_extract_scalar('sharestatistic', ['totalShareFromProductDetail'], ['totalShareFromProductDetail']) }} as totalsharefromproductdetail, + {{ json_extract_scalar('sharestatistic', ['totalUniqueShareFromSocialPost'], ['totalUniqueShareFromSocialPost']) }} as totaluniquesharefromsocialpost, + {{ json_extract_scalar('sharestatistic', ['totalUniqueShareFromProductDetail'], ['totalUniqueShareFromProductDetail']) }} as totaluniquesharefromproductdetail, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('social_posts') }} as table_alias +-- sharestatistic at social-posts/shareStatistic +where 1 = 1 +and sharestatistic is not null + diff --git a/models/generated/airbyte_ctes/unibag/social_posts_sharestatistic_ab2.sql b/models/generated/airbyte_ctes/unibag/social_posts_sharestatistic_ab2.sql new file mode 100644 index 0000000..468832b --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/social_posts_sharestatistic_ab2.sql @@ -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('social_posts_sharestatistic_ab1') }} +select + _airbyte_social_posts_hashid, + cast(totalshare as {{ dbt_utils.type_float() }}) as totalshare, + cast(totalsharefromsocialpost as {{ dbt_utils.type_float() }}) as totalsharefromsocialpost, + cast(totalsharefromproductdetail as {{ dbt_utils.type_float() }}) as totalsharefromproductdetail, + cast(totaluniquesharefromsocialpost as {{ dbt_utils.type_float() }}) as totaluniquesharefromsocialpost, + cast(totaluniquesharefromproductdetail as {{ dbt_utils.type_float() }}) as totaluniquesharefromproductdetail, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('social_posts_sharestatistic_ab1') }} +-- sharestatistic at social-posts/shareStatistic +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/social_posts_sharestatistic_ab3.sql b/models/generated/airbyte_ctes/unibag/social_posts_sharestatistic_ab3.sql new file mode 100644 index 0000000..a3da3eb --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/social_posts_sharestatistic_ab3.sql @@ -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('social_posts_sharestatistic_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_social_posts_hashid', + 'totalshare', + 'totalsharefromsocialpost', + 'totalsharefromproductdetail', + 'totaluniquesharefromsocialpost', + 'totaluniquesharefromproductdetail', + ]) }} as _airbyte_sharestatistic_hashid, + tmp.* +from {{ ref('social_posts_sharestatistic_ab2') }} tmp +-- sharestatistic at social-posts/shareStatistic +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/social_posts_statistic_ab1.sql b/models/generated/airbyte_ctes/unibag/social_posts_statistic_ab1.sql new file mode 100644 index 0000000..bbdca5c --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/social_posts_statistic_ab1.sql @@ -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('social_posts') }} +select + _airbyte_social_posts_hashid, + {{ json_extract_scalar('statistic', ['likes'], ['likes']) }} as likes, + {{ json_extract_scalar('statistic', ['views'], ['views']) }} as {{ adapter.quote('views') }}, + {{ json_extract_scalar('statistic', ['comments'], ['comments']) }} as {{ adapter.quote('comments') }}, + {{ json_extract_scalar('statistic', ['uniqueViews'], ['uniqueViews']) }} as uniqueviews, + {{ json_extract_scalar('statistic', ['shares_aibyte_transform'], ['shares_aibyte_transform']) }} as shares_aibyte_transform, + {{ json_extract_scalar('statistic', ['uniqueShares_aibyte_transform'], ['uniqueShares_aibyte_transform']) }} as uniqueshares_aibyte_transform, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('social_posts') }} as table_alias +-- statistic at social-posts/statistic +where 1 = 1 +and statistic is not null + diff --git a/models/generated/airbyte_ctes/unibag/social_posts_statistic_ab2.sql b/models/generated/airbyte_ctes/unibag/social_posts_statistic_ab2.sql new file mode 100644 index 0000000..cf65e47 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/social_posts_statistic_ab2.sql @@ -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('social_posts_statistic_ab1') }} +select + _airbyte_social_posts_hashid, + cast(likes as {{ dbt_utils.type_float() }}) as likes, + cast({{ adapter.quote('views') }} as {{ dbt_utils.type_float() }}) as {{ adapter.quote('views') }}, + cast({{ adapter.quote('comments') }} as {{ dbt_utils.type_float() }}) as {{ adapter.quote('comments') }}, + cast(uniqueviews as {{ dbt_utils.type_float() }}) as uniqueviews, + cast(shares_aibyte_transform as {{ dbt_utils.type_string() }}) as shares_aibyte_transform, + cast(uniqueshares_aibyte_transform as {{ dbt_utils.type_string() }}) as uniqueshares_aibyte_transform, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('social_posts_statistic_ab1') }} +-- statistic at social-posts/statistic +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/social_posts_statistic_ab3.sql b/models/generated/airbyte_ctes/unibag/social_posts_statistic_ab3.sql new file mode 100644 index 0000000..1131762 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/social_posts_statistic_ab3.sql @@ -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('social_posts_statistic_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_social_posts_hashid', + 'likes', + adapter.quote('views'), + adapter.quote('comments'), + 'uniqueviews', + 'shares_aibyte_transform', + 'uniqueshares_aibyte_transform', + ]) }} as _airbyte_statistic_hashid, + tmp.* +from {{ ref('social_posts_statistic_ab2') }} tmp +-- statistic at social-posts/statistic +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/suppliers_ab1.sql b/models/generated/airbyte_ctes/unibag/suppliers_ab1.sql index eea9006..658d280 100644 --- a/models/generated/airbyte_ctes/unibag/suppliers_ab1.sql +++ b/models/generated/airbyte_ctes/unibag/suppliers_ab1.sql @@ -9,24 +9,26 @@ select {{ json_extract_scalar('_airbyte_data', ['_id'], ['_id']) }} as _id, {{ json_extract_scalar('_airbyte_data', ['tax'], ['tax']) }} as tax, - {{ json_extract_scalar('_airbyte_data', ['bank'], ['bank']) }} as bank, - {{ json_extract_scalar('_airbyte_data', ['logo'], ['logo']) }} as logo, + {{ json_extract('table_alias', '_airbyte_data', ['bank'], ['bank']) }} as bank, + {{ json_extract('table_alias', '_airbyte_data', ['logo'], ['logo']) }} as logo, {{ json_extract_scalar('_airbyte_data', ['name'], ['name']) }} as {{ adapter.quote('name') }}, {{ json_extract_scalar('_airbyte_data', ['active'], ['active']) }} as active, + {{ json_extract('table_alias', '_airbyte_data', ['balance'], ['balance']) }} as balance, {{ json_extract_scalar('_airbyte_data', ['checkSum'], ['checkSum']) }} as checksum, {{ json_extract_scalar('_airbyte_data', ['checksum'], ['checksum']) }} as checksum_1, - {{ 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_array('_airbyte_data', ['contracts'], ['contracts']) }} as contracts, {{ json_extract_scalar('_airbyte_data', ['createdAt'], ['createdAt']) }} as createdat, {{ json_extract_array('_airbyte_data', ['documents'], ['documents']) }} as documents, - {{ 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_array('_airbyte_data', ['categories'], ['categories']) }} as categories, {{ json_extract_array('_airbyte_data', ['inventories'], ['inventories']) }} as inventories, {{ json_extract_scalar('_airbyte_data', ['identifyCode'], ['identifyCode']) }} as identifycode, {{ json_extract_scalar('_airbyte_data', ['searchString'], ['searchString']) }} as searchstring, + {{ json_extract_array('_airbyte_data', ['reconcileDays'], ['reconcileDays']) }} as reconciledays, {{ json_extract_scalar('_airbyte_data', ['contractNumber'], ['contractNumber']) }} as contractnumber, - {{ json_extract_scalar('_airbyte_data', ['reviewStatistic'], ['reviewStatistic']) }} as reviewstatistic, + {{ json_extract('table_alias', '_airbyte_data', ['reviewStatistic'], ['reviewStatistic']) }} as reviewstatistic, {{ json_extract_scalar('_airbyte_data', ['contractSignedAt'], ['contractSignedAt']) }} as contractsignedat, {{ json_extract_array('_airbyte_data', ['emailForInvoices'], ['emailForInvoices']) }} as emailforinvoices, {{ json_extract_scalar('_airbyte_data', ['contractExpiredAt'], ['contractExpiredAt']) }} as contractexpiredat, diff --git a/models/generated/airbyte_ctes/unibag/suppliers_ab2.sql b/models/generated/airbyte_ctes/unibag/suppliers_ab2.sql index 59199cb..8df28c4 100644 --- a/models/generated/airbyte_ctes/unibag/suppliers_ab2.sql +++ b/models/generated/airbyte_ctes/unibag/suppliers_ab2.sql @@ -9,24 +9,26 @@ select cast(_id as {{ dbt_utils.type_string() }}) as _id, cast(tax as {{ dbt_utils.type_string() }}) as tax, - cast(bank as {{ dbt_utils.type_string() }}) as bank, - cast(logo as {{ dbt_utils.type_string() }}) as logo, + cast(bank as {{ type_json() }}) as bank, + cast(logo as {{ type_json() }}) as logo, cast({{ adapter.quote('name') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('name') }}, {{ cast_to_boolean('active') }} as active, + cast(balance as {{ type_json() }}) as balance, cast(checksum as {{ dbt_utils.type_string() }}) as checksum, cast(checksum_1 as {{ dbt_utils.type_string() }}) as checksum_1, - cast({{ adapter.quote('location') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('location') }}, + cast({{ adapter.quote('location') }} as {{ type_json() }}) as {{ adapter.quote('location') }}, contracts, cast(createdat as {{ dbt_utils.type_string() }}) as createdat, documents, - 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, categories, inventories, cast(identifycode as {{ dbt_utils.type_float() }}) as identifycode, cast(searchstring as {{ dbt_utils.type_string() }}) as searchstring, + reconciledays, cast(contractnumber as {{ dbt_utils.type_string() }}) as contractnumber, - cast(reviewstatistic as {{ dbt_utils.type_string() }}) as reviewstatistic, + cast(reviewstatistic as {{ type_json() }}) as reviewstatistic, cast(contractsignedat as {{ dbt_utils.type_string() }}) as contractsignedat, emailforinvoices, cast(contractexpiredat as {{ dbt_utils.type_string() }}) as contractexpiredat, diff --git a/models/generated/airbyte_ctes/unibag/suppliers_ab3.sql b/models/generated/airbyte_ctes/unibag/suppliers_ab3.sql index 76f1c42..63b71a9 100644 --- a/models/generated/airbyte_ctes/unibag/suppliers_ab3.sql +++ b/models/generated/airbyte_ctes/unibag/suppliers_ab3.sql @@ -10,24 +10,26 @@ select {{ dbt_utils.surrogate_key([ '_id', 'tax', - 'bank', - 'logo', + object_to_string('bank'), + object_to_string('logo'), adapter.quote('name'), boolean_to_string('active'), + object_to_string('balance'), 'checksum', 'checksum_1', - adapter.quote('location'), + object_to_string(adapter.quote('location')), array_to_string('contracts'), 'createdat', array_to_string('documents'), - 'statistic', + object_to_string('statistic'), 'updatedat', array_to_string('categories'), array_to_string('inventories'), 'identifycode', 'searchstring', + array_to_string('reconciledays'), 'contractnumber', - 'reviewstatistic', + object_to_string('reviewstatistic'), 'contractsignedat', array_to_string('emailforinvoices'), 'contractexpiredat', diff --git a/models/generated/airbyte_ctes/unibag/suppliers_balance_ab1.sql b/models/generated/airbyte_ctes/unibag/suppliers_balance_ab1.sql new file mode 100644 index 0000000..55baaee --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/suppliers_balance_ab1.sql @@ -0,0 +1,26 @@ +{{ 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('suppliers') }} +select + _airbyte_suppliers_hashid, + {{ json_extract_scalar('balance', ['currentCash'], ['currentCash']) }} as currentcash, + {{ json_extract_scalar('balance', ['orderPendingCash'], ['orderPendingCash']) }} as orderpendingcash, + {{ json_extract_scalar('balance', ['totalPendingCash'], ['totalPendingCash']) }} as totalpendingcash, + {{ json_extract_scalar('balance', ['withdrawRejectCash'], ['withdrawRejectCash']) }} as withdrawrejectcash, + {{ json_extract_scalar('balance', ['orderReconciledCash'], ['orderReconciledCash']) }} as orderreconciledcash, + {{ json_extract_scalar('balance', ['withdrawPendingCash'], ['withdrawPendingCash']) }} as withdrawpendingcash, + {{ json_extract_scalar('balance', ['withdrawSuccessCash'], ['withdrawSuccessCash']) }} as withdrawsuccesscash, + {{ json_extract_scalar('balance', ['changeBalanceRequestApproved'], ['changeBalanceRequestApproved']) }} as changebalancerequestapproved, + {{ json_extract_scalar('balance', ['orderWaitingForReconcileCash'], ['orderWaitingForReconcileCash']) }} as orderwaitingforreconcilecash, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('suppliers') }} as table_alias +-- balance at suppliers/balance +where 1 = 1 +and balance is not null + diff --git a/models/generated/airbyte_ctes/unibag/suppliers_balance_ab2.sql b/models/generated/airbyte_ctes/unibag/suppliers_balance_ab2.sql new file mode 100644 index 0000000..69bc3d6 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/suppliers_balance_ab2.sql @@ -0,0 +1,25 @@ +{{ 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('suppliers_balance_ab1') }} +select + _airbyte_suppliers_hashid, + cast(currentcash as {{ dbt_utils.type_float() }}) as currentcash, + cast(orderpendingcash as {{ dbt_utils.type_float() }}) as orderpendingcash, + cast(totalpendingcash as {{ dbt_utils.type_float() }}) as totalpendingcash, + cast(withdrawrejectcash as {{ dbt_utils.type_float() }}) as withdrawrejectcash, + cast(orderreconciledcash as {{ dbt_utils.type_float() }}) as orderreconciledcash, + cast(withdrawpendingcash as {{ dbt_utils.type_float() }}) as withdrawpendingcash, + cast(withdrawsuccesscash as {{ dbt_utils.type_float() }}) as withdrawsuccesscash, + cast(changebalancerequestapproved as {{ dbt_utils.type_float() }}) as changebalancerequestapproved, + cast(orderwaitingforreconcilecash as {{ dbt_utils.type_float() }}) as orderwaitingforreconcilecash, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('suppliers_balance_ab1') }} +-- balance at suppliers/balance +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/suppliers_balance_ab3.sql b/models/generated/airbyte_ctes/unibag/suppliers_balance_ab3.sql new file mode 100644 index 0000000..f7ebd9d --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/suppliers_balance_ab3.sql @@ -0,0 +1,25 @@ +{{ 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('suppliers_balance_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_suppliers_hashid', + 'currentcash', + 'orderpendingcash', + 'totalpendingcash', + 'withdrawrejectcash', + 'orderreconciledcash', + 'withdrawpendingcash', + 'withdrawsuccesscash', + 'changebalancerequestapproved', + 'orderwaitingforreconcilecash', + ]) }} as _airbyte_balance_hashid, + tmp.* +from {{ ref('suppliers_balance_ab2') }} tmp +-- balance at suppliers/balance +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/suppliers_bank_ab1.sql b/models/generated/airbyte_ctes/unibag/suppliers_bank_ab1.sql new file mode 100644 index 0000000..d2967e5 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/suppliers_bank_ab1.sql @@ -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('suppliers') }} +select + _airbyte_suppliers_hashid, + {{ json_extract_scalar('bank', ['bank'], ['bank']) }} as bank, + {{ json_extract_scalar('bank', ['branch'], ['branch']) }} as branch, + {{ json_extract_scalar('bank', ['cardNumber'], ['cardNumber']) }} as cardnumber, + {{ json_extract_scalar('bank', ['cardHolderName'], ['cardHolderName']) }} as cardholdername, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('suppliers') }} as table_alias +-- bank at suppliers/bank +where 1 = 1 +and bank is not null + diff --git a/models/generated/airbyte_ctes/unibag/suppliers_bank_ab2.sql b/models/generated/airbyte_ctes/unibag/suppliers_bank_ab2.sql new file mode 100644 index 0000000..82fc0f9 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/suppliers_bank_ab2.sql @@ -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('suppliers_bank_ab1') }} +select + _airbyte_suppliers_hashid, + cast(bank as {{ dbt_utils.type_string() }}) as bank, + cast(branch as {{ dbt_utils.type_string() }}) as branch, + cast(cardnumber as {{ dbt_utils.type_string() }}) as cardnumber, + cast(cardholdername as {{ dbt_utils.type_string() }}) as cardholdername, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('suppliers_bank_ab1') }} +-- bank at suppliers/bank +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/suppliers_bank_ab3.sql b/models/generated/airbyte_ctes/unibag/suppliers_bank_ab3.sql new file mode 100644 index 0000000..b95d98f --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/suppliers_bank_ab3.sql @@ -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('suppliers_bank_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_suppliers_hashid', + 'bank', + 'branch', + 'cardnumber', + 'cardholdername', + ]) }} as _airbyte_bank_hashid, + tmp.* +from {{ ref('suppliers_bank_ab2') }} tmp +-- bank at suppliers/bank +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/suppliers_location_ab1.sql b/models/generated/airbyte_ctes/unibag/suppliers_location_ab1.sql new file mode 100644 index 0000000..161bc8a --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/suppliers_location_ab1.sql @@ -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('suppliers') }} +select + _airbyte_suppliers_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_scalar(adapter.quote('location'), ['location'], ['location']) }} as {{ adapter.quote('location') }}, + {{ json_extract_scalar(adapter.quote('location'), ['province'], ['province']) }} as province, + {{ json_extract_scalar(adapter.quote('location'), ['fullAddress'], ['fullAddress']) }} as fulladdress, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('suppliers') }} as table_alias +-- location at suppliers/location +where 1 = 1 +and {{ adapter.quote('location') }} is not null + diff --git a/models/generated/airbyte_ctes/unibag/suppliers_location_ab2.sql b/models/generated/airbyte_ctes/unibag/suppliers_location_ab2.sql new file mode 100644 index 0000000..db418d3 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/suppliers_location_ab2.sql @@ -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('suppliers_location_ab1') }} +select + _airbyte_suppliers_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 {{ dbt_utils.type_string() }}) as {{ adapter.quote('location') }}, + cast(province as {{ dbt_utils.type_string() }}) as province, + cast(fulladdress as {{ dbt_utils.type_string() }}) as fulladdress, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('suppliers_location_ab1') }} +-- location at suppliers/location +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/suppliers_location_ab3.sql b/models/generated/airbyte_ctes/unibag/suppliers_location_ab3.sql new file mode 100644 index 0000000..44e34cc --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/suppliers_location_ab3.sql @@ -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('suppliers_location_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_suppliers_hashid', + 'ward', + 'address', + 'district', + adapter.quote('location'), + 'province', + 'fulladdress', + ]) }} as _airbyte_location_hashid, + tmp.* +from {{ ref('suppliers_location_ab2') }} tmp +-- location at suppliers/location +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/suppliers_logo_ab1.sql b/models/generated/airbyte_ctes/unibag/suppliers_logo_ab1.sql new file mode 100644 index 0000000..172d802 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/suppliers_logo_ab1.sql @@ -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('suppliers') }} +select + _airbyte_suppliers_hashid, + {{ json_extract_scalar('logo', ['_id'], ['_id']) }} as _id, + {{ json_extract_scalar('logo', ['name'], ['name']) }} as {{ adapter.quote('name') }}, + {{ json_extract('table_alias', 'logo', ['dimensions'], ['dimensions']) }} as dimensions, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('suppliers') }} as table_alias +-- logo at suppliers/logo +where 1 = 1 +and logo is not null + diff --git a/models/generated/airbyte_ctes/unibag/suppliers_logo_ab2.sql b/models/generated/airbyte_ctes/unibag/suppliers_logo_ab2.sql new file mode 100644 index 0000000..3b50d30 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/suppliers_logo_ab2.sql @@ -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('suppliers_logo_ab1') }} +select + _airbyte_suppliers_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('suppliers_logo_ab1') }} +-- logo at suppliers/logo +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/suppliers_logo_ab3.sql b/models/generated/airbyte_ctes/unibag/suppliers_logo_ab3.sql new file mode 100644 index 0000000..3adeec3 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/suppliers_logo_ab3.sql @@ -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('suppliers_logo_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_suppliers_hashid', + '_id', + adapter.quote('name'), + object_to_string('dimensions'), + ]) }} as _airbyte_logo_hashid, + tmp.* +from {{ ref('suppliers_logo_ab2') }} tmp +-- logo at suppliers/logo +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/suppliers_logo_dimensions_ab1.sql b/models/generated/airbyte_ctes/unibag/suppliers_logo_dimensions_ab1.sql new file mode 100644 index 0000000..95f8586 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/suppliers_logo_dimensions_ab1.sql @@ -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('suppliers_logo') }} +select + _airbyte_logo_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('suppliers_logo') }} as table_alias +-- dimensions at suppliers/logo/dimensions +where 1 = 1 +and dimensions is not null + diff --git a/models/generated/airbyte_ctes/unibag/suppliers_logo_dimensions_ab2.sql b/models/generated/airbyte_ctes/unibag/suppliers_logo_dimensions_ab2.sql new file mode 100644 index 0000000..fddd178 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/suppliers_logo_dimensions_ab2.sql @@ -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('suppliers_logo_dimensions_ab1') }} +select + _airbyte_logo_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('suppliers_logo_dimensions_ab1') }} +-- dimensions at suppliers/logo/dimensions +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/suppliers_logo_dimensions_ab3.sql b/models/generated/airbyte_ctes/unibag/suppliers_logo_dimensions_ab3.sql new file mode 100644 index 0000000..a32a588 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/suppliers_logo_dimensions_ab3.sql @@ -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('suppliers_logo_dimensions_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_logo_hashid', + object_to_string('md'), + object_to_string('sm'), + ]) }} as _airbyte_dimensions_hashid, + tmp.* +from {{ ref('suppliers_logo_dimensions_ab2') }} tmp +-- dimensions at suppliers/logo/dimensions +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/suppliers_logo_dimensions_md_ab1.sql b/models/generated/airbyte_ctes/unibag/suppliers_logo_dimensions_md_ab1.sql new file mode 100644 index 0000000..b9c2d3a --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/suppliers_logo_dimensions_md_ab1.sql @@ -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('suppliers_logo_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('suppliers_logo_dimensions') }} as table_alias +-- md at suppliers/logo/dimensions/md +where 1 = 1 +and md is not null + diff --git a/models/generated/airbyte_ctes/unibag/suppliers_logo_dimensions_md_ab2.sql b/models/generated/airbyte_ctes/unibag/suppliers_logo_dimensions_md_ab2.sql new file mode 100644 index 0000000..9835985 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/suppliers_logo_dimensions_md_ab2.sql @@ -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('suppliers_logo_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('suppliers_logo_dimensions_md_ab1') }} +-- md at suppliers/logo/dimensions/md +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/suppliers_logo_dimensions_md_ab3.sql b/models/generated/airbyte_ctes/unibag/suppliers_logo_dimensions_md_ab3.sql new file mode 100644 index 0000000..8cf31fa --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/suppliers_logo_dimensions_md_ab3.sql @@ -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('suppliers_logo_dimensions_md_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_dimensions_hashid', + 'url', + 'width', + 'height', + ]) }} as _airbyte_md_hashid, + tmp.* +from {{ ref('suppliers_logo_dimensions_md_ab2') }} tmp +-- md at suppliers/logo/dimensions/md +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/suppliers_logo_dimensions_sm_ab1.sql b/models/generated/airbyte_ctes/unibag/suppliers_logo_dimensions_sm_ab1.sql new file mode 100644 index 0000000..308538d --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/suppliers_logo_dimensions_sm_ab1.sql @@ -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('suppliers_logo_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('suppliers_logo_dimensions') }} as table_alias +-- sm at suppliers/logo/dimensions/sm +where 1 = 1 +and sm is not null + diff --git a/models/generated/airbyte_ctes/unibag/suppliers_logo_dimensions_sm_ab2.sql b/models/generated/airbyte_ctes/unibag/suppliers_logo_dimensions_sm_ab2.sql new file mode 100644 index 0000000..f7a3db8 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/suppliers_logo_dimensions_sm_ab2.sql @@ -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('suppliers_logo_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('suppliers_logo_dimensions_sm_ab1') }} +-- sm at suppliers/logo/dimensions/sm +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/suppliers_logo_dimensions_sm_ab3.sql b/models/generated/airbyte_ctes/unibag/suppliers_logo_dimensions_sm_ab3.sql new file mode 100644 index 0000000..3c4dc81 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/suppliers_logo_dimensions_sm_ab3.sql @@ -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('suppliers_logo_dimensions_sm_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_dimensions_hashid', + 'url', + 'width', + 'height', + ]) }} as _airbyte_sm_hashid, + tmp.* +from {{ ref('suppliers_logo_dimensions_sm_ab2') }} tmp +-- sm at suppliers/logo/dimensions/sm +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/suppliers_reviewstatistic_ab1.sql b/models/generated/airbyte_ctes/unibag/suppliers_reviewstatistic_ab1.sql new file mode 100644 index 0000000..28181b3 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/suppliers_reviewstatistic_ab1.sql @@ -0,0 +1,31 @@ +{{ 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('suppliers') }} +select + _airbyte_suppliers_hashid, + {{ json_extract_scalar('reviewstatistic', ['total'], ['total']) }} as total, + {{ json_extract_scalar('reviewstatistic', ['totalReview'], ['totalReview']) }} as totalreview, + {{ json_extract_scalar('reviewstatistic', ['totalScore1'], ['totalScore1']) }} as totalscore1, + {{ json_extract_scalar('reviewstatistic', ['totalScore2'], ['totalScore2']) }} as totalscore2, + {{ json_extract_scalar('reviewstatistic', ['totalScore3'], ['totalScore3']) }} as totalscore3, + {{ json_extract_scalar('reviewstatistic', ['totalScore4'], ['totalScore4']) }} as totalscore4, + {{ json_extract_scalar('reviewstatistic', ['totalScore5'], ['totalScore5']) }} as totalscore5, + {{ json_extract_scalar('reviewstatistic', ['scoreAverage'], ['scoreAverage']) }} as scoreaverage, + {{ json_extract_scalar('reviewstatistic', ['totalHasMedia'], ['totalHasMedia']) }} as totalhasmedia, + {{ json_extract_scalar('reviewstatistic', ['totalHasContent'], ['totalHasContent']) }} as totalhascontent, + {{ json_extract_scalar('reviewstatistic', ['scoreAverageWeekTotal'], ['scoreAverageWeekTotal']) }} as scoreaverageweektotal, + {{ json_extract_scalar('reviewstatistic', ['scoreAverageYearTotal'], ['scoreAverageYearTotal']) }} as scoreaverageyeartotal, + {{ json_extract_scalar('reviewstatistic', ['scoreAverageMonthTotal'], ['scoreAverageMonthTotal']) }} as scoreaveragemonthtotal, + {{ json_extract_scalar('reviewstatistic', ['scoreAverageTwoMonthTotal'], ['scoreAverageTwoMonthTotal']) }} as scoreaveragetwomonthtotal, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('suppliers') }} as table_alias +-- reviewstatistic at suppliers/reviewStatistic +where 1 = 1 +and reviewstatistic is not null + diff --git a/models/generated/airbyte_ctes/unibag/suppliers_reviewstatistic_ab2.sql b/models/generated/airbyte_ctes/unibag/suppliers_reviewstatistic_ab2.sql new file mode 100644 index 0000000..bb68c55 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/suppliers_reviewstatistic_ab2.sql @@ -0,0 +1,30 @@ +{{ 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('suppliers_reviewstatistic_ab1') }} +select + _airbyte_suppliers_hashid, + cast(total as {{ dbt_utils.type_float() }}) as total, + cast(totalreview as {{ dbt_utils.type_float() }}) as totalreview, + cast(totalscore1 as {{ dbt_utils.type_float() }}) as totalscore1, + cast(totalscore2 as {{ dbt_utils.type_float() }}) as totalscore2, + cast(totalscore3 as {{ dbt_utils.type_float() }}) as totalscore3, + cast(totalscore4 as {{ dbt_utils.type_float() }}) as totalscore4, + cast(totalscore5 as {{ dbt_utils.type_float() }}) as totalscore5, + cast(scoreaverage as {{ dbt_utils.type_float() }}) as scoreaverage, + cast(totalhasmedia as {{ dbt_utils.type_float() }}) as totalhasmedia, + cast(totalhascontent as {{ dbt_utils.type_float() }}) as totalhascontent, + cast(scoreaverageweektotal as {{ dbt_utils.type_float() }}) as scoreaverageweektotal, + cast(scoreaverageyeartotal as {{ dbt_utils.type_float() }}) as scoreaverageyeartotal, + cast(scoreaveragemonthtotal as {{ dbt_utils.type_float() }}) as scoreaveragemonthtotal, + cast(scoreaveragetwomonthtotal as {{ dbt_utils.type_float() }}) as scoreaveragetwomonthtotal, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('suppliers_reviewstatistic_ab1') }} +-- reviewstatistic at suppliers/reviewStatistic +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/suppliers_reviewstatistic_ab3.sql b/models/generated/airbyte_ctes/unibag/suppliers_reviewstatistic_ab3.sql new file mode 100644 index 0000000..e6c1076 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/suppliers_reviewstatistic_ab3.sql @@ -0,0 +1,30 @@ +{{ 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('suppliers_reviewstatistic_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_suppliers_hashid', + 'total', + 'totalreview', + 'totalscore1', + 'totalscore2', + 'totalscore3', + 'totalscore4', + 'totalscore5', + 'scoreaverage', + 'totalhasmedia', + 'totalhascontent', + 'scoreaverageweektotal', + 'scoreaverageyeartotal', + 'scoreaveragemonthtotal', + 'scoreaveragetwomonthtotal', + ]) }} as _airbyte_reviewstatistic_hashid, + tmp.* +from {{ ref('suppliers_reviewstatistic_ab2') }} tmp +-- reviewstatistic at suppliers/reviewStatistic +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/suppliers_statistic_ab1.sql b/models/generated/airbyte_ctes/unibag/suppliers_statistic_ab1.sql new file mode 100644 index 0000000..cba331c --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/suppliers_statistic_ab1.sql @@ -0,0 +1,29 @@ +{{ 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('suppliers') }} +select + _airbyte_suppliers_hashid, + {{ json_extract_scalar('statistic', ['salesTotal'], ['salesTotal']) }} as salestotal, + {{ json_extract_scalar('statistic', ['salesPending'], ['salesPending']) }} as salespending, + {{ json_extract_scalar('statistic', ['salesSuccess'], ['salesSuccess']) }} as salessuccess, + {{ json_extract_scalar('statistic', ['totalProduct'], ['totalProduct']) }} as totalproduct, + {{ json_extract_scalar('statistic', ['salesCancelled'], ['salesCancelled']) }} as salescancelled, + {{ json_extract_scalar('statistic', ['salesWeekTotal'], ['salesWeekTotal']) }} as salesweektotal, + {{ json_extract_scalar('statistic', ['salesYearTotal'], ['salesYearTotal']) }} as salesyeartotal, + {{ json_extract_scalar('statistic', ['totalInventory'], ['totalInventory']) }} as totalinventory, + {{ json_extract_scalar('statistic', ['salesMonthTotal'], ['salesMonthTotal']) }} as salesmonthtotal, + {{ json_extract_scalar('statistic', ['totalQuantitySale'], ['totalQuantitySale']) }} as totalquantitysale, + {{ json_extract_scalar('statistic', ['salesTwoMonthTotal'], ['salesTwoMonthTotal']) }} as salestwomonthtotal, + {{ json_extract_scalar('statistic', ['totalHasOrderSeller'], ['totalHasOrderSeller']) }} as totalhasorderseller, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('suppliers') }} as table_alias +-- statistic at suppliers/statistic +where 1 = 1 +and statistic is not null + diff --git a/models/generated/airbyte_ctes/unibag/suppliers_statistic_ab2.sql b/models/generated/airbyte_ctes/unibag/suppliers_statistic_ab2.sql new file mode 100644 index 0000000..10e3c93 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/suppliers_statistic_ab2.sql @@ -0,0 +1,28 @@ +{{ 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('suppliers_statistic_ab1') }} +select + _airbyte_suppliers_hashid, + cast(salestotal as {{ dbt_utils.type_float() }}) as salestotal, + cast(salespending as {{ dbt_utils.type_float() }}) as salespending, + cast(salessuccess as {{ dbt_utils.type_float() }}) as salessuccess, + cast(totalproduct as {{ dbt_utils.type_float() }}) as totalproduct, + cast(salescancelled as {{ dbt_utils.type_float() }}) as salescancelled, + cast(salesweektotal as {{ dbt_utils.type_float() }}) as salesweektotal, + cast(salesyeartotal as {{ dbt_utils.type_float() }}) as salesyeartotal, + cast(totalinventory as {{ dbt_utils.type_float() }}) as totalinventory, + cast(salesmonthtotal as {{ dbt_utils.type_float() }}) as salesmonthtotal, + cast(totalquantitysale as {{ dbt_utils.type_float() }}) as totalquantitysale, + cast(salestwomonthtotal as {{ dbt_utils.type_float() }}) as salestwomonthtotal, + cast(totalhasorderseller as {{ dbt_utils.type_float() }}) as totalhasorderseller, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('suppliers_statistic_ab1') }} +-- statistic at suppliers/statistic +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/suppliers_statistic_ab3.sql b/models/generated/airbyte_ctes/unibag/suppliers_statistic_ab3.sql new file mode 100644 index 0000000..b869b33 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/suppliers_statistic_ab3.sql @@ -0,0 +1,28 @@ +{{ 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('suppliers_statistic_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_suppliers_hashid', + 'salestotal', + 'salespending', + 'salessuccess', + 'totalproduct', + 'salescancelled', + 'salesweektotal', + 'salesyeartotal', + 'totalinventory', + 'salesmonthtotal', + 'totalquantitysale', + 'salestwomonthtotal', + 'totalhasorderseller', + ]) }} as _airbyte_statistic_hashid, + tmp.* +from {{ ref('suppliers_statistic_ab2') }} tmp +-- statistic at suppliers/statistic +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/team_activities_ab1.sql b/models/generated/airbyte_ctes/unibag/team_activities_ab1.sql index 9929ea2..9f53fad 100644 --- a/models/generated/airbyte_ctes/unibag/team_activities_ab1.sql +++ b/models/generated/airbyte_ctes/unibag/team_activities_ab1.sql @@ -10,7 +10,7 @@ select {{ json_extract_scalar('_airbyte_data', ['_id'], ['_id']) }} as _id, {{ json_extract_scalar('_airbyte_data', ['team'], ['team']) }} as team, {{ 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', ['targetId'], ['targetId']) }} as targetid, {{ json_extract_scalar('_airbyte_data', ['createdAt'], ['createdAt']) }} as createdat, {{ json_extract_scalar('_airbyte_data', ['createdBy'], ['createdBy']) }} as createdby, diff --git a/models/generated/airbyte_ctes/unibag/team_activities_ab2.sql b/models/generated/airbyte_ctes/unibag/team_activities_ab2.sql index cf0a002..6d9a9ed 100644 --- a/models/generated/airbyte_ctes/unibag/team_activities_ab2.sql +++ b/models/generated/airbyte_ctes/unibag/team_activities_ab2.sql @@ -10,7 +10,7 @@ select cast(_id as {{ dbt_utils.type_string() }}) as _id, cast(team as {{ dbt_utils.type_string() }}) as team, 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(targetid as {{ dbt_utils.type_string() }}) as targetid, cast(createdat as {{ dbt_utils.type_string() }}) as createdat, cast(createdby as {{ dbt_utils.type_string() }}) as createdby, diff --git a/models/generated/airbyte_ctes/unibag/team_activities_ab3.sql b/models/generated/airbyte_ctes/unibag/team_activities_ab3.sql index 107bd5a..d172d44 100644 --- a/models/generated/airbyte_ctes/unibag/team_activities_ab3.sql +++ b/models/generated/airbyte_ctes/unibag/team_activities_ab3.sql @@ -11,7 +11,7 @@ select '_id', 'team', adapter.quote('action'), - adapter.quote('options'), + object_to_string(adapter.quote('options')), 'targetid', 'createdat', 'createdby', diff --git a/models/generated/airbyte_ctes/unibag/team_activities_options_ab1.sql b/models/generated/airbyte_ctes/unibag/team_activities_options_ab1.sql new file mode 100644 index 0000000..0ec0212 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/team_activities_options_ab1.sql @@ -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('team_activities') }} +select + _airbyte_team_activities_hashid, + {{ json_extract_scalar(adapter.quote('options'), ['name'], ['name']) }} as {{ adapter.quote('name') }}, + {{ json_extract_scalar(adapter.quote('options'), ['role'], ['role']) }} as {{ adapter.quote('role') }}, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('team_activities') }} as table_alias +-- options at team-activities/options +where 1 = 1 +and {{ adapter.quote('options') }} is not null + diff --git a/models/generated/airbyte_ctes/unibag/team_activities_options_ab2.sql b/models/generated/airbyte_ctes/unibag/team_activities_options_ab2.sql new file mode 100644 index 0000000..6a36064 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/team_activities_options_ab2.sql @@ -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('team_activities_options_ab1') }} +select + _airbyte_team_activities_hashid, + cast({{ adapter.quote('name') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('name') }}, + cast({{ adapter.quote('role') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('role') }}, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('team_activities_options_ab1') }} +-- options at team-activities/options +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/team_activities_options_ab3.sql b/models/generated/airbyte_ctes/unibag/team_activities_options_ab3.sql new file mode 100644 index 0000000..34f903f --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/team_activities_options_ab3.sql @@ -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('team_activities_options_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_team_activities_hashid', + adapter.quote('name'), + adapter.quote('role'), + ]) }} as _airbyte_options_hashid, + tmp.* +from {{ ref('team_activities_options_ab2') }} tmp +-- options at team-activities/options +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/team_members_ab1.sql b/models/generated/airbyte_ctes/unibag/team_members_ab1.sql index 55f902c..4198b74 100644 --- a/models/generated/airbyte_ctes/unibag/team_members_ab1.sql +++ b/models/generated/airbyte_ctes/unibag/team_members_ab1.sql @@ -16,12 +16,11 @@ select {{ json_extract_scalar('_airbyte_data', ['joinedAt'], ['joinedAt']) }} as joinedat, {{ json_extract_scalar('_airbyte_data', ['roleCode'], ['roleCode']) }} as rolecode, {{ json_extract_scalar('_airbyte_data', ['createdAt'], ['createdAt']) }} as createdat, - {{ 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', ['isRemovedBy'], ['isRemovedBy']) }} as isremovedby, - {{ json_extract_scalar('_airbyte_data', ['firstOrderAt'], ['firstOrderAt']) }} as firstorderat, {{ json_extract_scalar('_airbyte_data', ['searchString'], ['searchString']) }} as searchstring, - {{ json_extract_scalar('_airbyte_data', ['isMemberHomegrown'], ['isMemberHomegrown']) }} as ismemberhomegrown, + {{ json_extract('table_alias', '_airbyte_data', ['statisticMonth'], ['statisticMonth']) }} as statisticmonth, _airbyte_ab_id, _airbyte_emitted_at, {{ current_timestamp() }} as _airbyte_normalized_at diff --git a/models/generated/airbyte_ctes/unibag/team_members_ab2.sql b/models/generated/airbyte_ctes/unibag/team_members_ab2.sql index ca29b11..be4d37b 100644 --- a/models/generated/airbyte_ctes/unibag/team_members_ab2.sql +++ b/models/generated/airbyte_ctes/unibag/team_members_ab2.sql @@ -16,12 +16,11 @@ select cast(joinedat as {{ dbt_utils.type_string() }}) as joinedat, cast(rolecode as {{ dbt_utils.type_float() }}) as rolecode, cast(createdat as {{ dbt_utils.type_string() }}) as createdat, - 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(isremovedby as {{ dbt_utils.type_string() }}) as isremovedby, - cast(firstorderat as {{ dbt_utils.type_string() }}) as firstorderat, cast(searchstring as {{ dbt_utils.type_string() }}) as searchstring, - {{ cast_to_boolean('ismemberhomegrown') }} as ismemberhomegrown, + cast(statisticmonth as {{ type_json() }}) as statisticmonth, _airbyte_ab_id, _airbyte_emitted_at, {{ current_timestamp() }} as _airbyte_normalized_at diff --git a/models/generated/airbyte_ctes/unibag/team_members_ab3.sql b/models/generated/airbyte_ctes/unibag/team_members_ab3.sql index cb2a11b..5c1afff 100644 --- a/models/generated/airbyte_ctes/unibag/team_members_ab3.sql +++ b/models/generated/airbyte_ctes/unibag/team_members_ab3.sql @@ -17,12 +17,11 @@ select 'joinedat', 'rolecode', 'createdat', - 'statistic', + object_to_string('statistic'), 'updatedat', 'isremovedby', - 'firstorderat', 'searchstring', - boolean_to_string('ismemberhomegrown'), + object_to_string('statisticmonth'), ]) }} as _airbyte_team_members_hashid, tmp.* from {{ ref('team_members_ab2') }} tmp diff --git a/models/generated/airbyte_ctes/unibag/team_members_statistic_ab1.sql b/models/generated/airbyte_ctes/unibag/team_members_statistic_ab1.sql new file mode 100644 index 0000000..dfc7a95 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/team_members_statistic_ab1.sql @@ -0,0 +1,37 @@ +{{ 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('team_members') }} +select + _airbyte_team_members_hashid, + {{ json_extract_scalar('statistic', ['sales'], ['sales']) }} as sales, + {{ json_extract_scalar('statistic', ['transactionTotal'], ['transactionTotal']) }} as transactiontotal, + {{ json_extract_scalar('statistic', ['transactionPending'], ['transactionPending']) }} as transactionpending, + {{ json_extract_scalar('statistic', ['transactionSuccess'], ['transactionSuccess']) }} as transactionsuccess, + {{ json_extract_scalar('statistic', ['transactionRejected'], ['transactionRejected']) }} as transactionrejected, + {{ json_extract_scalar('statistic', ['cashTransactionTotal'], ['cashTransactionTotal']) }} as cashtransactiontotal, + {{ json_extract_scalar('statistic', ['transactionDelivered'], ['transactionDelivered']) }} as transactiondelivered, + {{ json_extract_scalar('statistic', ['transactionDelivering'], ['transactionDelivering']) }} as transactiondelivering, + {{ json_extract_scalar('statistic', ['cashTransactionPending'], ['cashTransactionPending']) }} as cashtransactionpending, + {{ json_extract_scalar('statistic', ['cashTransactionSuccess'], ['cashTransactionSuccess']) }} as cashtransactionsuccess, + {{ json_extract_scalar('statistic', ['cashTransactionRejected'], ['cashTransactionRejected']) }} as cashtransactionrejected, + {{ json_extract_scalar('statistic', ['cashTransactionDelivered'], ['cashTransactionDelivered']) }} as cashtransactiondelivered, + {{ json_extract_scalar('statistic', ['cashTransactionDelivering'], ['cashTransactionDelivering']) }} as cashtransactiondelivering, + {{ json_extract_scalar('statistic', ['transactionWaitingApprove'], ['transactionWaitingApprove']) }} as transactionwaitingapprove, + {{ json_extract_scalar('statistic', ['transactionPaymentProcessing'], ['transactionPaymentProcessing']) }} as transactionpaymentprocessing, + {{ json_extract_scalar('statistic', ['cashTransactionWaitingApprove'], ['cashTransactionWaitingApprove']) }} as cashtransactionwaitingapprove, + {{ json_extract_scalar('statistic', ['thisMonthSale_aibyte_transform'], ['thisMonthSale_aibyte_transform']) }} as thismonthsale_aibyte_transform, + {{ json_extract_scalar('statistic', ['lastMonthSales_aibyte_transform'], ['lastMonthSales_aibyte_transform']) }} as lastmonthsales_aibyte_transform, + {{ json_extract_scalar('statistic', ['thisMonthSales_aibyte_transform'], ['thisMonthSales_aibyte_transform']) }} as thismonthsales_aibyte_transform, + {{ json_extract_scalar('statistic', ['cashTransactionPaymentProcessing'], ['cashTransactionPaymentProcessing']) }} as cashtransactionpaymentprocessing, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('team_members') }} as table_alias +-- statistic at team-members/statistic +where 1 = 1 +and statistic is not null + diff --git a/models/generated/airbyte_ctes/unibag/team_members_statistic_ab2.sql b/models/generated/airbyte_ctes/unibag/team_members_statistic_ab2.sql new file mode 100644 index 0000000..ebe00b2 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/team_members_statistic_ab2.sql @@ -0,0 +1,36 @@ +{{ 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('team_members_statistic_ab1') }} +select + _airbyte_team_members_hashid, + cast(sales as {{ dbt_utils.type_float() }}) as sales, + cast(transactiontotal as {{ dbt_utils.type_float() }}) as transactiontotal, + cast(transactionpending as {{ dbt_utils.type_float() }}) as transactionpending, + cast(transactionsuccess as {{ dbt_utils.type_float() }}) as transactionsuccess, + cast(transactionrejected as {{ dbt_utils.type_float() }}) as transactionrejected, + cast(cashtransactiontotal as {{ dbt_utils.type_float() }}) as cashtransactiontotal, + cast(transactiondelivered as {{ dbt_utils.type_float() }}) as transactiondelivered, + cast(transactiondelivering as {{ dbt_utils.type_float() }}) as transactiondelivering, + cast(cashtransactionpending as {{ dbt_utils.type_float() }}) as cashtransactionpending, + cast(cashtransactionsuccess as {{ dbt_utils.type_float() }}) as cashtransactionsuccess, + cast(cashtransactionrejected as {{ dbt_utils.type_float() }}) as cashtransactionrejected, + cast(cashtransactiondelivered as {{ dbt_utils.type_float() }}) as cashtransactiondelivered, + cast(cashtransactiondelivering as {{ dbt_utils.type_float() }}) as cashtransactiondelivering, + cast(transactionwaitingapprove as {{ dbt_utils.type_float() }}) as transactionwaitingapprove, + cast(transactionpaymentprocessing as {{ dbt_utils.type_float() }}) as transactionpaymentprocessing, + cast(cashtransactionwaitingapprove as {{ dbt_utils.type_float() }}) as cashtransactionwaitingapprove, + cast(thismonthsale_aibyte_transform as {{ dbt_utils.type_string() }}) as thismonthsale_aibyte_transform, + cast(lastmonthsales_aibyte_transform as {{ dbt_utils.type_string() }}) as lastmonthsales_aibyte_transform, + cast(thismonthsales_aibyte_transform as {{ dbt_utils.type_string() }}) as thismonthsales_aibyte_transform, + cast(cashtransactionpaymentprocessing as {{ dbt_utils.type_float() }}) as cashtransactionpaymentprocessing, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('team_members_statistic_ab1') }} +-- statistic at team-members/statistic +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/team_members_statistic_ab3.sql b/models/generated/airbyte_ctes/unibag/team_members_statistic_ab3.sql new file mode 100644 index 0000000..af76815 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/team_members_statistic_ab3.sql @@ -0,0 +1,36 @@ +{{ 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('team_members_statistic_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_team_members_hashid', + 'sales', + 'transactiontotal', + 'transactionpending', + 'transactionsuccess', + 'transactionrejected', + 'cashtransactiontotal', + 'transactiondelivered', + 'transactiondelivering', + 'cashtransactionpending', + 'cashtransactionsuccess', + 'cashtransactionrejected', + 'cashtransactiondelivered', + 'cashtransactiondelivering', + 'transactionwaitingapprove', + 'transactionpaymentprocessing', + 'cashtransactionwaitingapprove', + 'thismonthsale_aibyte_transform', + 'lastmonthsales_aibyte_transform', + 'thismonthsales_aibyte_transform', + 'cashtransactionpaymentprocessing', + ]) }} as _airbyte_statistic_hashid, + tmp.* +from {{ ref('team_members_statistic_ab2') }} tmp +-- statistic at team-members/statistic +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/team_members_statisticmonth_ab1.sql b/models/generated/airbyte_ctes/unibag/team_members_statisticmonth_ab1.sql new file mode 100644 index 0000000..a41633b --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/team_members_statisticmonth_ab1.sql @@ -0,0 +1,35 @@ +{{ 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('team_members') }} +select + _airbyte_team_members_hashid, + {{ json_extract_scalar('statisticmonth', ['sales'], ['sales']) }} as sales, + {{ json_extract_scalar('statisticmonth', ['thisMonthSale'], ['thisMonthSale']) }} as thismonthsale, + {{ json_extract_scalar('statisticmonth', ['transactionTotal'], ['transactionTotal']) }} as transactiontotal, + {{ json_extract_scalar('statisticmonth', ['transactionPending'], ['transactionPending']) }} as transactionpending, + {{ json_extract_scalar('statisticmonth', ['transactionSuccess'], ['transactionSuccess']) }} as transactionsuccess, + {{ json_extract_scalar('statisticmonth', ['transactionRejected'], ['transactionRejected']) }} as transactionrejected, + {{ json_extract_scalar('statisticmonth', ['cashTransactionTotal'], ['cashTransactionTotal']) }} as cashtransactiontotal, + {{ json_extract_scalar('statisticmonth', ['transactionDelivered'], ['transactionDelivered']) }} as transactiondelivered, + {{ json_extract_scalar('statisticmonth', ['transactionDelivering'], ['transactionDelivering']) }} as transactiondelivering, + {{ json_extract_scalar('statisticmonth', ['cashTransactionPending'], ['cashTransactionPending']) }} as cashtransactionpending, + {{ json_extract_scalar('statisticmonth', ['cashTransactionSuccess'], ['cashTransactionSuccess']) }} as cashtransactionsuccess, + {{ json_extract_scalar('statisticmonth', ['cashTransactionRejected'], ['cashTransactionRejected']) }} as cashtransactionrejected, + {{ json_extract_scalar('statisticmonth', ['cashTransactionDelivered'], ['cashTransactionDelivered']) }} as cashtransactiondelivered, + {{ json_extract_scalar('statisticmonth', ['cashTransactionDelivering'], ['cashTransactionDelivering']) }} as cashtransactiondelivering, + {{ json_extract_scalar('statisticmonth', ['transactionWaitingApprove'], ['transactionWaitingApprove']) }} as transactionwaitingapprove, + {{ json_extract_scalar('statisticmonth', ['transactionPaymentProcessing'], ['transactionPaymentProcessing']) }} as transactionpaymentprocessing, + {{ json_extract_scalar('statisticmonth', ['cashTransactionWaitingApprove'], ['cashTransactionWaitingApprove']) }} as cashtransactionwaitingapprove, + {{ json_extract_scalar('statisticmonth', ['cashTransactionPaymentProcessing'], ['cashTransactionPaymentProcessing']) }} as cashtransactionpaymentprocessing, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('team_members') }} as table_alias +-- statisticmonth at team-members/statisticMonth +where 1 = 1 +and statisticmonth is not null + diff --git a/models/generated/airbyte_ctes/unibag/team_members_statisticmonth_ab2.sql b/models/generated/airbyte_ctes/unibag/team_members_statisticmonth_ab2.sql new file mode 100644 index 0000000..a32b16e --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/team_members_statisticmonth_ab2.sql @@ -0,0 +1,34 @@ +{{ 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('team_members_statisticmonth_ab1') }} +select + _airbyte_team_members_hashid, + cast(sales as {{ dbt_utils.type_float() }}) as sales, + cast(thismonthsale as {{ dbt_utils.type_float() }}) as thismonthsale, + cast(transactiontotal as {{ dbt_utils.type_float() }}) as transactiontotal, + cast(transactionpending as {{ dbt_utils.type_float() }}) as transactionpending, + cast(transactionsuccess as {{ dbt_utils.type_float() }}) as transactionsuccess, + cast(transactionrejected as {{ dbt_utils.type_float() }}) as transactionrejected, + cast(cashtransactiontotal as {{ dbt_utils.type_float() }}) as cashtransactiontotal, + cast(transactiondelivered as {{ dbt_utils.type_float() }}) as transactiondelivered, + cast(transactiondelivering as {{ dbt_utils.type_float() }}) as transactiondelivering, + cast(cashtransactionpending as {{ dbt_utils.type_float() }}) as cashtransactionpending, + cast(cashtransactionsuccess as {{ dbt_utils.type_float() }}) as cashtransactionsuccess, + cast(cashtransactionrejected as {{ dbt_utils.type_float() }}) as cashtransactionrejected, + cast(cashtransactiondelivered as {{ dbt_utils.type_float() }}) as cashtransactiondelivered, + cast(cashtransactiondelivering as {{ dbt_utils.type_float() }}) as cashtransactiondelivering, + cast(transactionwaitingapprove as {{ dbt_utils.type_float() }}) as transactionwaitingapprove, + cast(transactionpaymentprocessing as {{ dbt_utils.type_float() }}) as transactionpaymentprocessing, + cast(cashtransactionwaitingapprove as {{ dbt_utils.type_float() }}) as cashtransactionwaitingapprove, + cast(cashtransactionpaymentprocessing as {{ dbt_utils.type_float() }}) as cashtransactionpaymentprocessing, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('team_members_statisticmonth_ab1') }} +-- statisticmonth at team-members/statisticMonth +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/team_members_statisticmonth_ab3.sql b/models/generated/airbyte_ctes/unibag/team_members_statisticmonth_ab3.sql new file mode 100644 index 0000000..dd65894 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/team_members_statisticmonth_ab3.sql @@ -0,0 +1,34 @@ +{{ 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('team_members_statisticmonth_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_team_members_hashid', + 'sales', + 'thismonthsale', + 'transactiontotal', + 'transactionpending', + 'transactionsuccess', + 'transactionrejected', + 'cashtransactiontotal', + 'transactiondelivered', + 'transactiondelivering', + 'cashtransactionpending', + 'cashtransactionsuccess', + 'cashtransactionrejected', + 'cashtransactiondelivered', + 'cashtransactiondelivering', + 'transactionwaitingapprove', + 'transactionpaymentprocessing', + 'cashtransactionwaitingapprove', + 'cashtransactionpaymentprocessing', + ]) }} as _airbyte_statisticmonth_hashid, + tmp.* +from {{ ref('team_members_statisticmonth_ab2') }} tmp +-- statisticmonth at team-members/statisticMonth +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/teams_ab1.sql b/models/generated/airbyte_ctes/unibag/teams_ab1.sql index 1d59bba..76a9108 100644 --- a/models/generated/airbyte_ctes/unibag/teams_ab1.sql +++ b/models/generated/airbyte_ctes/unibag/teams_ab1.sql @@ -10,18 +10,19 @@ select {{ json_extract_scalar('_airbyte_data', ['_id'], ['_id']) }} as _id, {{ json_extract_scalar('_airbyte_data', ['code'], ['code']) }} as code, {{ json_extract_scalar('_airbyte_data', ['desc'], ['desc']) }} as {{ adapter.quote('desc') }}, - {{ json_extract_scalar('_airbyte_data', ['logo'], ['logo']) }} as logo, + {{ json_extract('table_alias', '_airbyte_data', ['logo'], ['logo']) }} as logo, {{ json_extract_scalar('_airbyte_data', ['name'], ['name']) }} as {{ adapter.quote('name') }}, - {{ json_extract_scalar('_airbyte_data', ['level'], ['level']) }} as {{ adapter.quote('level') }}, + {{ json_extract_scalar('_airbyte_data', ['temp'], ['temp']) }} as {{ adapter.quote('temp') }}, + {{ json_extract('table_alias', '_airbyte_data', ['level'], ['level']) }} as {{ adapter.quote('level') }}, {{ json_extract_scalar('_airbyte_data', ['active'], ['active']) }} as active, {{ json_extract_scalar('_airbyte_data', ['isFull'], ['isFull']) }} as isfull, {{ json_extract_scalar('_airbyte_data', ['cityCode'], ['cityCode']) }} as citycode, {{ json_extract_scalar('_airbyte_data', ['adminUser'], ['adminUser']) }} as adminuser, {{ json_extract_scalar('_airbyte_data', ['createdAt'], ['createdAt']) }} as createdat, - {{ 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', ['inviteLink'], ['inviteLink']) }} as invitelink, - {{ json_extract_scalar('_airbyte_data', ['information'], ['information']) }} as information, + {{ json_extract('table_alias', '_airbyte_data', ['information'], ['information']) }} as information, {{ json_extract_scalar('_airbyte_data', ['searchString'], ['searchString']) }} as searchstring, {{ json_extract_scalar('_airbyte_data', ['inactiveReason'], ['inactiveReason']) }} as inactivereason, {{ json_extract_scalar('_airbyte_data', ['changingNameCount'], ['changingNameCount']) }} as changingnamecount, diff --git a/models/generated/airbyte_ctes/unibag/teams_ab2.sql b/models/generated/airbyte_ctes/unibag/teams_ab2.sql index bb0193c..44d02e7 100644 --- a/models/generated/airbyte_ctes/unibag/teams_ab2.sql +++ b/models/generated/airbyte_ctes/unibag/teams_ab2.sql @@ -10,18 +10,19 @@ select cast(_id as {{ dbt_utils.type_string() }}) as _id, cast(code as {{ dbt_utils.type_string() }}) as code, cast({{ adapter.quote('desc') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('desc') }}, - cast(logo as {{ dbt_utils.type_string() }}) as logo, + cast(logo as {{ type_json() }}) as logo, cast({{ adapter.quote('name') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('name') }}, - cast({{ adapter.quote('level') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('level') }}, + cast({{ adapter.quote('temp') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('temp') }}, + cast({{ adapter.quote('level') }} as {{ type_json() }}) as {{ adapter.quote('level') }}, {{ cast_to_boolean('active') }} as active, {{ cast_to_boolean('isfull') }} as isfull, cast(citycode as {{ dbt_utils.type_float() }}) as citycode, cast(adminuser as {{ dbt_utils.type_string() }}) as adminuser, cast(createdat as {{ dbt_utils.type_string() }}) as createdat, - 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(invitelink as {{ dbt_utils.type_string() }}) as invitelink, - cast(information as {{ dbt_utils.type_string() }}) as information, + cast(information as {{ type_json() }}) as information, cast(searchstring as {{ dbt_utils.type_string() }}) as searchstring, cast(inactivereason as {{ dbt_utils.type_string() }}) as inactivereason, cast(changingnamecount as {{ dbt_utils.type_float() }}) as changingnamecount, diff --git a/models/generated/airbyte_ctes/unibag/teams_ab3.sql b/models/generated/airbyte_ctes/unibag/teams_ab3.sql index 36dc595..a43576b 100644 --- a/models/generated/airbyte_ctes/unibag/teams_ab3.sql +++ b/models/generated/airbyte_ctes/unibag/teams_ab3.sql @@ -11,18 +11,19 @@ select '_id', 'code', adapter.quote('desc'), - 'logo', + object_to_string('logo'), adapter.quote('name'), - adapter.quote('level'), + adapter.quote('temp'), + object_to_string(adapter.quote('level')), boolean_to_string('active'), boolean_to_string('isfull'), 'citycode', 'adminuser', 'createdat', - 'statistic', + object_to_string('statistic'), 'updatedat', 'invitelink', - 'information', + object_to_string('information'), 'searchstring', 'inactivereason', 'changingnamecount', diff --git a/models/generated/airbyte_ctes/unibag/teams_information_ab1.sql b/models/generated/airbyte_ctes/unibag/teams_information_ab1.sql new file mode 100644 index 0000000..346f367 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/teams_information_ab1.sql @@ -0,0 +1,18 @@ +{{ 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('teams') }} +select + _airbyte_teams_hashid, + {{ json_extract_scalar('information', ['communicationChannel'], ['communicationChannel']) }} as communicationchannel, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('teams') }} as table_alias +-- information at teams/information +where 1 = 1 +and information is not null + diff --git a/models/generated/airbyte_ctes/unibag/teams_information_ab2.sql b/models/generated/airbyte_ctes/unibag/teams_information_ab2.sql new file mode 100644 index 0000000..d16754d --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/teams_information_ab2.sql @@ -0,0 +1,17 @@ +{{ 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('teams_information_ab1') }} +select + _airbyte_teams_hashid, + cast(communicationchannel as {{ dbt_utils.type_string() }}) as communicationchannel, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('teams_information_ab1') }} +-- information at teams/information +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/teams_information_ab3.sql b/models/generated/airbyte_ctes/unibag/teams_information_ab3.sql new file mode 100644 index 0000000..e8e35cf --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/teams_information_ab3.sql @@ -0,0 +1,17 @@ +{{ 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('teams_information_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_teams_hashid', + 'communicationchannel', + ]) }} as _airbyte_information_hashid, + tmp.* +from {{ ref('teams_information_ab2') }} tmp +-- information at teams/information +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/teams_level_ab1.sql b/models/generated/airbyte_ctes/unibag/teams_level_ab1.sql new file mode 100644 index 0000000..0a7b131 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/teams_level_ab1.sql @@ -0,0 +1,27 @@ +{{ 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('teams') }} +select + _airbyte_teams_hashid, + {{ json_extract_scalar(adapter.quote('level'), ['name'], ['name']) }} as {{ adapter.quote('name') }}, + {{ json_extract_scalar(adapter.quote('level'), ['color'], ['color']) }} as color, + {{ json_extract_scalar(adapter.quote('level'), ['level'], ['level']) }} as {{ adapter.quote('level') }}, + {{ json_extract_scalar(adapter.quote('level'), ['expiredAt'], ['expiredAt']) }} as expiredat, + {{ json_extract_scalar(adapter.quote('level'), ['nextLevel'], ['nextLevel']) }} as nextlevel, + {{ json_extract_scalar(adapter.quote('level'), ['bonusPercent'], ['bonusPercent']) }} as bonuspercent, + {{ json_extract_scalar(adapter.quote('level'), ['maximumVipMember'], ['maximumVipMember']) }} as maximumvipmember, + {{ json_extract_scalar(adapter.quote('level'), ['levelAtStartOfMonth'], ['levelAtStartOfMonth']) }} as levelatstartofmonth, + {{ json_extract_scalar(adapter.quote('level'), ['maximumNumberMember'], ['maximumNumberMember']) }} as maximumnumbermember, + {{ json_extract_scalar(adapter.quote('level'), ['maximumNumberViceLeader'], ['maximumNumberViceLeader']) }} as maximumnumberviceleader, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('teams') }} as table_alias +-- level at teams/level +where 1 = 1 +and {{ adapter.quote('level') }} is not null + diff --git a/models/generated/airbyte_ctes/unibag/teams_level_ab2.sql b/models/generated/airbyte_ctes/unibag/teams_level_ab2.sql new file mode 100644 index 0000000..71dda0b --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/teams_level_ab2.sql @@ -0,0 +1,26 @@ +{{ 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('teams_level_ab1') }} +select + _airbyte_teams_hashid, + cast({{ adapter.quote('name') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('name') }}, + cast(color as {{ dbt_utils.type_string() }}) as color, + cast({{ adapter.quote('level') }} as {{ dbt_utils.type_float() }}) as {{ adapter.quote('level') }}, + cast(expiredat as {{ dbt_utils.type_string() }}) as expiredat, + cast(nextlevel as {{ dbt_utils.type_float() }}) as nextlevel, + cast(bonuspercent as {{ dbt_utils.type_float() }}) as bonuspercent, + cast(maximumvipmember as {{ dbt_utils.type_float() }}) as maximumvipmember, + cast(levelatstartofmonth as {{ dbt_utils.type_float() }}) as levelatstartofmonth, + cast(maximumnumbermember as {{ dbt_utils.type_float() }}) as maximumnumbermember, + cast(maximumnumberviceleader as {{ dbt_utils.type_float() }}) as maximumnumberviceleader, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('teams_level_ab1') }} +-- level at teams/level +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/teams_level_ab3.sql b/models/generated/airbyte_ctes/unibag/teams_level_ab3.sql new file mode 100644 index 0000000..5844225 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/teams_level_ab3.sql @@ -0,0 +1,26 @@ +{{ 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('teams_level_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_teams_hashid', + adapter.quote('name'), + 'color', + adapter.quote('level'), + 'expiredat', + 'nextlevel', + 'bonuspercent', + 'maximumvipmember', + 'levelatstartofmonth', + 'maximumnumbermember', + 'maximumnumberviceleader', + ]) }} as _airbyte_level_hashid, + tmp.* +from {{ ref('teams_level_ab2') }} tmp +-- level at teams/level +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/teams_logo_ab1.sql b/models/generated/airbyte_ctes/unibag/teams_logo_ab1.sql new file mode 100644 index 0000000..a7b67e6 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/teams_logo_ab1.sql @@ -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('teams') }} +select + _airbyte_teams_hashid, + {{ json_extract_scalar('logo', ['_id'], ['_id']) }} as _id, + {{ json_extract_scalar('logo', ['name'], ['name']) }} as {{ adapter.quote('name') }}, + {{ json_extract('table_alias', 'logo', ['dimensions'], ['dimensions']) }} as dimensions, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('teams') }} as table_alias +-- logo at teams/logo +where 1 = 1 +and logo is not null + diff --git a/models/generated/airbyte_ctes/unibag/teams_logo_ab2.sql b/models/generated/airbyte_ctes/unibag/teams_logo_ab2.sql new file mode 100644 index 0000000..9aa4c34 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/teams_logo_ab2.sql @@ -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('teams_logo_ab1') }} +select + _airbyte_teams_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('teams_logo_ab1') }} +-- logo at teams/logo +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/teams_logo_ab3.sql b/models/generated/airbyte_ctes/unibag/teams_logo_ab3.sql new file mode 100644 index 0000000..e45a575 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/teams_logo_ab3.sql @@ -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('teams_logo_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_teams_hashid', + '_id', + adapter.quote('name'), + object_to_string('dimensions'), + ]) }} as _airbyte_logo_hashid, + tmp.* +from {{ ref('teams_logo_ab2') }} tmp +-- logo at teams/logo +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/teams_logo_dimensions_ab1.sql b/models/generated/airbyte_ctes/unibag/teams_logo_dimensions_ab1.sql new file mode 100644 index 0000000..80b4db4 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/teams_logo_dimensions_ab1.sql @@ -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('teams_logo') }} +select + _airbyte_logo_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('teams_logo') }} as table_alias +-- dimensions at teams/logo/dimensions +where 1 = 1 +and dimensions is not null + diff --git a/models/generated/airbyte_ctes/unibag/teams_logo_dimensions_ab2.sql b/models/generated/airbyte_ctes/unibag/teams_logo_dimensions_ab2.sql new file mode 100644 index 0000000..b41736b --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/teams_logo_dimensions_ab2.sql @@ -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('teams_logo_dimensions_ab1') }} +select + _airbyte_logo_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('teams_logo_dimensions_ab1') }} +-- dimensions at teams/logo/dimensions +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/teams_logo_dimensions_ab3.sql b/models/generated/airbyte_ctes/unibag/teams_logo_dimensions_ab3.sql new file mode 100644 index 0000000..f9c0787 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/teams_logo_dimensions_ab3.sql @@ -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('teams_logo_dimensions_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_logo_hashid', + object_to_string('md'), + object_to_string('sm'), + ]) }} as _airbyte_dimensions_hashid, + tmp.* +from {{ ref('teams_logo_dimensions_ab2') }} tmp +-- dimensions at teams/logo/dimensions +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/teams_logo_dimensions_md_ab1.sql b/models/generated/airbyte_ctes/unibag/teams_logo_dimensions_md_ab1.sql new file mode 100644 index 0000000..3cd6d94 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/teams_logo_dimensions_md_ab1.sql @@ -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('teams_logo_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('teams_logo_dimensions') }} as table_alias +-- md at teams/logo/dimensions/md +where 1 = 1 +and md is not null + diff --git a/models/generated/airbyte_ctes/unibag/teams_logo_dimensions_md_ab2.sql b/models/generated/airbyte_ctes/unibag/teams_logo_dimensions_md_ab2.sql new file mode 100644 index 0000000..4e977d1 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/teams_logo_dimensions_md_ab2.sql @@ -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('teams_logo_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('teams_logo_dimensions_md_ab1') }} +-- md at teams/logo/dimensions/md +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/teams_logo_dimensions_md_ab3.sql b/models/generated/airbyte_ctes/unibag/teams_logo_dimensions_md_ab3.sql new file mode 100644 index 0000000..b8f8413 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/teams_logo_dimensions_md_ab3.sql @@ -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('teams_logo_dimensions_md_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_dimensions_hashid', + 'url', + 'width', + 'height', + ]) }} as _airbyte_md_hashid, + tmp.* +from {{ ref('teams_logo_dimensions_md_ab2') }} tmp +-- md at teams/logo/dimensions/md +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/teams_logo_dimensions_sm_ab1.sql b/models/generated/airbyte_ctes/unibag/teams_logo_dimensions_sm_ab1.sql new file mode 100644 index 0000000..d1265b7 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/teams_logo_dimensions_sm_ab1.sql @@ -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('teams_logo_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('teams_logo_dimensions') }} as table_alias +-- sm at teams/logo/dimensions/sm +where 1 = 1 +and sm is not null + diff --git a/models/generated/airbyte_ctes/unibag/teams_logo_dimensions_sm_ab2.sql b/models/generated/airbyte_ctes/unibag/teams_logo_dimensions_sm_ab2.sql new file mode 100644 index 0000000..af05493 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/teams_logo_dimensions_sm_ab2.sql @@ -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('teams_logo_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('teams_logo_dimensions_sm_ab1') }} +-- sm at teams/logo/dimensions/sm +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/teams_logo_dimensions_sm_ab3.sql b/models/generated/airbyte_ctes/unibag/teams_logo_dimensions_sm_ab3.sql new file mode 100644 index 0000000..fc3f2b1 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/teams_logo_dimensions_sm_ab3.sql @@ -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('teams_logo_dimensions_sm_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_dimensions_hashid', + 'url', + 'width', + 'height', + ]) }} as _airbyte_sm_hashid, + tmp.* +from {{ ref('teams_logo_dimensions_sm_ab2') }} tmp +-- sm at teams/logo/dimensions/sm +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/teams_statistic_ab1.sql b/models/generated/airbyte_ctes/unibag/teams_statistic_ab1.sql new file mode 100644 index 0000000..9c167c6 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/teams_statistic_ab1.sql @@ -0,0 +1,41 @@ +{{ 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('teams') }} +select + _airbyte_teams_hashid, + {{ json_extract_scalar('statistic', ['sales'], ['sales']) }} as sales, + {{ json_extract_scalar('statistic', ['memberTotal'], ['memberTotal']) }} as membertotal, + {{ json_extract_scalar('statistic', ['lastMonthSales'], ['lastMonthSales']) }} as lastmonthsales, + {{ json_extract_scalar('statistic', ['thisMonthSales'], ['thisMonthSales']) }} as thismonthsales, + {{ json_extract_scalar('statistic', ['transactionTotal'], ['transactionTotal']) }} as transactiontotal, + {{ json_extract_scalar('statistic', ['transactionPending'], ['transactionPending']) }} as transactionpending, + {{ json_extract_scalar('statistic', ['transactionSuccess'], ['transactionSuccess']) }} as transactionsuccess, + {{ json_extract_scalar('statistic', ['transactionRejected'], ['transactionRejected']) }} as transactionrejected, + {{ json_extract_scalar('statistic', ['cashTransactionTotal'], ['cashTransactionTotal']) }} as cashtransactiontotal, + {{ json_extract_scalar('statistic', ['memberTotalRemaining'], ['memberTotalRemaining']) }} as membertotalremaining, + {{ json_extract_scalar('statistic', ['transactionDelivered'], ['transactionDelivered']) }} as transactiondelivered, + {{ json_extract_scalar('statistic', ['transactionDelivering'], ['transactionDelivering']) }} as transactiondelivering, + {{ json_extract_scalar('statistic', ['cashTransactionPending'], ['cashTransactionPending']) }} as cashtransactionpending, + {{ json_extract_scalar('statistic', ['cashTransactionSuccess'], ['cashTransactionSuccess']) }} as cashtransactionsuccess, + {{ json_extract_scalar('statistic', ['cashTransactionRejected'], ['cashTransactionRejected']) }} as cashtransactionrejected, + {{ json_extract_scalar('statistic', ['cashTransactionDelivered'], ['cashTransactionDelivered']) }} as cashtransactiondelivered, + {{ json_extract_scalar('statistic', ['cashTransactionDelivering'], ['cashTransactionDelivering']) }} as cashtransactiondelivering, + {{ json_extract_scalar('statistic', ['transactionWaitingApprove'], ['transactionWaitingApprove']) }} as transactionwaitingapprove, + {{ json_extract_scalar('statistic', ['transactionPaymentProcessing'], ['transactionPaymentProcessing']) }} as transactionpaymentprocessing, + {{ json_extract_scalar('statistic', ['cashTransactionWaitingApprove'], ['cashTransactionWaitingApprove']) }} as cashtransactionwaitingapprove, + {{ json_extract_scalar('statistic', ['thisMonthSale_aibyte_transform'], ['thisMonthSale_aibyte_transform']) }} as thismonthsale_aibyte_transform, + {{ json_extract_scalar('statistic', ['vipMemberTotal_aibyte_transform'], ['vipMemberTotal_aibyte_transform']) }} as vipmembertotal_aibyte_transform, + {{ json_extract_scalar('statistic', ['cashTransactionPaymentProcessing'], ['cashTransactionPaymentProcessing']) }} as cashtransactionpaymentprocessing, + {{ json_extract_scalar('statistic', ['memberRequestTotalPending_aibyte_transform'], ['memberRequestTotalPending_aibyte_transform']) }} as memberrequesttotalpending_aibyte_transform, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('teams') }} as table_alias +-- statistic at teams/statistic +where 1 = 1 +and statistic is not null + diff --git a/models/generated/airbyte_ctes/unibag/teams_statistic_ab2.sql b/models/generated/airbyte_ctes/unibag/teams_statistic_ab2.sql new file mode 100644 index 0000000..52c853e --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/teams_statistic_ab2.sql @@ -0,0 +1,40 @@ +{{ 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('teams_statistic_ab1') }} +select + _airbyte_teams_hashid, + cast(sales as {{ dbt_utils.type_float() }}) as sales, + cast(membertotal as {{ dbt_utils.type_float() }}) as membertotal, + cast(lastmonthsales as {{ dbt_utils.type_float() }}) as lastmonthsales, + cast(thismonthsales as {{ dbt_utils.type_float() }}) as thismonthsales, + cast(transactiontotal as {{ dbt_utils.type_float() }}) as transactiontotal, + cast(transactionpending as {{ dbt_utils.type_float() }}) as transactionpending, + cast(transactionsuccess as {{ dbt_utils.type_float() }}) as transactionsuccess, + cast(transactionrejected as {{ dbt_utils.type_float() }}) as transactionrejected, + cast(cashtransactiontotal as {{ dbt_utils.type_float() }}) as cashtransactiontotal, + cast(membertotalremaining as {{ dbt_utils.type_float() }}) as membertotalremaining, + cast(transactiondelivered as {{ dbt_utils.type_float() }}) as transactiondelivered, + cast(transactiondelivering as {{ dbt_utils.type_float() }}) as transactiondelivering, + cast(cashtransactionpending as {{ dbt_utils.type_float() }}) as cashtransactionpending, + cast(cashtransactionsuccess as {{ dbt_utils.type_float() }}) as cashtransactionsuccess, + cast(cashtransactionrejected as {{ dbt_utils.type_float() }}) as cashtransactionrejected, + cast(cashtransactiondelivered as {{ dbt_utils.type_float() }}) as cashtransactiondelivered, + cast(cashtransactiondelivering as {{ dbt_utils.type_float() }}) as cashtransactiondelivering, + cast(transactionwaitingapprove as {{ dbt_utils.type_float() }}) as transactionwaitingapprove, + cast(transactionpaymentprocessing as {{ dbt_utils.type_float() }}) as transactionpaymentprocessing, + cast(cashtransactionwaitingapprove as {{ dbt_utils.type_float() }}) as cashtransactionwaitingapprove, + cast(thismonthsale_aibyte_transform as {{ dbt_utils.type_string() }}) as thismonthsale_aibyte_transform, + cast(vipmembertotal_aibyte_transform as {{ dbt_utils.type_string() }}) as vipmembertotal_aibyte_transform, + cast(cashtransactionpaymentprocessing as {{ dbt_utils.type_float() }}) as cashtransactionpaymentprocessing, + cast(memberrequesttotalpending_aibyte_transform as {{ dbt_utils.type_string() }}) as memberrequesttotalpending_aibyte_transform, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('teams_statistic_ab1') }} +-- statistic at teams/statistic +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/teams_statistic_ab3.sql b/models/generated/airbyte_ctes/unibag/teams_statistic_ab3.sql new file mode 100644 index 0000000..f4a28a3 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/teams_statistic_ab3.sql @@ -0,0 +1,40 @@ +{{ 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('teams_statistic_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_teams_hashid', + 'sales', + 'membertotal', + 'lastmonthsales', + 'thismonthsales', + 'transactiontotal', + 'transactionpending', + 'transactionsuccess', + 'transactionrejected', + 'cashtransactiontotal', + 'membertotalremaining', + 'transactiondelivered', + 'transactiondelivering', + 'cashtransactionpending', + 'cashtransactionsuccess', + 'cashtransactionrejected', + 'cashtransactiondelivered', + 'cashtransactiondelivering', + 'transactionwaitingapprove', + 'transactionpaymentprocessing', + 'cashtransactionwaitingapprove', + 'thismonthsale_aibyte_transform', + 'vipmembertotal_aibyte_transform', + 'cashtransactionpaymentprocessing', + 'memberrequesttotalpending_aibyte_transform', + ]) }} as _airbyte_statistic_hashid, + tmp.* +from {{ ref('teams_statistic_ab2') }} tmp +-- statistic at teams/statistic +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/user_identifications__ation_addressentities_ab1.sql b/models/generated/airbyte_ctes/unibag/user_identifications__ation_addressentities_ab1.sql new file mode 100644 index 0000000..bfe78d3 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/user_identifications__ation_addressentities_ab1.sql @@ -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('user_identifications_detectinformation') }} +select + _airbyte_detectinformation_hashid, + {{ json_extract_scalar('addressentities', ['ward'], ['ward']) }} as ward, + {{ json_extract_scalar('addressentities', ['street'], ['street']) }} as street, + {{ json_extract_scalar('addressentities', ['district'], ['district']) }} as district, + {{ json_extract_scalar('addressentities', ['province'], ['province']) }} as province, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('user_identifications_detectinformation') }} as table_alias +-- addressentities at user-identifications/detectInformation/addressEntities +where 1 = 1 +and addressentities is not null + diff --git a/models/generated/airbyte_ctes/unibag/user_identifications__ation_addressentities_ab2.sql b/models/generated/airbyte_ctes/unibag/user_identifications__ation_addressentities_ab2.sql new file mode 100644 index 0000000..17352c7 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/user_identifications__ation_addressentities_ab2.sql @@ -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('user_identifications__ation_addressentities_ab1') }} +select + _airbyte_detectinformation_hashid, + cast(ward as {{ dbt_utils.type_string() }}) as ward, + cast(street as {{ dbt_utils.type_string() }}) as street, + cast(district as {{ dbt_utils.type_string() }}) as district, + cast(province as {{ dbt_utils.type_string() }}) as province, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('user_identifications__ation_addressentities_ab1') }} +-- addressentities at user-identifications/detectInformation/addressEntities +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/user_identifications__ation_addressentities_ab3.sql b/models/generated/airbyte_ctes/unibag/user_identifications__ation_addressentities_ab3.sql new file mode 100644 index 0000000..2ba4967 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/user_identifications__ation_addressentities_ab3.sql @@ -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('user_identifications__ation_addressentities_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_detectinformation_hashid', + 'ward', + 'street', + 'district', + 'province', + ]) }} as _airbyte_addressentities_hashid, + tmp.* +from {{ ref('user_identifications__ation_addressentities_ab2') }} tmp +-- addressentities at user-identifications/detectInformation/addressEntities +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/user_identifications__ontside_dimensions_md_ab1.sql b/models/generated/airbyte_ctes/unibag/user_identifications__ontside_dimensions_md_ab1.sql new file mode 100644 index 0000000..28a46c2 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/user_identifications__ontside_dimensions_md_ab1.sql @@ -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('user_identifications_frontside_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('user_identifications_frontside_dimensions') }} as table_alias +-- md at user-identifications/frontSide/dimensions/md +where 1 = 1 +and md is not null + diff --git a/models/generated/airbyte_ctes/unibag/user_identifications__ontside_dimensions_md_ab2.sql b/models/generated/airbyte_ctes/unibag/user_identifications__ontside_dimensions_md_ab2.sql new file mode 100644 index 0000000..3b66b4c --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/user_identifications__ontside_dimensions_md_ab2.sql @@ -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('user_identifications__ontside_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('user_identifications__ontside_dimensions_md_ab1') }} +-- md at user-identifications/frontSide/dimensions/md +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/user_identifications__ontside_dimensions_md_ab3.sql b/models/generated/airbyte_ctes/unibag/user_identifications__ontside_dimensions_md_ab3.sql new file mode 100644 index 0000000..f5b9ada --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/user_identifications__ontside_dimensions_md_ab3.sql @@ -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('user_identifications__ontside_dimensions_md_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_dimensions_hashid', + 'url', + 'width', + 'height', + ]) }} as _airbyte_md_hashid, + tmp.* +from {{ ref('user_identifications__ontside_dimensions_md_ab2') }} tmp +-- md at user-identifications/frontSide/dimensions/md +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/user_identifications__ontside_dimensions_sm_ab1.sql b/models/generated/airbyte_ctes/unibag/user_identifications__ontside_dimensions_sm_ab1.sql new file mode 100644 index 0000000..8faa033 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/user_identifications__ontside_dimensions_sm_ab1.sql @@ -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('user_identifications_frontside_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('user_identifications_frontside_dimensions') }} as table_alias +-- sm at user-identifications/frontSide/dimensions/sm +where 1 = 1 +and sm is not null + diff --git a/models/generated/airbyte_ctes/unibag/user_identifications__ontside_dimensions_sm_ab2.sql b/models/generated/airbyte_ctes/unibag/user_identifications__ontside_dimensions_sm_ab2.sql new file mode 100644 index 0000000..2f6ead9 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/user_identifications__ontside_dimensions_sm_ab2.sql @@ -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('user_identifications__ontside_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('user_identifications__ontside_dimensions_sm_ab1') }} +-- sm at user-identifications/frontSide/dimensions/sm +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/user_identifications__ontside_dimensions_sm_ab3.sql b/models/generated/airbyte_ctes/unibag/user_identifications__ontside_dimensions_sm_ab3.sql new file mode 100644 index 0000000..8dec589 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/user_identifications__ontside_dimensions_sm_ab3.sql @@ -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('user_identifications__ontside_dimensions_sm_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_dimensions_hashid', + 'url', + 'width', + 'height', + ]) }} as _airbyte_sm_hashid, + tmp.* +from {{ ref('user_identifications__ontside_dimensions_sm_ab2') }} tmp +-- sm at user-identifications/frontSide/dimensions/sm +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/user_identifications_ab1.sql b/models/generated/airbyte_ctes/unibag/user_identifications_ab1.sql index 54c9bb1..d3a6e3c 100644 --- a/models/generated/airbyte_ctes/unibag/user_identifications_ab1.sql +++ b/models/generated/airbyte_ctes/unibag/user_identifications_ab1.sql @@ -18,17 +18,16 @@ select {{ json_extract_scalar('_airbyte_data', ['number'], ['number']) }} as {{ adapter.quote('number') }}, {{ json_extract_scalar('_airbyte_data', ['status'], ['status']) }} as status, {{ json_extract_scalar('_airbyte_data', ['address'], ['address']) }} as address, - {{ json_extract_scalar('_airbyte_data', ['dobDate'], ['dobDate']) }} as dobdate, - {{ json_extract_scalar('_airbyte_data', ['backSide'], ['backSide']) }} as backside, + {{ json_extract('table_alias', '_airbyte_data', ['backSide'], ['backSide']) }} as backside, {{ json_extract_scalar('_airbyte_data', ['birthday'], ['birthday']) }} as birthday, {{ json_extract_scalar('_airbyte_data', ['createdAt'], ['createdAt']) }} as createdat, - {{ json_extract_scalar('_airbyte_data', ['frontSide'], ['frontSide']) }} as frontside, + {{ json_extract('table_alias', '_airbyte_data', ['frontSide'], ['frontSide']) }} as frontside, {{ json_extract_scalar('_airbyte_data', ['issueDate'], ['issueDate']) }} as issuedate, {{ json_extract_scalar('_airbyte_data', ['updatedAt'], ['updatedAt']) }} as updatedat, {{ json_extract_scalar('_airbyte_data', ['expiryDate'], ['expiryDate']) }} as expirydate, {{ json_extract_scalar('_airbyte_data', ['issuePlace'], ['issuePlace']) }} as issueplace, {{ json_extract_scalar('_airbyte_data', ['timeUpdate'], ['timeUpdate']) }} as timeupdate, - {{ json_extract_scalar('_airbyte_data', ['detectInformation'], ['detectInformation']) }} as detectinformation, + {{ json_extract('table_alias', '_airbyte_data', ['detectInformation'], ['detectInformation']) }} as detectinformation, _airbyte_ab_id, _airbyte_emitted_at, {{ current_timestamp() }} as _airbyte_normalized_at diff --git a/models/generated/airbyte_ctes/unibag/user_identifications_ab2.sql b/models/generated/airbyte_ctes/unibag/user_identifications_ab2.sql index 1fcdceb..6faad4f 100644 --- a/models/generated/airbyte_ctes/unibag/user_identifications_ab2.sql +++ b/models/generated/airbyte_ctes/unibag/user_identifications_ab2.sql @@ -18,17 +18,16 @@ select cast({{ adapter.quote('number') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('number') }}, cast(status as {{ dbt_utils.type_string() }}) as status, cast(address as {{ dbt_utils.type_string() }}) as address, - cast(dobdate as {{ dbt_utils.type_string() }}) as dobdate, - cast(backside as {{ dbt_utils.type_string() }}) as backside, + cast(backside as {{ type_json() }}) as backside, cast(birthday as {{ dbt_utils.type_string() }}) as birthday, cast(createdat as {{ dbt_utils.type_string() }}) as createdat, - cast(frontside as {{ dbt_utils.type_string() }}) as frontside, + cast(frontside as {{ type_json() }}) as frontside, cast(issuedate as {{ dbt_utils.type_string() }}) as issuedate, cast(updatedat as {{ dbt_utils.type_string() }}) as updatedat, cast(expirydate as {{ dbt_utils.type_string() }}) as expirydate, cast(issueplace as {{ dbt_utils.type_string() }}) as issueplace, cast(timeupdate as {{ dbt_utils.type_float() }}) as timeupdate, - cast(detectinformation as {{ dbt_utils.type_string() }}) as detectinformation, + cast(detectinformation as {{ type_json() }}) as detectinformation, _airbyte_ab_id, _airbyte_emitted_at, {{ current_timestamp() }} as _airbyte_normalized_at diff --git a/models/generated/airbyte_ctes/unibag/user_identifications_ab3.sql b/models/generated/airbyte_ctes/unibag/user_identifications_ab3.sql index e406266..92f44c6 100644 --- a/models/generated/airbyte_ctes/unibag/user_identifications_ab3.sql +++ b/models/generated/airbyte_ctes/unibag/user_identifications_ab3.sql @@ -19,17 +19,16 @@ select adapter.quote('number'), 'status', 'address', - 'dobdate', - 'backside', + object_to_string('backside'), 'birthday', 'createdat', - 'frontside', + object_to_string('frontside'), 'issuedate', 'updatedat', 'expirydate', 'issueplace', 'timeupdate', - 'detectinformation', + object_to_string('detectinformation'), ]) }} as _airbyte_user_identifications_hashid, tmp.* from {{ ref('user_identifications_ab2') }} tmp diff --git a/models/generated/airbyte_ctes/unibag/user_identifications_backside_ab1.sql b/models/generated/airbyte_ctes/unibag/user_identifications_backside_ab1.sql new file mode 100644 index 0000000..b1d126e --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/user_identifications_backside_ab1.sql @@ -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('user_identifications') }} +select + _airbyte_user_identifications_hashid, + {{ json_extract_scalar('backside', ['_id'], ['_id']) }} as _id, + {{ json_extract_scalar('backside', ['name'], ['name']) }} as {{ adapter.quote('name') }}, + {{ json_extract('table_alias', 'backside', ['dimensions'], ['dimensions']) }} as dimensions, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('user_identifications') }} as table_alias +-- backside at user-identifications/backSide +where 1 = 1 +and backside is not null + diff --git a/models/generated/airbyte_ctes/unibag/user_identifications_backside_ab2.sql b/models/generated/airbyte_ctes/unibag/user_identifications_backside_ab2.sql new file mode 100644 index 0000000..515d105 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/user_identifications_backside_ab2.sql @@ -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('user_identifications_backside_ab1') }} +select + _airbyte_user_identifications_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('user_identifications_backside_ab1') }} +-- backside at user-identifications/backSide +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/user_identifications_backside_ab3.sql b/models/generated/airbyte_ctes/unibag/user_identifications_backside_ab3.sql new file mode 100644 index 0000000..ecf5fe3 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/user_identifications_backside_ab3.sql @@ -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('user_identifications_backside_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_user_identifications_hashid', + '_id', + adapter.quote('name'), + object_to_string('dimensions'), + ]) }} as _airbyte_backside_hashid, + tmp.* +from {{ ref('user_identifications_backside_ab2') }} tmp +-- backside at user-identifications/backSide +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/user_identifications_backside_dimensions_ab1.sql b/models/generated/airbyte_ctes/unibag/user_identifications_backside_dimensions_ab1.sql new file mode 100644 index 0000000..af80381 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/user_identifications_backside_dimensions_ab1.sql @@ -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('user_identifications_backside') }} +select + _airbyte_backside_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('user_identifications_backside') }} as table_alias +-- dimensions at user-identifications/backSide/dimensions +where 1 = 1 +and dimensions is not null + diff --git a/models/generated/airbyte_ctes/unibag/user_identifications_backside_dimensions_ab2.sql b/models/generated/airbyte_ctes/unibag/user_identifications_backside_dimensions_ab2.sql new file mode 100644 index 0000000..d5d9b48 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/user_identifications_backside_dimensions_ab2.sql @@ -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('user_identifications_backside_dimensions_ab1') }} +select + _airbyte_backside_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('user_identifications_backside_dimensions_ab1') }} +-- dimensions at user-identifications/backSide/dimensions +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/user_identifications_backside_dimensions_ab3.sql b/models/generated/airbyte_ctes/unibag/user_identifications_backside_dimensions_ab3.sql new file mode 100644 index 0000000..560a9d0 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/user_identifications_backside_dimensions_ab3.sql @@ -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('user_identifications_backside_dimensions_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_backside_hashid', + object_to_string('md'), + object_to_string('sm'), + ]) }} as _airbyte_dimensions_hashid, + tmp.* +from {{ ref('user_identifications_backside_dimensions_ab2') }} tmp +-- dimensions at user-identifications/backSide/dimensions +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/user_identifications_backside_dimensions_md_ab1.sql b/models/generated/airbyte_ctes/unibag/user_identifications_backside_dimensions_md_ab1.sql new file mode 100644 index 0000000..0b4e8c8 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/user_identifications_backside_dimensions_md_ab1.sql @@ -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('user_identifications_backside_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('user_identifications_backside_dimensions') }} as table_alias +-- md at user-identifications/backSide/dimensions/md +where 1 = 1 +and md is not null + diff --git a/models/generated/airbyte_ctes/unibag/user_identifications_backside_dimensions_md_ab2.sql b/models/generated/airbyte_ctes/unibag/user_identifications_backside_dimensions_md_ab2.sql new file mode 100644 index 0000000..483cb0f --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/user_identifications_backside_dimensions_md_ab2.sql @@ -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('user_identifications_backside_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('user_identifications_backside_dimensions_md_ab1') }} +-- md at user-identifications/backSide/dimensions/md +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/user_identifications_backside_dimensions_md_ab3.sql b/models/generated/airbyte_ctes/unibag/user_identifications_backside_dimensions_md_ab3.sql new file mode 100644 index 0000000..63764de --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/user_identifications_backside_dimensions_md_ab3.sql @@ -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('user_identifications_backside_dimensions_md_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_dimensions_hashid', + 'url', + 'width', + 'height', + ]) }} as _airbyte_md_hashid, + tmp.* +from {{ ref('user_identifications_backside_dimensions_md_ab2') }} tmp +-- md at user-identifications/backSide/dimensions/md +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/user_identifications_backside_dimensions_sm_ab1.sql b/models/generated/airbyte_ctes/unibag/user_identifications_backside_dimensions_sm_ab1.sql new file mode 100644 index 0000000..ecdb4e0 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/user_identifications_backside_dimensions_sm_ab1.sql @@ -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('user_identifications_backside_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('user_identifications_backside_dimensions') }} as table_alias +-- sm at user-identifications/backSide/dimensions/sm +where 1 = 1 +and sm is not null + diff --git a/models/generated/airbyte_ctes/unibag/user_identifications_backside_dimensions_sm_ab2.sql b/models/generated/airbyte_ctes/unibag/user_identifications_backside_dimensions_sm_ab2.sql new file mode 100644 index 0000000..4c51dcc --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/user_identifications_backside_dimensions_sm_ab2.sql @@ -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('user_identifications_backside_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('user_identifications_backside_dimensions_sm_ab1') }} +-- sm at user-identifications/backSide/dimensions/sm +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/user_identifications_backside_dimensions_sm_ab3.sql b/models/generated/airbyte_ctes/unibag/user_identifications_backside_dimensions_sm_ab3.sql new file mode 100644 index 0000000..3426a7e --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/user_identifications_backside_dimensions_sm_ab3.sql @@ -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('user_identifications_backside_dimensions_sm_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_dimensions_hashid', + 'url', + 'width', + 'height', + ]) }} as _airbyte_sm_hashid, + tmp.* +from {{ ref('user_identifications_backside_dimensions_sm_ab2') }} tmp +-- sm at user-identifications/backSide/dimensions/sm +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/user_identifications_detectinformation_ab1.sql b/models/generated/airbyte_ctes/unibag/user_identifications_detectinformation_ab1.sql new file mode 100644 index 0000000..8f5c094 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/user_identifications_detectinformation_ab1.sql @@ -0,0 +1,37 @@ +{{ 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('user_identifications') }} +select + _airbyte_user_identifications_hashid, + {{ json_extract_scalar('detectinformation', ['id'], ['id']) }} as {{ adapter.quote('id') }}, + {{ json_extract_scalar('detectinformation', ['dob'], ['dob']) }} as dob, + {{ json_extract_scalar('detectinformation', ['doe'], ['doe']) }} as doe, + {{ json_extract_scalar('detectinformation', ['sex'], ['sex']) }} as sex, + {{ json_extract_scalar('detectinformation', ['home'], ['home']) }} as home, + {{ json_extract_scalar('detectinformation', ['name'], ['name']) }} as {{ adapter.quote('name') }}, + {{ json_extract_scalar('detectinformation', ['type'], ['type']) }} as {{ adapter.quote('type') }}, + {{ json_extract_scalar('detectinformation', ['idProb'], ['idProb']) }} as idprob, + {{ json_extract_scalar('detectinformation', ['address'], ['address']) }} as address, + {{ json_extract_scalar('detectinformation', ['dobProb'], ['dobProb']) }} as dobprob, + {{ json_extract_scalar('detectinformation', ['doeProb'], ['doeProb']) }} as doeprob, + {{ json_extract_scalar('detectinformation', ['sexProb'], ['sexProb']) }} as sexprob, + {{ json_extract_scalar('detectinformation', ['typeNew'], ['typeNew']) }} as typenew, + {{ json_extract_scalar('detectinformation', ['homeProb'], ['homeProb']) }} as homeprob, + {{ json_extract_scalar('detectinformation', ['nameProb'], ['nameProb']) }} as nameprob, + {{ json_extract_scalar('detectinformation', ['addressProb'], ['addressProb']) }} as addressprob, + {{ json_extract_scalar('detectinformation', ['nationality'], ['nationality']) }} as nationality, + {{ json_extract_scalar('detectinformation', ['overallScore'], ['overallScore']) }} as overallscore, + {{ json_extract('table_alias', 'detectinformation', ['addressEntities'], ['addressEntities']) }} as addressentities, + {{ json_extract_scalar('detectinformation', ['nationalityProb'], ['nationalityProb']) }} as nationalityprob, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('user_identifications') }} as table_alias +-- detectinformation at user-identifications/detectInformation +where 1 = 1 +and detectinformation is not null + diff --git a/models/generated/airbyte_ctes/unibag/user_identifications_detectinformation_ab2.sql b/models/generated/airbyte_ctes/unibag/user_identifications_detectinformation_ab2.sql new file mode 100644 index 0000000..3257c84 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/user_identifications_detectinformation_ab2.sql @@ -0,0 +1,36 @@ +{{ 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('user_identifications_detectinformation_ab1') }} +select + _airbyte_user_identifications_hashid, + cast({{ adapter.quote('id') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('id') }}, + cast(dob as {{ dbt_utils.type_string() }}) as dob, + cast(doe as {{ dbt_utils.type_string() }}) as doe, + cast(sex as {{ dbt_utils.type_string() }}) as sex, + cast(home as {{ dbt_utils.type_string() }}) as home, + 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(idprob as {{ dbt_utils.type_string() }}) as idprob, + cast(address as {{ dbt_utils.type_string() }}) as address, + cast(dobprob as {{ dbt_utils.type_string() }}) as dobprob, + cast(doeprob as {{ dbt_utils.type_string() }}) as doeprob, + cast(sexprob as {{ dbt_utils.type_string() }}) as sexprob, + cast(typenew as {{ dbt_utils.type_string() }}) as typenew, + cast(homeprob as {{ dbt_utils.type_string() }}) as homeprob, + cast(nameprob as {{ dbt_utils.type_string() }}) as nameprob, + cast(addressprob as {{ dbt_utils.type_string() }}) as addressprob, + cast(nationality as {{ dbt_utils.type_string() }}) as nationality, + cast(overallscore as {{ dbt_utils.type_string() }}) as overallscore, + cast(addressentities as {{ type_json() }}) as addressentities, + cast(nationalityprob as {{ dbt_utils.type_string() }}) as nationalityprob, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('user_identifications_detectinformation_ab1') }} +-- detectinformation at user-identifications/detectInformation +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/user_identifications_detectinformation_ab3.sql b/models/generated/airbyte_ctes/unibag/user_identifications_detectinformation_ab3.sql new file mode 100644 index 0000000..2d2791f --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/user_identifications_detectinformation_ab3.sql @@ -0,0 +1,36 @@ +{{ 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('user_identifications_detectinformation_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_user_identifications_hashid', + adapter.quote('id'), + 'dob', + 'doe', + 'sex', + 'home', + adapter.quote('name'), + adapter.quote('type'), + 'idprob', + 'address', + 'dobprob', + 'doeprob', + 'sexprob', + 'typenew', + 'homeprob', + 'nameprob', + 'addressprob', + 'nationality', + 'overallscore', + object_to_string('addressentities'), + 'nationalityprob', + ]) }} as _airbyte_detectinformation_hashid, + tmp.* +from {{ ref('user_identifications_detectinformation_ab2') }} tmp +-- detectinformation at user-identifications/detectInformation +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/user_identifications_frontside_ab1.sql b/models/generated/airbyte_ctes/unibag/user_identifications_frontside_ab1.sql new file mode 100644 index 0000000..11ef103 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/user_identifications_frontside_ab1.sql @@ -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('user_identifications') }} +select + _airbyte_user_identifications_hashid, + {{ json_extract_scalar('frontside', ['_id'], ['_id']) }} as _id, + {{ json_extract_scalar('frontside', ['name'], ['name']) }} as {{ adapter.quote('name') }}, + {{ json_extract('table_alias', 'frontside', ['dimensions'], ['dimensions']) }} as dimensions, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('user_identifications') }} as table_alias +-- frontside at user-identifications/frontSide +where 1 = 1 +and frontside is not null + diff --git a/models/generated/airbyte_ctes/unibag/user_identifications_frontside_ab2.sql b/models/generated/airbyte_ctes/unibag/user_identifications_frontside_ab2.sql new file mode 100644 index 0000000..aa5a4ec --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/user_identifications_frontside_ab2.sql @@ -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('user_identifications_frontside_ab1') }} +select + _airbyte_user_identifications_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('user_identifications_frontside_ab1') }} +-- frontside at user-identifications/frontSide +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/user_identifications_frontside_ab3.sql b/models/generated/airbyte_ctes/unibag/user_identifications_frontside_ab3.sql new file mode 100644 index 0000000..d773420 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/user_identifications_frontside_ab3.sql @@ -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('user_identifications_frontside_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_user_identifications_hashid', + '_id', + adapter.quote('name'), + object_to_string('dimensions'), + ]) }} as _airbyte_frontside_hashid, + tmp.* +from {{ ref('user_identifications_frontside_ab2') }} tmp +-- frontside at user-identifications/frontSide +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/user_identifications_frontside_dimensions_ab1.sql b/models/generated/airbyte_ctes/unibag/user_identifications_frontside_dimensions_ab1.sql new file mode 100644 index 0000000..2d6409e --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/user_identifications_frontside_dimensions_ab1.sql @@ -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('user_identifications_frontside') }} +select + _airbyte_frontside_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('user_identifications_frontside') }} as table_alias +-- dimensions at user-identifications/frontSide/dimensions +where 1 = 1 +and dimensions is not null + diff --git a/models/generated/airbyte_ctes/unibag/user_identifications_frontside_dimensions_ab2.sql b/models/generated/airbyte_ctes/unibag/user_identifications_frontside_dimensions_ab2.sql new file mode 100644 index 0000000..dd3dd44 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/user_identifications_frontside_dimensions_ab2.sql @@ -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('user_identifications_frontside_dimensions_ab1') }} +select + _airbyte_frontside_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('user_identifications_frontside_dimensions_ab1') }} +-- dimensions at user-identifications/frontSide/dimensions +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/user_identifications_frontside_dimensions_ab3.sql b/models/generated/airbyte_ctes/unibag/user_identifications_frontside_dimensions_ab3.sql new file mode 100644 index 0000000..05f3d03 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/user_identifications_frontside_dimensions_ab3.sql @@ -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('user_identifications_frontside_dimensions_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_frontside_hashid', + object_to_string('md'), + object_to_string('sm'), + ]) }} as _airbyte_dimensions_hashid, + tmp.* +from {{ ref('user_identifications_frontside_dimensions_ab2') }} tmp +-- dimensions at user-identifications/frontSide/dimensions +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/users_ab1.sql b/models/generated/airbyte_ctes/unibag/users_ab1.sql index 8327097..7ee4590 100644 --- a/models/generated/airbyte_ctes/unibag/users_ab1.sql +++ b/models/generated/airbyte_ctes/unibag/users_ab1.sql @@ -9,30 +9,27 @@ select {{ json_extract_scalar('_airbyte_data', ['_id'], ['_id']) }} as _id, {{ json_extract_scalar('_airbyte_data', ['code'], ['code']) }} as code, - {{ 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', ['team'], ['team']) }} as team, - {{ json_extract_scalar('_airbyte_data', ['zalo'], ['zalo']) }} as zalo, - {{ json_extract_scalar('_airbyte_data', ['email'], ['email']) }} as email, - {{ json_extract_scalar('_airbyte_data', ['phone'], ['phone']) }} as phone, - {{ json_extract_scalar('_airbyte_data', ['avatar'], ['avatar']) }} as avatar, + {{ json_extract('table_alias', '_airbyte_data', ['team'], ['team']) }} as team, + {{ json_extract('table_alias', '_airbyte_data', ['zalo'], ['zalo']) }} as zalo, + {{ json_extract('table_alias', '_airbyte_data', ['email'], ['email']) }} as email, + {{ json_extract('table_alias', '_airbyte_data', ['phone'], ['phone']) }} as phone, + {{ json_extract('table_alias', '_airbyte_data', ['avatar'], ['avatar']) }} as avatar, {{ json_extract_scalar('_airbyte_data', ['banned'], ['banned']) }} as banned, {{ json_extract_scalar('_airbyte_data', ['segment'], ['segment']) }} as segment, - {{ json_extract_scalar('_airbyte_data', ['facebook'], ['facebook']) }} as facebook, + {{ json_extract('table_alias', '_airbyte_data', ['facebook'], ['facebook']) }} as facebook, {{ json_extract_scalar('_airbyte_data', ['hasOrder'], ['hasOrder']) }} as hasorder, - {{ json_extract_scalar('_airbyte_data', ['referral'], ['referral']) }} as referral, + {{ json_extract('table_alias', '_airbyte_data', ['referral'], ['referral']) }} as referral, {{ json_extract_array('_airbyte_data', ['segments'], ['segments']) }} as segments, {{ json_extract_scalar('_airbyte_data', ['createdAt'], ['createdAt']) }} as createdat, - {{ 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', ['membership'], ['membership']) }} as membership, - {{ json_extract_scalar('_airbyte_data', ['lastOrderAt'], ['lastOrderAt']) }} as lastorderat, - {{ json_extract_scalar('_airbyte_data', ['firstOrderAt'], ['firstOrderAt']) }} as firstorderat, + {{ json_extract('table_alias', '_airbyte_data', ['membership'], ['membership']) }} as membership, {{ json_extract_scalar('_airbyte_data', ['registerFrom'], ['registerFrom']) }} as registerfrom, {{ json_extract_scalar('_airbyte_data', ['searchString'], ['searchString']) }} as searchstring, - {{ json_extract_scalar('_airbyte_data', ['adjustTracker'], ['adjustTracker']) }} as adjusttracker, {{ json_extract_scalar('_airbyte_data', ['isUpdatedInfo'], ['isUpdatedInfo']) }} as isupdatedinfo, - {{ json_extract_scalar('_airbyte_data', ['identification'], ['identification']) }} as identification, + {{ json_extract('table_alias', '_airbyte_data', ['identification'], ['identification']) }} as identification, {{ json_extract_scalar('_airbyte_data', ['lastActivatedAt'], ['lastActivatedAt']) }} as lastactivatedat, {{ json_extract_scalar('_airbyte_data', ['lastViewNotificationAt'], ['lastViewNotificationAt']) }} as lastviewnotificationat, _airbyte_ab_id, diff --git a/models/generated/airbyte_ctes/unibag/users_ab2.sql b/models/generated/airbyte_ctes/unibag/users_ab2.sql index b3e92a0..3863189 100644 --- a/models/generated/airbyte_ctes/unibag/users_ab2.sql +++ b/models/generated/airbyte_ctes/unibag/users_ab2.sql @@ -9,30 +9,27 @@ select cast(_id as {{ dbt_utils.type_string() }}) as _id, cast(code as {{ dbt_utils.type_string() }}) as code, - 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(team as {{ dbt_utils.type_string() }}) as team, - cast(zalo as {{ dbt_utils.type_string() }}) as zalo, - cast(email as {{ dbt_utils.type_string() }}) as email, - cast(phone as {{ dbt_utils.type_string() }}) as phone, - cast(avatar as {{ dbt_utils.type_string() }}) as avatar, + cast(team as {{ type_json() }}) as team, + cast(zalo as {{ type_json() }}) as zalo, + cast(email as {{ type_json() }}) as email, + cast(phone as {{ type_json() }}) as phone, + cast(avatar as {{ type_json() }}) as avatar, {{ cast_to_boolean('banned') }} as banned, cast(segment as {{ dbt_utils.type_string() }}) as segment, - cast(facebook as {{ dbt_utils.type_string() }}) as facebook, + cast(facebook as {{ type_json() }}) as facebook, {{ cast_to_boolean('hasorder') }} as hasorder, - cast(referral as {{ dbt_utils.type_string() }}) as referral, + cast(referral as {{ type_json() }}) as referral, segments, cast(createdat as {{ dbt_utils.type_string() }}) as createdat, - 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(membership as {{ dbt_utils.type_string() }}) as membership, - cast(lastorderat as {{ dbt_utils.type_string() }}) as lastorderat, - cast(firstorderat as {{ dbt_utils.type_string() }}) as firstorderat, + cast(membership as {{ type_json() }}) as membership, cast(registerfrom as {{ dbt_utils.type_string() }}) as registerfrom, cast(searchstring as {{ dbt_utils.type_string() }}) as searchstring, - cast(adjusttracker as {{ dbt_utils.type_string() }}) as adjusttracker, {{ cast_to_boolean('isupdatedinfo') }} as isupdatedinfo, - cast(identification as {{ dbt_utils.type_string() }}) as identification, + cast(identification as {{ type_json() }}) as identification, cast(lastactivatedat as {{ dbt_utils.type_string() }}) as lastactivatedat, cast(lastviewnotificationat as {{ dbt_utils.type_string() }}) as lastviewnotificationat, _airbyte_ab_id, diff --git a/models/generated/airbyte_ctes/unibag/users_ab3.sql b/models/generated/airbyte_ctes/unibag/users_ab3.sql index 1f54025..1f9153c 100644 --- a/models/generated/airbyte_ctes/unibag/users_ab3.sql +++ b/models/generated/airbyte_ctes/unibag/users_ab3.sql @@ -10,30 +10,27 @@ select {{ dbt_utils.surrogate_key([ '_id', 'code', - 'info', + object_to_string('info'), adapter.quote('name'), - 'team', - 'zalo', - 'email', - 'phone', - 'avatar', + object_to_string('team'), + object_to_string('zalo'), + object_to_string('email'), + object_to_string('phone'), + object_to_string('avatar'), boolean_to_string('banned'), 'segment', - 'facebook', + object_to_string('facebook'), boolean_to_string('hasorder'), - 'referral', + object_to_string('referral'), array_to_string('segments'), 'createdat', - 'statistic', + object_to_string('statistic'), 'updatedat', - 'membership', - 'lastorderat', - 'firstorderat', + object_to_string('membership'), 'registerfrom', 'searchstring', - 'adjusttracker', boolean_to_string('isupdatedinfo'), - 'identification', + object_to_string('identification'), 'lastactivatedat', 'lastviewnotificationat', ]) }} as _airbyte_users_hashid, diff --git a/models/generated/airbyte_ctes/unibag/users_avatar_ab1.sql b/models/generated/airbyte_ctes/unibag/users_avatar_ab1.sql new file mode 100644 index 0000000..a38c3be --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/users_avatar_ab1.sql @@ -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('users') }} +select + _airbyte_users_hashid, + {{ json_extract_scalar('avatar', ['_id'], ['_id']) }} as _id, + {{ json_extract_scalar('avatar', ['name'], ['name']) }} as {{ adapter.quote('name') }}, + {{ json_extract('table_alias', 'avatar', ['dimensions'], ['dimensions']) }} as dimensions, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('users') }} as table_alias +-- avatar at users/avatar +where 1 = 1 +and avatar is not null + diff --git a/models/generated/airbyte_ctes/unibag/users_avatar_ab2.sql b/models/generated/airbyte_ctes/unibag/users_avatar_ab2.sql new file mode 100644 index 0000000..6b79d73 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/users_avatar_ab2.sql @@ -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('users_avatar_ab1') }} +select + _airbyte_users_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('users_avatar_ab1') }} +-- avatar at users/avatar +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/users_avatar_ab3.sql b/models/generated/airbyte_ctes/unibag/users_avatar_ab3.sql new file mode 100644 index 0000000..05c06f9 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/users_avatar_ab3.sql @@ -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('users_avatar_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_users_hashid', + '_id', + adapter.quote('name'), + object_to_string('dimensions'), + ]) }} as _airbyte_avatar_hashid, + tmp.* +from {{ ref('users_avatar_ab2') }} tmp +-- avatar at users/avatar +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/users_avatar_dimensions_ab1.sql b/models/generated/airbyte_ctes/unibag/users_avatar_dimensions_ab1.sql new file mode 100644 index 0000000..3c48940 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/users_avatar_dimensions_ab1.sql @@ -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('users_avatar') }} +select + _airbyte_avatar_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('users_avatar') }} as table_alias +-- dimensions at users/avatar/dimensions +where 1 = 1 +and dimensions is not null + diff --git a/models/generated/airbyte_ctes/unibag/users_avatar_dimensions_ab2.sql b/models/generated/airbyte_ctes/unibag/users_avatar_dimensions_ab2.sql new file mode 100644 index 0000000..634715b --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/users_avatar_dimensions_ab2.sql @@ -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('users_avatar_dimensions_ab1') }} +select + _airbyte_avatar_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('users_avatar_dimensions_ab1') }} +-- dimensions at users/avatar/dimensions +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/users_avatar_dimensions_ab3.sql b/models/generated/airbyte_ctes/unibag/users_avatar_dimensions_ab3.sql new file mode 100644 index 0000000..35fafa8 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/users_avatar_dimensions_ab3.sql @@ -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('users_avatar_dimensions_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_avatar_hashid', + object_to_string('md'), + object_to_string('sm'), + ]) }} as _airbyte_dimensions_hashid, + tmp.* +from {{ ref('users_avatar_dimensions_ab2') }} tmp +-- dimensions at users/avatar/dimensions +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/users_avatar_dimensions_md_ab1.sql b/models/generated/airbyte_ctes/unibag/users_avatar_dimensions_md_ab1.sql new file mode 100644 index 0000000..ebebf0d --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/users_avatar_dimensions_md_ab1.sql @@ -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('users_avatar_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('users_avatar_dimensions') }} as table_alias +-- md at users/avatar/dimensions/md +where 1 = 1 +and md is not null + diff --git a/models/generated/airbyte_ctes/unibag/users_avatar_dimensions_md_ab2.sql b/models/generated/airbyte_ctes/unibag/users_avatar_dimensions_md_ab2.sql new file mode 100644 index 0000000..1eac474 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/users_avatar_dimensions_md_ab2.sql @@ -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('users_avatar_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('users_avatar_dimensions_md_ab1') }} +-- md at users/avatar/dimensions/md +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/users_avatar_dimensions_md_ab3.sql b/models/generated/airbyte_ctes/unibag/users_avatar_dimensions_md_ab3.sql new file mode 100644 index 0000000..900bc55 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/users_avatar_dimensions_md_ab3.sql @@ -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('users_avatar_dimensions_md_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_dimensions_hashid', + 'url', + 'width', + 'height', + ]) }} as _airbyte_md_hashid, + tmp.* +from {{ ref('users_avatar_dimensions_md_ab2') }} tmp +-- md at users/avatar/dimensions/md +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/users_avatar_dimensions_sm_ab1.sql b/models/generated/airbyte_ctes/unibag/users_avatar_dimensions_sm_ab1.sql new file mode 100644 index 0000000..d2cb017 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/users_avatar_dimensions_sm_ab1.sql @@ -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('users_avatar_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('users_avatar_dimensions') }} as table_alias +-- sm at users/avatar/dimensions/sm +where 1 = 1 +and sm is not null + diff --git a/models/generated/airbyte_ctes/unibag/users_avatar_dimensions_sm_ab2.sql b/models/generated/airbyte_ctes/unibag/users_avatar_dimensions_sm_ab2.sql new file mode 100644 index 0000000..7542b1f --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/users_avatar_dimensions_sm_ab2.sql @@ -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('users_avatar_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('users_avatar_dimensions_sm_ab1') }} +-- sm at users/avatar/dimensions/sm +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/users_avatar_dimensions_sm_ab3.sql b/models/generated/airbyte_ctes/unibag/users_avatar_dimensions_sm_ab3.sql new file mode 100644 index 0000000..72708fb --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/users_avatar_dimensions_sm_ab3.sql @@ -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('users_avatar_dimensions_sm_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_dimensions_hashid', + 'url', + 'width', + 'height', + ]) }} as _airbyte_sm_hashid, + tmp.* +from {{ ref('users_avatar_dimensions_sm_ab2') }} tmp +-- sm at users/avatar/dimensions/sm +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/users_email_ab1.sql b/models/generated/airbyte_ctes/unibag/users_email_ab1.sql new file mode 100644 index 0000000..8158bee --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/users_email_ab1.sql @@ -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('users') }} +select + _airbyte_users_hashid, + {{ json_extract_scalar('email', ['email'], ['email']) }} as email, + {{ json_extract_scalar('email', ['verified'], ['verified']) }} as verified, + {{ json_extract_scalar('email', ['verifiedAt'], ['verifiedAt']) }} as verifiedat, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('users') }} as table_alias +-- email at users/email +where 1 = 1 +and email is not null + diff --git a/models/generated/airbyte_ctes/unibag/users_email_ab2.sql b/models/generated/airbyte_ctes/unibag/users_email_ab2.sql new file mode 100644 index 0000000..0b95c57 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/users_email_ab2.sql @@ -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('users_email_ab1') }} +select + _airbyte_users_hashid, + cast(email as {{ dbt_utils.type_string() }}) as email, + {{ cast_to_boolean('verified') }} as verified, + cast(verifiedat as {{ dbt_utils.type_string() }}) as verifiedat, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('users_email_ab1') }} +-- email at users/email +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/users_email_ab3.sql b/models/generated/airbyte_ctes/unibag/users_email_ab3.sql new file mode 100644 index 0000000..d56fe37 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/users_email_ab3.sql @@ -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('users_email_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_users_hashid', + 'email', + boolean_to_string('verified'), + 'verifiedat', + ]) }} as _airbyte_email_hashid, + tmp.* +from {{ ref('users_email_ab2') }} tmp +-- email at users/email +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/users_facebook_ab1.sql b/models/generated/airbyte_ctes/unibag/users_facebook_ab1.sql new file mode 100644 index 0000000..a082186 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/users_facebook_ab1.sql @@ -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('users') }} +select + _airbyte_users_hashid, + {{ json_extract_scalar('facebook', ['id'], ['id']) }} as {{ adapter.quote('id') }}, + {{ json_extract_scalar('facebook', ['name'], ['name']) }} as {{ adapter.quote('name') }}, + {{ json_extract_scalar('facebook', ['email'], ['email']) }} as email, + {{ json_extract_scalar('facebook', ['photo'], ['photo']) }} as photo, + {{ json_extract_scalar('facebook', ['token'], ['token']) }} as {{ adapter.quote('token') }}, + {{ json_extract_scalar('facebook', ['gender'], ['gender']) }} as gender, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('users') }} as table_alias +-- facebook at users/facebook +where 1 = 1 +and facebook is not null + diff --git a/models/generated/airbyte_ctes/unibag/users_facebook_ab2.sql b/models/generated/airbyte_ctes/unibag/users_facebook_ab2.sql new file mode 100644 index 0000000..431064e --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/users_facebook_ab2.sql @@ -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('users_facebook_ab1') }} +select + _airbyte_users_hashid, + cast({{ adapter.quote('id') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('id') }}, + cast({{ adapter.quote('name') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('name') }}, + cast(email as {{ dbt_utils.type_string() }}) as email, + cast(photo as {{ dbt_utils.type_string() }}) as photo, + cast({{ adapter.quote('token') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('token') }}, + cast(gender as {{ dbt_utils.type_string() }}) as gender, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('users_facebook_ab1') }} +-- facebook at users/facebook +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/users_facebook_ab3.sql b/models/generated/airbyte_ctes/unibag/users_facebook_ab3.sql new file mode 100644 index 0000000..d6f1bcb --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/users_facebook_ab3.sql @@ -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('users_facebook_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_users_hashid', + adapter.quote('id'), + adapter.quote('name'), + 'email', + 'photo', + adapter.quote('token'), + 'gender', + ]) }} as _airbyte_facebook_hashid, + tmp.* +from {{ ref('users_facebook_ab2') }} tmp +-- facebook at users/facebook +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/users_identification_ab1.sql b/models/generated/airbyte_ctes/unibag/users_identification_ab1.sql new file mode 100644 index 0000000..60d2fd7 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/users_identification_ab1.sql @@ -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('users') }} +select + _airbyte_users_hashid, + {{ json_extract_scalar('identification', ['_id'], ['_id']) }} as _id, + {{ json_extract_scalar('identification', ['note'], ['note']) }} as note, + {{ json_extract_scalar('identification', ['status'], ['status']) }} as status, + {{ json_extract_scalar('identification', ['timeUpdate'], ['timeUpdate']) }} as timeupdate, + {{ json_extract_scalar('identification', ['completedAt'], ['completedAt']) }} as completedat, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('users') }} as table_alias +-- identification at users/identification +where 1 = 1 +and identification is not null + diff --git a/models/generated/airbyte_ctes/unibag/users_identification_ab2.sql b/models/generated/airbyte_ctes/unibag/users_identification_ab2.sql new file mode 100644 index 0000000..3c93b54 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/users_identification_ab2.sql @@ -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('users_identification_ab1') }} +select + _airbyte_users_hashid, + cast(_id as {{ dbt_utils.type_string() }}) as _id, + cast(note as {{ dbt_utils.type_string() }}) as note, + cast(status as {{ dbt_utils.type_string() }}) as status, + cast(timeupdate as {{ dbt_utils.type_float() }}) as timeupdate, + cast(completedat as {{ dbt_utils.type_string() }}) as completedat, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('users_identification_ab1') }} +-- identification at users/identification +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/users_identification_ab3.sql b/models/generated/airbyte_ctes/unibag/users_identification_ab3.sql new file mode 100644 index 0000000..d060da3 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/users_identification_ab3.sql @@ -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('users_identification_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_users_hashid', + '_id', + 'note', + 'status', + 'timeupdate', + 'completedat', + ]) }} as _airbyte_identification_hashid, + tmp.* +from {{ ref('users_identification_ab2') }} tmp +-- identification at users/identification +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/users_info_ab1.sql b/models/generated/airbyte_ctes/unibag/users_info_ab1.sql new file mode 100644 index 0000000..8181cdf --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/users_info_ab1.sql @@ -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('users') }} +select + _airbyte_users_hashid, + {{ json_extract_scalar('info', ['email'], ['email']) }} as email, + {{ json_extract_scalar('info', ['gender'], ['gender']) }} as gender, + {{ json_extract_scalar('info', ['cityCode'], ['cityCode']) }} as citycode, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('users') }} as table_alias +-- info at users/info +where 1 = 1 +and info is not null + diff --git a/models/generated/airbyte_ctes/unibag/users_info_ab2.sql b/models/generated/airbyte_ctes/unibag/users_info_ab2.sql new file mode 100644 index 0000000..63f1b2a --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/users_info_ab2.sql @@ -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('users_info_ab1') }} +select + _airbyte_users_hashid, + cast(email as {{ dbt_utils.type_string() }}) as email, + cast(gender as {{ dbt_utils.type_string() }}) as gender, + cast(citycode as {{ dbt_utils.type_float() }}) as citycode, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('users_info_ab1') }} +-- info at users/info +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/users_info_ab3.sql b/models/generated/airbyte_ctes/unibag/users_info_ab3.sql new file mode 100644 index 0000000..660d1c4 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/users_info_ab3.sql @@ -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('users_info_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_users_hashid', + 'email', + 'gender', + 'citycode', + ]) }} as _airbyte_info_hashid, + tmp.* +from {{ ref('users_info_ab2') }} tmp +-- info at users/info +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/users_membership_ab1.sql b/models/generated/airbyte_ctes/unibag/users_membership_ab1.sql new file mode 100644 index 0000000..7d6de48 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/users_membership_ab1.sql @@ -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('users') }} +select + _airbyte_users_hashid, + {{ json_extract_scalar('membership', ['expireAt'], ['expireAt']) }} as expireat, + {{ json_extract_scalar('membership', ['nextLevel'], ['nextLevel']) }} as nextlevel, + {{ json_extract_scalar('membership', ['currentLevel'], ['currentLevel']) }} as currentlevel, + {{ json_extract_scalar('membership', ['currentTransactionCount'], ['currentTransactionCount']) }} as currenttransactioncount, + {{ json_extract_scalar('membership', ['currentSales_aibyte_transform'], ['currentSales_aibyte_transform']) }} as currentsales_aibyte_transform, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('users') }} as table_alias +-- membership at users/membership +where 1 = 1 +and membership is not null + diff --git a/models/generated/airbyte_ctes/unibag/users_membership_ab2.sql b/models/generated/airbyte_ctes/unibag/users_membership_ab2.sql new file mode 100644 index 0000000..50ce1ee --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/users_membership_ab2.sql @@ -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('users_membership_ab1') }} +select + _airbyte_users_hashid, + cast(expireat as {{ dbt_utils.type_string() }}) as expireat, + cast(nextlevel as {{ dbt_utils.type_float() }}) as nextlevel, + cast(currentlevel as {{ dbt_utils.type_float() }}) as currentlevel, + cast(currenttransactioncount as {{ dbt_utils.type_float() }}) as currenttransactioncount, + cast(currentsales_aibyte_transform as {{ dbt_utils.type_string() }}) as currentsales_aibyte_transform, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('users_membership_ab1') }} +-- membership at users/membership +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/users_membership_ab3.sql b/models/generated/airbyte_ctes/unibag/users_membership_ab3.sql new file mode 100644 index 0000000..8223de4 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/users_membership_ab3.sql @@ -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('users_membership_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_users_hashid', + 'expireat', + 'nextlevel', + 'currentlevel', + 'currenttransactioncount', + 'currentsales_aibyte_transform', + ]) }} as _airbyte_membership_hashid, + tmp.* +from {{ ref('users_membership_ab2') }} tmp +-- membership at users/membership +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/users_phone_ab1.sql b/models/generated/airbyte_ctes/unibag/users_phone_ab1.sql new file mode 100644 index 0000000..8702412 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/users_phone_ab1.sql @@ -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('users') }} +select + _airbyte_users_hashid, + {{ json_extract_scalar('phone', ['full'], ['full']) }} as {{ adapter.quote('full') }}, + {{ json_extract_scalar('phone', ['number'], ['number']) }} as {{ adapter.quote('number') }}, + {{ json_extract_scalar('phone', ['verified'], ['verified']) }} as verified, + {{ json_extract_scalar('phone', ['verifiedAt'], ['verifiedAt']) }} as verifiedat, + {{ json_extract_scalar('phone', ['countryCode'], ['countryCode']) }} as countrycode, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('users') }} as table_alias +-- phone at users/phone +where 1 = 1 +and phone is not null + diff --git a/models/generated/airbyte_ctes/unibag/users_phone_ab2.sql b/models/generated/airbyte_ctes/unibag/users_phone_ab2.sql new file mode 100644 index 0000000..b7023b9 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/users_phone_ab2.sql @@ -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('users_phone_ab1') }} +select + _airbyte_users_hashid, + cast({{ adapter.quote('full') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('full') }}, + cast({{ adapter.quote('number') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('number') }}, + {{ cast_to_boolean('verified') }} as verified, + cast(verifiedat as {{ dbt_utils.type_string() }}) as verifiedat, + cast(countrycode as {{ dbt_utils.type_string() }}) as countrycode, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('users_phone_ab1') }} +-- phone at users/phone +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/users_phone_ab3.sql b/models/generated/airbyte_ctes/unibag/users_phone_ab3.sql new file mode 100644 index 0000000..bdcb9a0 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/users_phone_ab3.sql @@ -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('users_phone_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_users_hashid', + adapter.quote('full'), + adapter.quote('number'), + boolean_to_string('verified'), + 'verifiedat', + 'countrycode', + ]) }} as _airbyte_phone_hashid, + tmp.* +from {{ ref('users_phone_ab2') }} tmp +-- phone at users/phone +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/users_referral_ab1.sql b/models/generated/airbyte_ctes/unibag/users_referral_ab1.sql new file mode 100644 index 0000000..ec01d80 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/users_referral_ab1.sql @@ -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('users') }} +select + _airbyte_users_hashid, + {{ json_extract_scalar('referral', ['code'], ['code']) }} as code, + {{ json_extract_scalar('referral', ['enabled'], ['enabled']) }} as enabled, + {{ json_extract_scalar('referral', ['enabledAt'], ['enabledAt']) }} as enabledat, + {{ json_extract_scalar('referral', ['shareContent'], ['shareContent']) }} as sharecontent, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('users') }} as table_alias +-- referral at users/referral +where 1 = 1 +and referral is not null + diff --git a/models/generated/airbyte_ctes/unibag/users_referral_ab2.sql b/models/generated/airbyte_ctes/unibag/users_referral_ab2.sql new file mode 100644 index 0000000..f593875 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/users_referral_ab2.sql @@ -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('users_referral_ab1') }} +select + _airbyte_users_hashid, + cast(code as {{ dbt_utils.type_string() }}) as code, + {{ cast_to_boolean('enabled') }} as enabled, + cast(enabledat as {{ dbt_utils.type_string() }}) as enabledat, + cast(sharecontent as {{ dbt_utils.type_string() }}) as sharecontent, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('users_referral_ab1') }} +-- referral at users/referral +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/users_referral_ab3.sql b/models/generated/airbyte_ctes/unibag/users_referral_ab3.sql new file mode 100644 index 0000000..85fd276 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/users_referral_ab3.sql @@ -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('users_referral_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_users_hashid', + 'code', + boolean_to_string('enabled'), + 'enabledat', + 'sharecontent', + ]) }} as _airbyte_referral_hashid, + tmp.* +from {{ ref('users_referral_ab2') }} tmp +-- referral at users/referral +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/users_statistic_ab1.sql b/models/generated/airbyte_ctes/unibag/users_statistic_ab1.sql new file mode 100644 index 0000000..96dd9eb --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/users_statistic_ab1.sql @@ -0,0 +1,73 @@ +{{ 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('users') }} +select + _airbyte_users_hashid, + {{ json_extract_scalar('statistic', ['cashTotal'], ['cashTotal']) }} as cashtotal, + {{ json_extract_scalar('statistic', ['cashPending'], ['cashPending']) }} as cashpending, + {{ json_extract_scalar('statistic', ['cashCashback'], ['cashCashback']) }} as cashcashback, + {{ json_extract_scalar('statistic', ['cashGiveGift'], ['cashGiveGift']) }} as cashgivegift, + {{ json_extract_scalar('statistic', ['cashRejected'], ['cashRejected']) }} as cashrejected, + {{ json_extract_scalar('statistic', ['taxTotalCash'], ['taxTotalCash']) }} as taxtotalcash, + {{ json_extract_scalar('statistic', ['totalGiftBox'], ['totalGiftBox']) }} as totalgiftbox, + {{ json_extract_scalar('statistic', ['totalTickets'], ['totalTickets']) }} as totaltickets, + {{ json_extract_scalar('statistic', ['cashCancelled'], ['cashCancelled']) }} as cashcancelled, + {{ json_extract_scalar('statistic', ['cashDelivered'], ['cashDelivered']) }} as cashdelivered, + {{ json_extract_scalar('statistic', ['cashRemaining'], ['cashRemaining']) }} as cashremaining, + {{ json_extract_scalar('statistic', ['customerTotal'], ['customerTotal']) }} as customertotal, + {{ json_extract_scalar('statistic', ['totalCartItem'], ['totalCartItem']) }} as totalcartitem, + {{ json_extract_scalar('statistic', ['withdrawTotal'], ['withdrawTotal']) }} as withdrawtotal, + {{ json_extract_scalar('statistic', ['cashDelivering'], ['cashDelivering']) }} as cashdelivering, + {{ json_extract_scalar('statistic', ['taxCashPending'], ['taxCashPending']) }} as taxcashpending, + {{ json_extract_scalar('statistic', ['withdrawPending'], ['withdrawPending']) }} as withdrawpending, + {{ json_extract_scalar('statistic', ['withdrawSuccess'], ['withdrawSuccess']) }} as withdrawsuccess, + {{ json_extract_scalar('statistic', ['revenueLastMonth'], ['revenueLastMonth']) }} as revenuelastmonth, + {{ json_extract_scalar('statistic', ['totalSaleSuccess'], ['totalSaleSuccess']) }} as totalsalesuccess, + {{ json_extract_scalar('statistic', ['transactionTotal'], ['transactionTotal']) }} as transactiontotal, + {{ json_extract_scalar('statistic', ['withdrawRejected'], ['withdrawRejected']) }} as withdrawrejected, + {{ json_extract_scalar('statistic', ['cashWithdrawTotal'], ['cashWithdrawTotal']) }} as cashwithdrawtotal, + {{ json_extract_scalar('statistic', ['cashWaitingApprove'], ['cashWaitingApprove']) }} as cashwaitingapprove, + {{ json_extract_scalar('statistic', ['transactionPending'], ['transactionPending']) }} as transactionpending, + {{ json_extract_scalar('statistic', ['transactionSuccess'], ['transactionSuccess']) }} as transactionsuccess, + {{ json_extract_scalar('statistic', ['cashWithdrawPending'], ['cashWithdrawPending']) }} as cashwithdrawpending, + {{ json_extract_scalar('statistic', ['cashWithdrawSuccess'], ['cashWithdrawSuccess']) }} as cashwithdrawsuccess, + {{ json_extract_scalar('statistic', ['highestMonthlySales'], ['highestMonthlySales']) }} as highestmonthlysales, + {{ json_extract_scalar('statistic', ['transactionRejected'], ['transactionRejected']) }} as transactionrejected, + {{ json_extract_scalar('statistic', ['cashWithdrawRejected'], ['cashWithdrawRejected']) }} as cashwithdrawrejected, + {{ json_extract_scalar('statistic', ['teamBonusPendingCash'], ['teamBonusPendingCash']) }} as teambonuspendingcash, + {{ json_extract_scalar('statistic', ['teamBonusSuccessCash'], ['teamBonusSuccessCash']) }} as teambonussuccesscash, + {{ json_extract_scalar('statistic', ['transactionDelivered'], ['transactionDelivered']) }} as transactiondelivered, + {{ json_extract_scalar('statistic', ['cashPaymentProcessing'], ['cashPaymentProcessing']) }} as cashpaymentprocessing, + {{ json_extract_scalar('statistic', ['transactionDelivering'], ['transactionDelivering']) }} as transactiondelivering, + {{ json_extract_scalar('statistic', ['eventRewardPendingCash'], ['eventRewardPendingCash']) }} as eventrewardpendingcash, + {{ json_extract_scalar('statistic', ['eventRewardSuccessCash'], ['eventRewardSuccessCash']) }} as eventrewardsuccesscash, + {{ json_extract_scalar('statistic', ['transactionCashPending'], ['transactionCashPending']) }} as transactioncashpending, + {{ json_extract_scalar('statistic', ['voucherBonusPendingCash'], ['voucherBonusPendingCash']) }} as voucherbonuspendingcash, + {{ json_extract_scalar('statistic', ['voucherBonusSuccessCash'], ['voucherBonusSuccessCash']) }} as voucherbonussuccesscash, + {{ json_extract_scalar('statistic', ['eventReferralPendingCash'], ['eventReferralPendingCash']) }} as eventreferralpendingcash, + {{ json_extract_scalar('statistic', ['eventReferralSuccessCash'], ['eventReferralSuccessCash']) }} as eventreferralsuccesscash, + {{ json_extract_scalar('statistic', ['promotionBonusPendingCash'], ['promotionBonusPendingCash']) }} as promotionbonuspendingcash, + {{ json_extract_scalar('statistic', ['promotionBonusSuccessCash'], ['promotionBonusSuccessCash']) }} as promotionbonussuccesscash, + {{ json_extract_scalar('statistic', ['transactionWaitingApprove'], ['transactionWaitingApprove']) }} as transactionwaitingapprove, + {{ json_extract_scalar('statistic', ['commissionTransactionTotal'], ['commissionTransactionTotal']) }} as commissiontransactiontotal, + {{ json_extract_scalar('statistic', ['membershipBonusPendingCash'], ['membershipBonusPendingCash']) }} as membershipbonuspendingcash, + {{ json_extract_scalar('statistic', ['membershipBonusSuccessCash'], ['membershipBonusSuccessCash']) }} as membershipbonussuccesscash, + {{ json_extract_scalar('statistic', ['commissionTransactionPending'], ['commissionTransactionPending']) }} as commissiontransactionpending, + {{ json_extract_scalar('statistic', ['transactionPaymentProcessing'], ['transactionPaymentProcessing']) }} as transactionpaymentprocessing, + {{ json_extract_scalar('statistic', ['commissionTransactionCashback'], ['commissionTransactionCashback']) }} as commissiontransactioncashback, + {{ json_extract_scalar('statistic', ['commissionTransactionRejected'], ['commissionTransactionRejected']) }} as commissiontransactionrejected, + {{ json_extract_scalar('statistic', ['commissionTransactionDelivered'], ['commissionTransactionDelivered']) }} as commissiontransactiondelivered, + {{ json_extract_scalar('statistic', ['commissionTransactionDelivering'], ['commissionTransactionDelivering']) }} as commissiontransactiondelivering, + {{ json_extract_scalar('statistic', ['revenueThisMonth_aibyte_transform'], ['revenueThisMonth_aibyte_transform']) }} as revenuethismonth_aibyte_transform, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('users') }} as table_alias +-- statistic at users/statistic +where 1 = 1 +and statistic is not null + diff --git a/models/generated/airbyte_ctes/unibag/users_statistic_ab2.sql b/models/generated/airbyte_ctes/unibag/users_statistic_ab2.sql new file mode 100644 index 0000000..f0dfd85 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/users_statistic_ab2.sql @@ -0,0 +1,72 @@ +{{ 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('users_statistic_ab1') }} +select + _airbyte_users_hashid, + cast(cashtotal as {{ dbt_utils.type_float() }}) as cashtotal, + cast(cashpending as {{ dbt_utils.type_float() }}) as cashpending, + cast(cashcashback as {{ dbt_utils.type_float() }}) as cashcashback, + cast(cashgivegift as {{ dbt_utils.type_float() }}) as cashgivegift, + cast(cashrejected as {{ dbt_utils.type_float() }}) as cashrejected, + cast(taxtotalcash as {{ dbt_utils.type_float() }}) as taxtotalcash, + cast(totalgiftbox as {{ dbt_utils.type_float() }}) as totalgiftbox, + cast(totaltickets as {{ dbt_utils.type_float() }}) as totaltickets, + cast(cashcancelled as {{ dbt_utils.type_float() }}) as cashcancelled, + cast(cashdelivered as {{ dbt_utils.type_float() }}) as cashdelivered, + cast(cashremaining as {{ dbt_utils.type_float() }}) as cashremaining, + cast(customertotal as {{ dbt_utils.type_float() }}) as customertotal, + cast(totalcartitem as {{ dbt_utils.type_float() }}) as totalcartitem, + cast(withdrawtotal as {{ dbt_utils.type_float() }}) as withdrawtotal, + cast(cashdelivering as {{ dbt_utils.type_float() }}) as cashdelivering, + cast(taxcashpending as {{ dbt_utils.type_float() }}) as taxcashpending, + cast(withdrawpending as {{ dbt_utils.type_float() }}) as withdrawpending, + cast(withdrawsuccess as {{ dbt_utils.type_float() }}) as withdrawsuccess, + cast(revenuelastmonth as {{ dbt_utils.type_float() }}) as revenuelastmonth, + cast(totalsalesuccess as {{ dbt_utils.type_float() }}) as totalsalesuccess, + cast(transactiontotal as {{ dbt_utils.type_float() }}) as transactiontotal, + cast(withdrawrejected as {{ dbt_utils.type_float() }}) as withdrawrejected, + cast(cashwithdrawtotal as {{ dbt_utils.type_float() }}) as cashwithdrawtotal, + cast(cashwaitingapprove as {{ dbt_utils.type_float() }}) as cashwaitingapprove, + cast(transactionpending as {{ dbt_utils.type_float() }}) as transactionpending, + cast(transactionsuccess as {{ dbt_utils.type_float() }}) as transactionsuccess, + cast(cashwithdrawpending as {{ dbt_utils.type_float() }}) as cashwithdrawpending, + cast(cashwithdrawsuccess as {{ dbt_utils.type_float() }}) as cashwithdrawsuccess, + cast(highestmonthlysales as {{ dbt_utils.type_float() }}) as highestmonthlysales, + cast(transactionrejected as {{ dbt_utils.type_float() }}) as transactionrejected, + cast(cashwithdrawrejected as {{ dbt_utils.type_float() }}) as cashwithdrawrejected, + cast(teambonuspendingcash as {{ dbt_utils.type_float() }}) as teambonuspendingcash, + cast(teambonussuccesscash as {{ dbt_utils.type_float() }}) as teambonussuccesscash, + cast(transactiondelivered as {{ dbt_utils.type_float() }}) as transactiondelivered, + cast(cashpaymentprocessing as {{ dbt_utils.type_float() }}) as cashpaymentprocessing, + cast(transactiondelivering as {{ dbt_utils.type_float() }}) as transactiondelivering, + cast(eventrewardpendingcash as {{ dbt_utils.type_float() }}) as eventrewardpendingcash, + cast(eventrewardsuccesscash as {{ dbt_utils.type_float() }}) as eventrewardsuccesscash, + cast(transactioncashpending as {{ dbt_utils.type_float() }}) as transactioncashpending, + cast(voucherbonuspendingcash as {{ dbt_utils.type_float() }}) as voucherbonuspendingcash, + cast(voucherbonussuccesscash as {{ dbt_utils.type_float() }}) as voucherbonussuccesscash, + cast(eventreferralpendingcash as {{ dbt_utils.type_float() }}) as eventreferralpendingcash, + cast(eventreferralsuccesscash as {{ dbt_utils.type_float() }}) as eventreferralsuccesscash, + cast(promotionbonuspendingcash as {{ dbt_utils.type_float() }}) as promotionbonuspendingcash, + cast(promotionbonussuccesscash as {{ dbt_utils.type_float() }}) as promotionbonussuccesscash, + cast(transactionwaitingapprove as {{ dbt_utils.type_float() }}) as transactionwaitingapprove, + cast(commissiontransactiontotal as {{ dbt_utils.type_float() }}) as commissiontransactiontotal, + cast(membershipbonuspendingcash as {{ dbt_utils.type_float() }}) as membershipbonuspendingcash, + cast(membershipbonussuccesscash as {{ dbt_utils.type_float() }}) as membershipbonussuccesscash, + cast(commissiontransactionpending as {{ dbt_utils.type_float() }}) as commissiontransactionpending, + cast(transactionpaymentprocessing as {{ dbt_utils.type_float() }}) as transactionpaymentprocessing, + cast(commissiontransactioncashback as {{ dbt_utils.type_float() }}) as commissiontransactioncashback, + cast(commissiontransactionrejected as {{ dbt_utils.type_float() }}) as commissiontransactionrejected, + cast(commissiontransactiondelivered as {{ dbt_utils.type_float() }}) as commissiontransactiondelivered, + cast(commissiontransactiondelivering as {{ dbt_utils.type_float() }}) as commissiontransactiondelivering, + cast(revenuethismonth_aibyte_transform as {{ dbt_utils.type_string() }}) as revenuethismonth_aibyte_transform, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('users_statistic_ab1') }} +-- statistic at users/statistic +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/users_statistic_ab3.sql b/models/generated/airbyte_ctes/unibag/users_statistic_ab3.sql new file mode 100644 index 0000000..eb8e312 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/users_statistic_ab3.sql @@ -0,0 +1,72 @@ +{{ 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('users_statistic_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_users_hashid', + 'cashtotal', + 'cashpending', + 'cashcashback', + 'cashgivegift', + 'cashrejected', + 'taxtotalcash', + 'totalgiftbox', + 'totaltickets', + 'cashcancelled', + 'cashdelivered', + 'cashremaining', + 'customertotal', + 'totalcartitem', + 'withdrawtotal', + 'cashdelivering', + 'taxcashpending', + 'withdrawpending', + 'withdrawsuccess', + 'revenuelastmonth', + 'totalsalesuccess', + 'transactiontotal', + 'withdrawrejected', + 'cashwithdrawtotal', + 'cashwaitingapprove', + 'transactionpending', + 'transactionsuccess', + 'cashwithdrawpending', + 'cashwithdrawsuccess', + 'highestmonthlysales', + 'transactionrejected', + 'cashwithdrawrejected', + 'teambonuspendingcash', + 'teambonussuccesscash', + 'transactiondelivered', + 'cashpaymentprocessing', + 'transactiondelivering', + 'eventrewardpendingcash', + 'eventrewardsuccesscash', + 'transactioncashpending', + 'voucherbonuspendingcash', + 'voucherbonussuccesscash', + 'eventreferralpendingcash', + 'eventreferralsuccesscash', + 'promotionbonuspendingcash', + 'promotionbonussuccesscash', + 'transactionwaitingapprove', + 'commissiontransactiontotal', + 'membershipbonuspendingcash', + 'membershipbonussuccesscash', + 'commissiontransactionpending', + 'transactionpaymentprocessing', + 'commissiontransactioncashback', + 'commissiontransactionrejected', + 'commissiontransactiondelivered', + 'commissiontransactiondelivering', + 'revenuethismonth_aibyte_transform', + ]) }} as _airbyte_statistic_hashid, + tmp.* +from {{ ref('users_statistic_ab2') }} tmp +-- statistic at users/statistic +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/users_team_ab1.sql b/models/generated/airbyte_ctes/unibag/users_team_ab1.sql new file mode 100644 index 0000000..0e8f632 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/users_team_ab1.sql @@ -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('users') }} +select + _airbyte_users_hashid, + {{ json_extract_scalar('team', ['_id'], ['_id']) }} as _id, + {{ json_extract_scalar('team', ['name'], ['name']) }} as {{ adapter.quote('name') }}, + {{ json_extract_scalar('team', ['role'], ['role']) }} as {{ adapter.quote('role') }}, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('users') }} as table_alias +-- team at users/team +where 1 = 1 +and team is not null + diff --git a/models/generated/airbyte_ctes/unibag/users_team_ab2.sql b/models/generated/airbyte_ctes/unibag/users_team_ab2.sql new file mode 100644 index 0000000..914b790 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/users_team_ab2.sql @@ -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('users_team_ab1') }} +select + _airbyte_users_hashid, + cast(_id as {{ dbt_utils.type_string() }}) as _id, + cast({{ adapter.quote('name') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('name') }}, + cast({{ adapter.quote('role') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('role') }}, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('users_team_ab1') }} +-- team at users/team +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/users_team_ab3.sql b/models/generated/airbyte_ctes/unibag/users_team_ab3.sql new file mode 100644 index 0000000..a43255f --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/users_team_ab3.sql @@ -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('users_team_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_users_hashid', + '_id', + adapter.quote('name'), + adapter.quote('role'), + ]) }} as _airbyte_team_hashid, + tmp.* +from {{ ref('users_team_ab2') }} tmp +-- team at users/team +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/users_zalo_ab1.sql b/models/generated/airbyte_ctes/unibag/users_zalo_ab1.sql new file mode 100644 index 0000000..65e34a7 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/users_zalo_ab1.sql @@ -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('users') }} +select + _airbyte_users_hashid, + {{ json_extract_scalar('zalo', ['id'], ['id']) }} as {{ adapter.quote('id') }}, + {{ json_extract_scalar('zalo', ['name'], ['name']) }} as {{ adapter.quote('name') }}, + {{ json_extract_scalar('zalo', ['photo'], ['photo']) }} as photo, + {{ json_extract_scalar('zalo', ['token'], ['token']) }} as {{ adapter.quote('token') }}, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('users') }} as table_alias +-- zalo at users/zalo +where 1 = 1 +and zalo is not null + diff --git a/models/generated/airbyte_ctes/unibag/users_zalo_ab2.sql b/models/generated/airbyte_ctes/unibag/users_zalo_ab2.sql new file mode 100644 index 0000000..682c4c0 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/users_zalo_ab2.sql @@ -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('users_zalo_ab1') }} +select + _airbyte_users_hashid, + cast({{ adapter.quote('id') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('id') }}, + cast({{ adapter.quote('name') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('name') }}, + cast(photo as {{ dbt_utils.type_string() }}) as photo, + cast({{ adapter.quote('token') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('token') }}, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('users_zalo_ab1') }} +-- zalo at users/zalo +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/users_zalo_ab3.sql b/models/generated/airbyte_ctes/unibag/users_zalo_ab3.sql new file mode 100644 index 0000000..79c6b8b --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/users_zalo_ab3.sql @@ -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('users_zalo_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_users_hashid', + adapter.quote('id'), + adapter.quote('name'), + 'photo', + adapter.quote('token'), + ]) }} as _airbyte_zalo_hashid, + tmp.* +from {{ ref('users_zalo_ab2') }} tmp +-- zalo at users/zalo +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/vouchers_ab1.sql b/models/generated/airbyte_ctes/unibag/vouchers_ab1.sql index 54b21a5..d49d726 100644 --- a/models/generated/airbyte_ctes/unibag/vouchers_ab1.sql +++ b/models/generated/airbyte_ctes/unibag/vouchers_ab1.sql @@ -10,15 +10,15 @@ select {{ json_extract_scalar('_airbyte_data', ['_id'], ['_id']) }} as _id, {{ json_extract_scalar('_airbyte_data', ['code'], ['code']) }} as code, {{ json_extract_scalar('_airbyte_data', ['desc'], ['desc']) }} as {{ adapter.quote('desc') }}, - {{ json_extract_scalar('_airbyte_data', ['logo'], ['logo']) }} as logo, + {{ json_extract('table_alias', '_airbyte_data', ['logo'], ['logo']) }} as logo, {{ json_extract_scalar('_airbyte_data', ['type'], ['type']) }} as {{ adapter.quote('type') }}, {{ json_extract_scalar('_airbyte_data', ['endAt'], ['endAt']) }} as endat, {{ json_extract_scalar('_airbyte_data', ['title'], ['title']) }} as title, {{ json_extract_scalar('_airbyte_data', ['active'], ['active']) }} as active, {{ json_extract_array('_airbyte_data', ['covers'], ['covers']) }} as covers, - {{ 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', ['applyFor'], ['applyFor']) }} as applyfor, + {{ json_extract('table_alias', '_airbyte_data', ['applyFor'], ['applyFor']) }} as applyfor, {{ json_extract_scalar('_airbyte_data', ['articleID'], ['articleID']) }} as articleid, {{ json_extract_scalar('_airbyte_data', ['createdAt'], ['createdAt']) }} as createdat, {{ json_extract_scalar('_airbyte_data', ['updatedAt'], ['updatedAt']) }} as updatedat, diff --git a/models/generated/airbyte_ctes/unibag/vouchers_ab2.sql b/models/generated/airbyte_ctes/unibag/vouchers_ab2.sql index f48ce06..e740cad 100644 --- a/models/generated/airbyte_ctes/unibag/vouchers_ab2.sql +++ b/models/generated/airbyte_ctes/unibag/vouchers_ab2.sql @@ -10,15 +10,15 @@ select cast(_id as {{ dbt_utils.type_string() }}) as _id, cast(code as {{ dbt_utils.type_string() }}) as code, cast({{ adapter.quote('desc') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('desc') }}, - cast(logo as {{ dbt_utils.type_string() }}) as logo, + cast(logo as {{ type_json() }}) as logo, cast({{ adapter.quote('type') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('type') }}, cast(endat as {{ dbt_utils.type_string() }}) as endat, cast(title as {{ dbt_utils.type_string() }}) as title, {{ cast_to_boolean('active') }} as active, covers, - 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(applyfor as {{ dbt_utils.type_string() }}) as applyfor, + cast(applyfor as {{ type_json() }}) as applyfor, cast(articleid as {{ dbt_utils.type_string() }}) as articleid, cast(createdat as {{ dbt_utils.type_string() }}) as createdat, cast(updatedat as {{ dbt_utils.type_string() }}) as updatedat, diff --git a/models/generated/airbyte_ctes/unibag/vouchers_ab3.sql b/models/generated/airbyte_ctes/unibag/vouchers_ab3.sql index 2fa0827..c352115 100644 --- a/models/generated/airbyte_ctes/unibag/vouchers_ab3.sql +++ b/models/generated/airbyte_ctes/unibag/vouchers_ab3.sql @@ -11,15 +11,15 @@ select '_id', 'code', adapter.quote('desc'), - 'logo', + object_to_string('logo'), adapter.quote('type'), 'endat', 'title', boolean_to_string('active'), array_to_string('covers'), - adapter.quote('options'), + object_to_string(adapter.quote('options')), 'startat', - 'applyfor', + object_to_string('applyfor'), 'articleid', 'createdat', 'updatedat', diff --git a/models/generated/airbyte_ctes/unibag/vouchers_applyfor_ab1.sql b/models/generated/airbyte_ctes/unibag/vouchers_applyfor_ab1.sql new file mode 100644 index 0000000..8ecd5d4 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/vouchers_applyfor_ab1.sql @@ -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('vouchers') }} +select + _airbyte_vouchers_hashid, + {{ json_extract_array('applyfor', ['list'], ['list']) }} as list, + {{ json_extract_scalar('applyfor', ['type'], ['type']) }} as {{ adapter.quote('type') }}, + {{ json_extract_scalar('applyfor', ['provinces'], ['provinces']) }} as provinces, + {{ json_extract_scalar('applyfor', ['isApplyAllOrder'], ['isApplyAllOrder']) }} as isapplyallorder, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('vouchers') }} as table_alias +-- applyfor at vouchers/applyFor +where 1 = 1 +and applyfor is not null + diff --git a/models/generated/airbyte_ctes/unibag/vouchers_applyfor_ab2.sql b/models/generated/airbyte_ctes/unibag/vouchers_applyfor_ab2.sql new file mode 100644 index 0000000..0578f30 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/vouchers_applyfor_ab2.sql @@ -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('vouchers_applyfor_ab1') }} +select + _airbyte_vouchers_hashid, + list, + cast({{ adapter.quote('type') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('type') }}, + cast(provinces as {{ dbt_utils.type_string() }}) as provinces, + {{ cast_to_boolean('isapplyallorder') }} as isapplyallorder, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('vouchers_applyfor_ab1') }} +-- applyfor at vouchers/applyFor +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/vouchers_applyfor_ab3.sql b/models/generated/airbyte_ctes/unibag/vouchers_applyfor_ab3.sql new file mode 100644 index 0000000..a651dfc --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/vouchers_applyfor_ab3.sql @@ -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('vouchers_applyfor_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_vouchers_hashid', + array_to_string('list'), + adapter.quote('type'), + 'provinces', + boolean_to_string('isapplyallorder'), + ]) }} as _airbyte_applyfor_hashid, + tmp.* +from {{ ref('vouchers_applyfor_ab2') }} tmp +-- applyfor at vouchers/applyFor +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/vouchers_logo_ab1.sql b/models/generated/airbyte_ctes/unibag/vouchers_logo_ab1.sql new file mode 100644 index 0000000..7b4a7ec --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/vouchers_logo_ab1.sql @@ -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('vouchers') }} +select + _airbyte_vouchers_hashid, + {{ json_extract_scalar('logo', ['_id'], ['_id']) }} as _id, + {{ json_extract_scalar('logo', ['name'], ['name']) }} as {{ adapter.quote('name') }}, + {{ json_extract('table_alias', 'logo', ['dimensions'], ['dimensions']) }} as dimensions, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('vouchers') }} as table_alias +-- logo at vouchers/logo +where 1 = 1 +and logo is not null + diff --git a/models/generated/airbyte_ctes/unibag/vouchers_logo_ab2.sql b/models/generated/airbyte_ctes/unibag/vouchers_logo_ab2.sql new file mode 100644 index 0000000..7d87fb2 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/vouchers_logo_ab2.sql @@ -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('vouchers_logo_ab1') }} +select + _airbyte_vouchers_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('vouchers_logo_ab1') }} +-- logo at vouchers/logo +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/vouchers_logo_ab3.sql b/models/generated/airbyte_ctes/unibag/vouchers_logo_ab3.sql new file mode 100644 index 0000000..bbf5599 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/vouchers_logo_ab3.sql @@ -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('vouchers_logo_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_vouchers_hashid', + '_id', + adapter.quote('name'), + object_to_string('dimensions'), + ]) }} as _airbyte_logo_hashid, + tmp.* +from {{ ref('vouchers_logo_ab2') }} tmp +-- logo at vouchers/logo +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/vouchers_logo_dimensions_ab1.sql b/models/generated/airbyte_ctes/unibag/vouchers_logo_dimensions_ab1.sql new file mode 100644 index 0000000..482c25b --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/vouchers_logo_dimensions_ab1.sql @@ -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('vouchers_logo') }} +select + _airbyte_logo_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('vouchers_logo') }} as table_alias +-- dimensions at vouchers/logo/dimensions +where 1 = 1 +and dimensions is not null + diff --git a/models/generated/airbyte_ctes/unibag/vouchers_logo_dimensions_ab2.sql b/models/generated/airbyte_ctes/unibag/vouchers_logo_dimensions_ab2.sql new file mode 100644 index 0000000..5a5221d --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/vouchers_logo_dimensions_ab2.sql @@ -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('vouchers_logo_dimensions_ab1') }} +select + _airbyte_logo_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('vouchers_logo_dimensions_ab1') }} +-- dimensions at vouchers/logo/dimensions +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/vouchers_logo_dimensions_ab3.sql b/models/generated/airbyte_ctes/unibag/vouchers_logo_dimensions_ab3.sql new file mode 100644 index 0000000..2e1fcfb --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/vouchers_logo_dimensions_ab3.sql @@ -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('vouchers_logo_dimensions_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_logo_hashid', + object_to_string('md'), + object_to_string('sm'), + ]) }} as _airbyte_dimensions_hashid, + tmp.* +from {{ ref('vouchers_logo_dimensions_ab2') }} tmp +-- dimensions at vouchers/logo/dimensions +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/vouchers_logo_dimensions_md_ab1.sql b/models/generated/airbyte_ctes/unibag/vouchers_logo_dimensions_md_ab1.sql new file mode 100644 index 0000000..72a6bd0 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/vouchers_logo_dimensions_md_ab1.sql @@ -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('vouchers_logo_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('vouchers_logo_dimensions') }} as table_alias +-- md at vouchers/logo/dimensions/md +where 1 = 1 +and md is not null + diff --git a/models/generated/airbyte_ctes/unibag/vouchers_logo_dimensions_md_ab2.sql b/models/generated/airbyte_ctes/unibag/vouchers_logo_dimensions_md_ab2.sql new file mode 100644 index 0000000..159ffaf --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/vouchers_logo_dimensions_md_ab2.sql @@ -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('vouchers_logo_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('vouchers_logo_dimensions_md_ab1') }} +-- md at vouchers/logo/dimensions/md +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/vouchers_logo_dimensions_md_ab3.sql b/models/generated/airbyte_ctes/unibag/vouchers_logo_dimensions_md_ab3.sql new file mode 100644 index 0000000..02c4210 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/vouchers_logo_dimensions_md_ab3.sql @@ -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('vouchers_logo_dimensions_md_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_dimensions_hashid', + 'url', + 'width', + 'height', + ]) }} as _airbyte_md_hashid, + tmp.* +from {{ ref('vouchers_logo_dimensions_md_ab2') }} tmp +-- md at vouchers/logo/dimensions/md +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/vouchers_logo_dimensions_sm_ab1.sql b/models/generated/airbyte_ctes/unibag/vouchers_logo_dimensions_sm_ab1.sql new file mode 100644 index 0000000..c285fde --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/vouchers_logo_dimensions_sm_ab1.sql @@ -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('vouchers_logo_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('vouchers_logo_dimensions') }} as table_alias +-- sm at vouchers/logo/dimensions/sm +where 1 = 1 +and sm is not null + diff --git a/models/generated/airbyte_ctes/unibag/vouchers_logo_dimensions_sm_ab2.sql b/models/generated/airbyte_ctes/unibag/vouchers_logo_dimensions_sm_ab2.sql new file mode 100644 index 0000000..dc3e8db --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/vouchers_logo_dimensions_sm_ab2.sql @@ -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('vouchers_logo_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('vouchers_logo_dimensions_sm_ab1') }} +-- sm at vouchers/logo/dimensions/sm +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/vouchers_logo_dimensions_sm_ab3.sql b/models/generated/airbyte_ctes/unibag/vouchers_logo_dimensions_sm_ab3.sql new file mode 100644 index 0000000..1b48dcc --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/vouchers_logo_dimensions_sm_ab3.sql @@ -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('vouchers_logo_dimensions_sm_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_dimensions_hashid', + 'url', + 'width', + 'height', + ]) }} as _airbyte_sm_hashid, + tmp.* +from {{ ref('vouchers_logo_dimensions_sm_ab2') }} tmp +-- sm at vouchers/logo/dimensions/sm +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/vouchers_options_ab1.sql b/models/generated/airbyte_ctes/unibag/vouchers_options_ab1.sql new file mode 100644 index 0000000..38848f1 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/vouchers_options_ab1.sql @@ -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('vouchers') }} +select + _airbyte_vouchers_hashid, + {{ json_extract('table_alias', adapter.quote('options'), ['bonus'], ['bonus']) }} as bonus, + {{ json_extract_array(adapter.quote('options'), ['milestones'], ['milestones']) }} as milestones, + {{ json_extract_scalar(adapter.quote('options'), ['transactionMinValue'], ['transactionMinValue']) }} as transactionminvalue, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('vouchers') }} as table_alias +-- options at vouchers/options +where 1 = 1 +and {{ adapter.quote('options') }} is not null + diff --git a/models/generated/airbyte_ctes/unibag/vouchers_options_ab2.sql b/models/generated/airbyte_ctes/unibag/vouchers_options_ab2.sql new file mode 100644 index 0000000..e84e700 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/vouchers_options_ab2.sql @@ -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('vouchers_options_ab1') }} +select + _airbyte_vouchers_hashid, + cast(bonus as {{ type_json() }}) as bonus, + milestones, + cast(transactionminvalue as {{ dbt_utils.type_float() }}) as transactionminvalue, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('vouchers_options_ab1') }} +-- options at vouchers/options +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/vouchers_options_ab3.sql b/models/generated/airbyte_ctes/unibag/vouchers_options_ab3.sql new file mode 100644 index 0000000..29e4df1 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/vouchers_options_ab3.sql @@ -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('vouchers_options_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_vouchers_hashid', + object_to_string('bonus'), + array_to_string('milestones'), + 'transactionminvalue', + ]) }} as _airbyte_options_hashid, + tmp.* +from {{ ref('vouchers_options_ab2') }} tmp +-- options at vouchers/options +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/vouchers_options_bonus_ab1.sql b/models/generated/airbyte_ctes/unibag/vouchers_options_bonus_ab1.sql new file mode 100644 index 0000000..2b51112 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/vouchers_options_bonus_ab1.sql @@ -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('vouchers_options') }} +select + _airbyte_options_hashid, + {{ json_extract_scalar('bonus', ['type'], ['type']) }} as {{ adapter.quote('type') }}, + {{ json_extract_scalar('bonus', ['value'], ['value']) }} as {{ adapter.quote('value') }}, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('vouchers_options') }} as table_alias +-- bonus at vouchers/options/bonus +where 1 = 1 +and bonus is not null + diff --git a/models/generated/airbyte_ctes/unibag/vouchers_options_bonus_ab2.sql b/models/generated/airbyte_ctes/unibag/vouchers_options_bonus_ab2.sql new file mode 100644 index 0000000..516f6df --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/vouchers_options_bonus_ab2.sql @@ -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('vouchers_options_bonus_ab1') }} +select + _airbyte_options_hashid, + cast({{ adapter.quote('type') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('type') }}, + cast({{ adapter.quote('value') }} as {{ dbt_utils.type_float() }}) as {{ adapter.quote('value') }}, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at +from {{ ref('vouchers_options_bonus_ab1') }} +-- bonus at vouchers/options/bonus +where 1 = 1 + diff --git a/models/generated/airbyte_ctes/unibag/vouchers_options_bonus_ab3.sql b/models/generated/airbyte_ctes/unibag/vouchers_options_bonus_ab3.sql new file mode 100644 index 0000000..0293721 --- /dev/null +++ b/models/generated/airbyte_ctes/unibag/vouchers_options_bonus_ab3.sql @@ -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('vouchers_options_bonus_ab2') }} +select + {{ dbt_utils.surrogate_key([ + '_airbyte_options_hashid', + adapter.quote('type'), + adapter.quote('value'), + ]) }} as _airbyte_bonus_hashid, + tmp.* +from {{ ref('vouchers_options_bonus_ab2') }} tmp +-- bonus at vouchers/options/bonus +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/cash_flows_options.sql b/models/generated/airbyte_tables/unibag/cash_flows_options.sql new file mode 100644 index 0000000..58f310f --- /dev/null +++ b/models/generated/airbyte_tables/unibag/cash_flows_options.sql @@ -0,0 +1,22 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('cash_flows_options_ab3') }} +select + _airbyte_cash_flows_hashid, + orderid, + ordercode, + givegiftid, + givegifttitle, + usergivegiftid, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_options_hashid +from {{ ref('cash_flows_options_ab3') }} +-- options at cash-flows/options from {{ ref('cash_flows') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/customers_info.sql b/models/generated/airbyte_tables/unibag/customers_info.sql new file mode 100644 index 0000000..09f791d --- /dev/null +++ b/models/generated/airbyte_tables/unibag/customers_info.sql @@ -0,0 +1,22 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('customers_info_ab3') }} +select + _airbyte_customers_hashid, + {{ adapter.quote('name') }}, + email, + address, + companyname, + taxidentificationnumber, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_info_hashid +from {{ ref('customers_info_ab3') }} +-- info at customers/info from {{ ref('customers') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/customers_statistic.sql b/models/generated/airbyte_tables/unibag/customers_statistic.sql new file mode 100644 index 0000000..f4a546d --- /dev/null +++ b/models/generated/airbyte_tables/unibag/customers_statistic.sql @@ -0,0 +1,22 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('customers_statistic_ab3') }} +select + _airbyte_customers_hashid, + expensetotal, + transactiontotal_aibyte_transform, + transactionpending_aibyte_transform, + transactionsuccess_aibyte_transform, + transactionrejected_aibyte_transform, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_statistic_hashid +from {{ ref('customers_statistic_ab3') }} +-- statistic at customers/statistic from {{ ref('customers') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/event_rewards_options.sql b/models/generated/airbyte_tables/unibag/event_rewards_options.sql new file mode 100644 index 0000000..1fced9e --- /dev/null +++ b/models/generated/airbyte_tables/unibag/event_rewards_options.sql @@ -0,0 +1,23 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('event_rewards_options_ab3') }} +select + _airbyte_event_rewards_hashid, + {{ adapter.quote('order') }}, + invitee, + {{ adapter.quote('percent') }}, + referral, + minordervalue, + minordertoclaim, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_options_hashid +from {{ ref('event_rewards_options_ab3') }} +-- options at event-rewards/options from {{ ref('event_rewards') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/events_cover.sql b/models/generated/airbyte_tables/unibag/events_cover.sql new file mode 100644 index 0000000..9ea513a --- /dev/null +++ b/models/generated/airbyte_tables/unibag/events_cover.sql @@ -0,0 +1,20 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('events_cover_ab3') }} +select + _airbyte_events_hashid, + _id, + {{ adapter.quote('name') }}, + dimensions, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_cover_hashid +from {{ ref('events_cover_ab3') }} +-- cover at events/cover from {{ ref('events') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/events_cover_dimensions.sql b/models/generated/airbyte_tables/unibag/events_cover_dimensions.sql new file mode 100644 index 0000000..655796e --- /dev/null +++ b/models/generated/airbyte_tables/unibag/events_cover_dimensions.sql @@ -0,0 +1,19 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('events_cover_dimensions_ab3') }} +select + _airbyte_cover_hashid, + md, + sm, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_dimensions_hashid +from {{ ref('events_cover_dimensions_ab3') }} +-- dimensions at events/cover/dimensions from {{ ref('events_cover') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/events_cover_dimensions_md.sql b/models/generated/airbyte_tables/unibag/events_cover_dimensions_md.sql new file mode 100644 index 0000000..6cdb008 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/events_cover_dimensions_md.sql @@ -0,0 +1,20 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('events_cover_dimensions_md_ab3') }} +select + _airbyte_dimensions_hashid, + url, + width, + height, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_md_hashid +from {{ ref('events_cover_dimensions_md_ab3') }} +-- md at events/cover/dimensions/md from {{ ref('events_cover_dimensions') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/events_cover_dimensions_sm.sql b/models/generated/airbyte_tables/unibag/events_cover_dimensions_sm.sql new file mode 100644 index 0000000..20c2f72 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/events_cover_dimensions_sm.sql @@ -0,0 +1,20 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('events_cover_dimensions_sm_ab3') }} +select + _airbyte_dimensions_hashid, + url, + width, + height, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_sm_hashid +from {{ ref('events_cover_dimensions_sm_ab3') }} +-- sm at events/cover/dimensions/sm from {{ ref('events_cover_dimensions') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/events_icon.sql b/models/generated/airbyte_tables/unibag/events_icon.sql new file mode 100644 index 0000000..fb12315 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/events_icon.sql @@ -0,0 +1,20 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('events_icon_ab3') }} +select + _airbyte_events_hashid, + _id, + {{ adapter.quote('name') }}, + dimensions, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_icon_hashid +from {{ ref('events_icon_ab3') }} +-- icon at events/icon from {{ ref('events') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/events_icon_dimensions.sql b/models/generated/airbyte_tables/unibag/events_icon_dimensions.sql new file mode 100644 index 0000000..9f9c224 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/events_icon_dimensions.sql @@ -0,0 +1,19 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('events_icon_dimensions_ab3') }} +select + _airbyte_icon_hashid, + md, + sm, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_dimensions_hashid +from {{ ref('events_icon_dimensions_ab3') }} +-- dimensions at events/icon/dimensions from {{ ref('events_icon') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/events_icon_dimensions_md.sql b/models/generated/airbyte_tables/unibag/events_icon_dimensions_md.sql new file mode 100644 index 0000000..09adb51 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/events_icon_dimensions_md.sql @@ -0,0 +1,20 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('events_icon_dimensions_md_ab3') }} +select + _airbyte_dimensions_hashid, + url, + width, + height, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_md_hashid +from {{ ref('events_icon_dimensions_md_ab3') }} +-- md at events/icon/dimensions/md from {{ ref('events_icon_dimensions') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/events_icon_dimensions_sm.sql b/models/generated/airbyte_tables/unibag/events_icon_dimensions_sm.sql new file mode 100644 index 0000000..861768f --- /dev/null +++ b/models/generated/airbyte_tables/unibag/events_icon_dimensions_sm.sql @@ -0,0 +1,20 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('events_icon_dimensions_sm_ab3') }} +select + _airbyte_dimensions_hashid, + url, + width, + height, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_sm_hashid +from {{ ref('events_icon_dimensions_sm_ab3') }} +-- sm at events/icon/dimensions/sm from {{ ref('events_icon_dimensions') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/events_notice.sql b/models/generated/airbyte_tables/unibag/events_notice.sql new file mode 100644 index 0000000..16a4a63 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/events_notice.sql @@ -0,0 +1,19 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('events_notice_ab3') }} +select + _airbyte_events_hashid, + {{ adapter.quote('label') }}, + {{ adapter.quote('value') }}, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_notice_hashid +from {{ ref('events_notice_ab3') }} +-- notice at events/notice from {{ ref('events') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/events_options.sql b/models/generated/airbyte_tables/unibag/events_options.sql new file mode 100644 index 0000000..2181c78 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/events_options.sql @@ -0,0 +1,23 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('events_options_ab3') }} +select + _airbyte_events_hashid, + cash, + {{ adapter.quote('percent') }}, + validindays, + minordervalue, + minordertoclaim, + usercreatedbeforedate, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_options_hashid +from {{ ref('events_options_ab3') }} +-- options at events/options from {{ ref('events') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/events_segments.sql b/models/generated/airbyte_tables/unibag/events_segments.sql new file mode 100644 index 0000000..7389519 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/events_segments.sql @@ -0,0 +1,21 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('events_segments_ab3') }} +select + _airbyte_events_hashid, + segments, + usersegment, + lastmonthsales, + highestmonthlysales, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_segments_hashid +from {{ ref('events_segments_ab3') }} +-- segments at events/segments from {{ ref('events') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/events_segments_highestmonthlysales.sql b/models/generated/airbyte_tables/unibag/events_segments_highestmonthlysales.sql new file mode 100644 index 0000000..b31db28 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/events_segments_highestmonthlysales.sql @@ -0,0 +1,20 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('events_segments_highestmonthlysales_ab3') }} +select + _airbyte_segments_hashid, + {{ adapter.quote('to') }}, + {{ adapter.quote('from') }}, + active, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_highestmonthlysales_hashid +from {{ ref('events_segments_highestmonthlysales_ab3') }} +-- highestmonthlysales at events/segments/highestMonthlySales from {{ ref('events_segments') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/events_segments_lastmonthsales.sql b/models/generated/airbyte_tables/unibag/events_segments_lastmonthsales.sql new file mode 100644 index 0000000..d18062e --- /dev/null +++ b/models/generated/airbyte_tables/unibag/events_segments_lastmonthsales.sql @@ -0,0 +1,20 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('events_segments_lastmonthsales_ab3') }} +select + _airbyte_segments_hashid, + {{ adapter.quote('to') }}, + {{ adapter.quote('from') }}, + active, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_lastmonthsales_hashid +from {{ ref('events_segments_lastmonthsales_ab3') }} +-- lastmonthsales at events/segments/lastMonthSales from {{ ref('events_segments') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/inventories_contact.sql b/models/generated/airbyte_tables/unibag/inventories_contact.sql new file mode 100644 index 0000000..f3e0942 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/inventories_contact.sql @@ -0,0 +1,21 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('inventories_contact_ab3') }} +select + _airbyte_inventories_hashid, + {{ adapter.quote('name') }}, + email, + phone, + address, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_contact_hashid +from {{ ref('inventories_contact_ab3') }} +-- contact at inventories/contact from {{ ref('inventories') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/inventories_location.sql b/models/generated/airbyte_tables/unibag/inventories_location.sql new file mode 100644 index 0000000..86cd35e --- /dev/null +++ b/models/generated/airbyte_tables/unibag/inventories_location.sql @@ -0,0 +1,22 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('inventories_location_ab3') }} +select + _airbyte_inventories_hashid, + ward, + address, + district, + {{ adapter.quote('location') }}, + province, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_location_hashid +from {{ ref('inventories_location_ab3') }} +-- location at inventories/location from {{ ref('inventories') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/inventories_location_location.sql b/models/generated/airbyte_tables/unibag/inventories_location_location.sql new file mode 100644 index 0000000..3c8a1bf --- /dev/null +++ b/models/generated/airbyte_tables/unibag/inventories_location_location.sql @@ -0,0 +1,19 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('inventories_location_location_ab3') }} +select + _airbyte_location_hashid, + {{ adapter.quote('type') }}, + coordinates, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_location_3_hashid +from {{ ref('inventories_location_location_ab3') }} +-- location at inventories/location/location from {{ ref('inventories_location') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/inventories_partner.sql b/models/generated/airbyte_tables/unibag/inventories_partner.sql new file mode 100644 index 0000000..ec08bbf --- /dev/null +++ b/models/generated/airbyte_tables/unibag/inventories_partner.sql @@ -0,0 +1,19 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('inventories_partner_ab3') }} +select + _airbyte_inventories_hashid, + code, + identitycode, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_partner_hashid +from {{ ref('inventories_partner_ab3') }} +-- partner at inventories/partner from {{ ref('inventories') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/inventories_paymentmethods.sql b/models/generated/airbyte_tables/unibag/inventories_paymentmethods.sql new file mode 100644 index 0000000..3e5daba --- /dev/null +++ b/models/generated/airbyte_tables/unibag/inventories_paymentmethods.sql @@ -0,0 +1,19 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('inventories_paymentmethods_ab3') }} +select + _airbyte_inventories_hashid, + cod, + banktransfer, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_paymentmethods_hashid +from {{ ref('inventories_paymentmethods_ab3') }} +-- paymentmethods at inventories/paymentMethods from {{ ref('inventories') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/inventories_supplier.sql b/models/generated/airbyte_tables/unibag/inventories_supplier.sql new file mode 100644 index 0000000..ada8f96 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/inventories_supplier.sql @@ -0,0 +1,20 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('inventories_supplier_ab3') }} +select + _airbyte_inventories_hashid, + _id, + {{ adapter.quote('name') }}, + searchstring, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_supplier_hashid +from {{ ref('inventories_supplier_ab3') }} +-- supplier at inventories/supplier from {{ ref('inventories') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/membership_histories_new.sql b/models/generated/airbyte_tables/unibag/membership_histories_new.sql new file mode 100644 index 0000000..a93f95e --- /dev/null +++ b/models/generated/airbyte_tables/unibag/membership_histories_new.sql @@ -0,0 +1,24 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('membership_histories_new_ab3') }} +select + _airbyte_membership_histories_hashid, + {{ adapter.quote('name') }}, + {{ adapter.quote('level') }}, + {{ adapter.quote('condition') }}, + statistic, + {{ adapter.quote('transaction') }}, + bonuspercent, + transactionminvalue, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_new_hashid +from {{ ref('membership_histories_new_ab3') }} +-- new at membership-histories/new from {{ ref('membership_histories') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/membership_histories_new_condition.sql b/models/generated/airbyte_tables/unibag/membership_histories_new_condition.sql new file mode 100644 index 0000000..80596ee --- /dev/null +++ b/models/generated/airbyte_tables/unibag/membership_histories_new_condition.sql @@ -0,0 +1,22 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('membership_histories_new_condition_ab3') }} +select + _airbyte_new_hashid, + {{ adapter.quote('name') }}, + sales, + {{ adapter.quote('transaction') }}, + bonuspercent, + transactionminvalue, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_condition_hashid +from {{ ref('membership_histories_new_condition_ab3') }} +-- condition at membership-histories/new/condition from {{ ref('membership_histories_new') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/membership_histories_old.sql b/models/generated/airbyte_tables/unibag/membership_histories_old.sql new file mode 100644 index 0000000..0b248d4 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/membership_histories_old.sql @@ -0,0 +1,24 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('membership_histories_old_ab3') }} +select + _airbyte_membership_histories_hashid, + {{ adapter.quote('name') }}, + {{ adapter.quote('level') }}, + {{ adapter.quote('condition') }}, + statistic, + {{ adapter.quote('transaction') }}, + bonuspercent, + transactionminvalue, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_old_hashid +from {{ ref('membership_histories_old_ab3') }} +-- old at membership-histories/old from {{ ref('membership_histories') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/membership_histories_old_condition.sql b/models/generated/airbyte_tables/unibag/membership_histories_old_condition.sql new file mode 100644 index 0000000..f4468f1 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/membership_histories_old_condition.sql @@ -0,0 +1,22 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('membership_histories_old_condition_ab3') }} +select + _airbyte_old_hashid, + {{ adapter.quote('name') }}, + sales, + {{ adapter.quote('transaction') }}, + bonuspercent, + transactionminvalue, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_condition_hashid +from {{ ref('membership_histories_old_condition_ab3') }} +-- condition at membership-histories/old/condition from {{ ref('membership_histories_old') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/membership_histories_old_statistic.sql b/models/generated/airbyte_tables/unibag/membership_histories_old_statistic.sql new file mode 100644 index 0000000..77d7f3b --- /dev/null +++ b/models/generated/airbyte_tables/unibag/membership_histories_old_statistic.sql @@ -0,0 +1,19 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('membership_histories_old_statistic_ab3') }} +select + _airbyte_old_hashid, + sales, + {{ adapter.quote('transaction') }}, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_statistic_hashid +from {{ ref('membership_histories_old_statistic_ab3') }} +-- statistic at membership-histories/old/statistic from {{ ref('membership_histories_old') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/order_deliveries_customer.sql b/models/generated/airbyte_tables/unibag/order_deliveries_customer.sql new file mode 100644 index 0000000..367f965 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/order_deliveries_customer.sql @@ -0,0 +1,20 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('order_deliveries_customer_ab3') }} +select + _airbyte_order_deliveries_hashid, + _id, + {{ adapter.quote('name') }}, + phone, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_customer_hashid +from {{ ref('order_deliveries_customer_ab3') }} +-- customer at order-deliveries/customer from {{ ref('order_deliveries') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/order_deliveries_delivery.sql b/models/generated/airbyte_tables/unibag/order_deliveries_delivery.sql new file mode 100644 index 0000000..f58a267 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/order_deliveries_delivery.sql @@ -0,0 +1,30 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('order_deliveries_delivery_ab3') }} +select + _airbyte_order_deliveries_hashid, + _id, + fee, + {{ adapter.quote('desc') }}, + note, + feeship, + currency, + couriername, + servicecode, + servicename, + deliverycode, + maxdeliverydays, + mindeliverydays, + estimatetimedelivery, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_delivery_hashid +from {{ ref('order_deliveries_delivery_ab3') }} +-- delivery at order-deliveries/delivery from {{ ref('order_deliveries') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/order_deliveries_delivery_feeship.sql b/models/generated/airbyte_tables/unibag/order_deliveries_delivery_feeship.sql new file mode 100644 index 0000000..daf0849 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/order_deliveries_delivery_feeship.sql @@ -0,0 +1,21 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('order_deliveries_delivery_feeship_ab3') }} +select + _airbyte_delivery_hashid, + cod, + total, + shipping, + insurance, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_feeship_hashid +from {{ ref('order_deliveries_delivery_feeship_ab3') }} +-- feeship at order-deliveries/delivery/feeShip from {{ ref('order_deliveries_delivery') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/order_deliveries_location.sql b/models/generated/airbyte_tables/unibag/order_deliveries_location.sql new file mode 100644 index 0000000..8533ee8 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/order_deliveries_location.sql @@ -0,0 +1,23 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('order_deliveries_location_ab3') }} +select + _airbyte_order_deliveries_hashid, + _id, + ward, + address, + district, + province, + fulladdress, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_location_hashid +from {{ ref('order_deliveries_location_ab3') }} +-- location at order-deliveries/location from {{ ref('order_deliveries') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/order_deliveries_promotion.sql b/models/generated/airbyte_tables/unibag/order_deliveries_promotion.sql new file mode 100644 index 0000000..324de21 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/order_deliveries_promotion.sql @@ -0,0 +1,21 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('order_deliveries_promotion_ab3') }} +select + _airbyte_order_deliveries_hashid, + {{ adapter.quote('type') }}, + discount, + isapplied, + minordervalue, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_promotion_hashid +from {{ ref('order_deliveries_promotion_ab3') }} +-- promotion at order-deliveries/promotion from {{ ref('order_deliveries') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/order_deliveries_trackingtime.sql b/models/generated/airbyte_tables/unibag/order_deliveries_trackingtime.sql new file mode 100644 index 0000000..ca9a576 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/order_deliveries_trackingtime.sql @@ -0,0 +1,20 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('order_deliveries_trackingtime_ab3') }} +select + _airbyte_order_deliveries_hashid, + pickedat, + completedat, + deliveringat, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_trackingtime_hashid +from {{ ref('order_deliveries_trackingtime_ab3') }} +-- trackingtime at order-deliveries/trackingTime from {{ ref('order_deliveries') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/order_deliveries_weight.sql b/models/generated/airbyte_tables/unibag/order_deliveries_weight.sql new file mode 100644 index 0000000..4264244 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/order_deliveries_weight.sql @@ -0,0 +1,22 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('order_deliveries_weight_ab3') }} +select + _airbyte_order_deliveries_hashid, + {{ adapter.quote('real') }}, + sent, + converted, + multiplier, + convertedwithmultiplier, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_weight_hashid +from {{ ref('order_deliveries_weight_ab3') }} +-- weight at order-deliveries/weight from {{ ref('order_deliveries') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/order_items_price.sql b/models/generated/airbyte_tables/unibag/order_items_price.sql new file mode 100644 index 0000000..a8b1eaf --- /dev/null +++ b/models/generated/airbyte_tables/unibag/order_items_price.sql @@ -0,0 +1,29 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('order_items_price_ab3') }} +select + _airbyte_order_items_hashid, + base, + sell, + market, + profit, + volume, + weight, + maximum, + minimum, + profituni, + supplierprice, + membershippercent, + membershipcommission, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_price_hashid +from {{ ref('order_items_price_ab3') }} +-- price at order-items/price from {{ ref('order_items') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/order_items_sku.sql b/models/generated/airbyte_tables/unibag/order_items_sku.sql new file mode 100644 index 0000000..106ca70 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/order_items_sku.sql @@ -0,0 +1,25 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('order_items_sku_ab3') }} +select + _airbyte_order_items_hashid, + _id, + sku, + {{ adapter.quote('name') }}, + {{ adapter.quote('type') }}, + {{ adapter.quote('source') }}, + picture, + {{ adapter.quote('version') }}, + properties, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_sku_hashid +from {{ ref('order_items_sku_ab3') }} +-- sku at order-items/sku from {{ ref('order_items') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/orders_delivery.sql b/models/generated/airbyte_tables/unibag/orders_delivery.sql new file mode 100644 index 0000000..13b3558 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/orders_delivery.sql @@ -0,0 +1,40 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('orders_delivery_ab3') }} +select + _airbyte_orders_hashid, + _id, + fee, + code, + note, + title, + status, + weight, + feeship, + currency, + freeship, + {{ adapter.quote('location') }}, + sourceid, + couriername, + servicecode, + servicename, + customername, + customerphone, + discountvalue, + servicedelivery, + estimatedeliveryat, + estimatetimedelivery, + maxdeliveryday_aibyte_transform, + mindeliveryday_aibyte_transform, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_delivery_hashid +from {{ ref('orders_delivery_ab3') }} +-- delivery at orders/delivery from {{ ref('orders') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/orders_delivery_feeship.sql b/models/generated/airbyte_tables/unibag/orders_delivery_feeship.sql new file mode 100644 index 0000000..07c715e --- /dev/null +++ b/models/generated/airbyte_tables/unibag/orders_delivery_feeship.sql @@ -0,0 +1,21 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('orders_delivery_feeship_ab3') }} +select + _airbyte_delivery_hashid, + cod, + total, + shipping, + insurance, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_feeship_hashid +from {{ ref('orders_delivery_feeship_ab3') }} +-- feeship at orders/delivery/feeShip from {{ ref('orders_delivery') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/orders_delivery_location.sql b/models/generated/airbyte_tables/unibag/orders_delivery_location.sql new file mode 100644 index 0000000..16cc1c8 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/orders_delivery_location.sql @@ -0,0 +1,23 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('orders_delivery_location_ab3') }} +select + _airbyte_delivery_hashid, + _id, + ward, + address, + district, + province, + fulladdress, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_location_hashid +from {{ ref('orders_delivery_location_ab3') }} +-- location at orders/delivery/location from {{ ref('orders_delivery') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/orders_delivery_weight.sql b/models/generated/airbyte_tables/unibag/orders_delivery_weight.sql new file mode 100644 index 0000000..27ee0c5 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/orders_delivery_weight.sql @@ -0,0 +1,22 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('orders_delivery_weight_ab3') }} +select + _airbyte_delivery_hashid, + {{ adapter.quote('real') }}, + sent, + converted, + multiplier, + convertedwithmultiplier, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_weight_hashid +from {{ ref('orders_delivery_weight_ab3') }} +-- weight at orders/delivery/weight from {{ ref('orders_delivery') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/orders_inventory.sql b/models/generated/airbyte_tables/unibag/orders_inventory.sql new file mode 100644 index 0000000..e609aef --- /dev/null +++ b/models/generated/airbyte_tables/unibag/orders_inventory.sql @@ -0,0 +1,21 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('orders_inventory_ab3') }} +select + _airbyte_orders_hashid, + {{ adapter.quote('id') }}, + _id, + {{ adapter.quote('name') }}, + canissueinvoice, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_inventory_hashid +from {{ ref('orders_inventory_ab3') }} +-- inventory at orders/inventory from {{ ref('orders') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/orders_payment.sql b/models/generated/airbyte_tables/unibag/orders_payment.sql new file mode 100644 index 0000000..855cef5 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/orders_payment.sql @@ -0,0 +1,20 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('orders_payment_ab3') }} +select + _airbyte_orders_hashid, + _id, + {{ adapter.quote('method') }}, + status, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_payment_hashid +from {{ ref('orders_payment_ab3') }} +-- payment at orders/payment from {{ ref('orders') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/orders_price.sql b/models/generated/airbyte_tables/unibag/orders_price.sql new file mode 100644 index 0000000..e7fa5eb --- /dev/null +++ b/models/generated/airbyte_tables/unibag/orders_price.sql @@ -0,0 +1,31 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('orders_price_ab3') }} +select + _airbyte_orders_hashid, + sell, + total, + market, + weight, + maximum, + minimum, + profituni, + promotion, + supplierprice, + wholesalebonus, + membershippercent, + membershipcommission, + base_aibyte_transform, + profit_aibyte_transform, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_price_hashid +from {{ ref('orders_price_ab3') }} +-- price at orders/price from {{ ref('orders') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/orders_promotion.sql b/models/generated/airbyte_tables/unibag/orders_promotion.sql new file mode 100644 index 0000000..67ff4f5 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/orders_promotion.sql @@ -0,0 +1,21 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('orders_promotion_ab3') }} +select + _airbyte_orders_hashid, + {{ adapter.quote('type') }}, + discount, + isapplied, + minordervalue, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_promotion_hashid +from {{ ref('orders_promotion_ab3') }} +-- promotion at orders/promotion from {{ ref('orders') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/orders_sendemail.sql b/models/generated/airbyte_tables/unibag/orders_sendemail.sql new file mode 100644 index 0000000..a6a6f17 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/orders_sendemail.sql @@ -0,0 +1,18 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('orders_sendemail_ab3') }} +select + _airbyte_orders_hashid, + status, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_sendemail_hashid +from {{ ref('orders_sendemail_ab3') }} +-- sendemail at orders/sendEmail from {{ ref('orders') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/orders_supplier.sql b/models/generated/airbyte_tables/unibag/orders_supplier.sql new file mode 100644 index 0000000..2e4c2c5 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/orders_supplier.sql @@ -0,0 +1,20 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('orders_supplier_ab3') }} +select + _airbyte_orders_hashid, + _id, + {{ adapter.quote('name') }}, + searchstring, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_supplier_hashid +from {{ ref('orders_supplier_ab3') }} +-- supplier at orders/supplier from {{ ref('orders') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/orders_useragent.sql b/models/generated/airbyte_tables/unibag/orders_useragent.sql new file mode 100644 index 0000000..dd5698f --- /dev/null +++ b/models/generated/airbyte_tables/unibag/orders_useragent.sql @@ -0,0 +1,20 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('orders_useragent_ab3') }} +select + _airbyte_orders_hashid, + ip, + {{ adapter.quote('version') }}, + platform, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_useragent_hashid +from {{ ref('orders_useragent_ab3') }} +-- useragent at orders/userAgent from {{ ref('orders') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/product_categories_icon.sql b/models/generated/airbyte_tables/unibag/product_categories_icon.sql new file mode 100644 index 0000000..7adf240 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/product_categories_icon.sql @@ -0,0 +1,20 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('product_categories_icon_ab3') }} +select + _airbyte_product_categories_hashid, + _id, + {{ adapter.quote('name') }}, + dimensions, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_icon_hashid +from {{ ref('product_categories_icon_ab3') }} +-- icon at product-categories/icon from {{ ref('product_categories') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/product_categories_icon_dimensions.sql b/models/generated/airbyte_tables/unibag/product_categories_icon_dimensions.sql new file mode 100644 index 0000000..7e66ea9 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/product_categories_icon_dimensions.sql @@ -0,0 +1,19 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('product_categories_icon_dimensions_ab3') }} +select + _airbyte_icon_hashid, + md, + sm, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_dimensions_hashid +from {{ ref('product_categories_icon_dimensions_ab3') }} +-- dimensions at product-categories/icon/dimensions from {{ ref('product_categories_icon') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/product_categories_icon_dimensions_md.sql b/models/generated/airbyte_tables/unibag/product_categories_icon_dimensions_md.sql new file mode 100644 index 0000000..0f524e1 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/product_categories_icon_dimensions_md.sql @@ -0,0 +1,20 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('product_categories_icon_dimensions_md_ab3') }} +select + _airbyte_dimensions_hashid, + url, + width, + height, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_md_hashid +from {{ ref('product_categories_icon_dimensions_md_ab3') }} +-- md at product-categories/icon/dimensions/md from {{ ref('product_categories_icon_dimensions') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/product_categories_icon_dimensions_sm.sql b/models/generated/airbyte_tables/unibag/product_categories_icon_dimensions_sm.sql new file mode 100644 index 0000000..0e4d668 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/product_categories_icon_dimensions_sm.sql @@ -0,0 +1,20 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('product_categories_icon_dimensions_sm_ab3') }} +select + _airbyte_dimensions_hashid, + url, + width, + height, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_sm_hashid +from {{ ref('product_categories_icon_dimensions_sm_ab3') }} +-- sm at product-categories/icon/dimensions/sm from {{ ref('product_categories_icon_dimensions') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/product_categories_statistic.sql b/models/generated/airbyte_tables/unibag/product_categories_statistic.sql new file mode 100644 index 0000000..74d8bc8 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/product_categories_statistic.sql @@ -0,0 +1,23 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('product_categories_statistic_ab3') }} +select + _airbyte_product_categories_hashid, + salestotal, + totalshare, + salesweektotal, + salesyeartotal, + salesmonthtotal, + salestwomonthtotal, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_statistic_hashid +from {{ ref('product_categories_statistic_ab3') }} +-- statistic at product-categories/statistic from {{ ref('product_categories') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/product_sku.sql b/models/generated/airbyte_tables/unibag/product_sku.sql index b62ba82..795af0c 100644 --- a/models/generated/airbyte_tables/unibag/product_sku.sql +++ b/models/generated/airbyte_tables/unibag/product_sku.sql @@ -24,6 +24,7 @@ select {{ adapter.quote('info') }}::json->'supplier'->>'name' AS supplier_name, {{ adapter.quote('info') }}::json->>'dimension' AS info_dimension, unitCode AS info_unit_code, + supplierSku AS supplier_sku, cast({{ adapter.quote('info') }}::json->>'weight' AS numeric) AS info_weight, cast({{ adapter.quote('statistic') }}::json->>'saleTotal' AS numeric) AS stats_sale_total, cast({{ adapter.quote('statistic') }}::json->>'salePending' AS numeric) AS stats_sale_pending, diff --git a/models/generated/airbyte_tables/unibag/product_sku_info.sql b/models/generated/airbyte_tables/unibag/product_sku_info.sql new file mode 100644 index 0000000..a7a1109 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/product_sku_info.sql @@ -0,0 +1,22 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('product_sku_info_ab3') }} +select + _airbyte_product_sku_hashid, + weight, + category, + supplier, + dimension, + inventory, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_info_hashid +from {{ ref('product_sku_info_ab3') }} +-- info at product-sku/info from {{ ref('product_sku') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/product_sku_info_category.sql b/models/generated/airbyte_tables/unibag/product_sku_info_category.sql new file mode 100644 index 0000000..a83f95c --- /dev/null +++ b/models/generated/airbyte_tables/unibag/product_sku_info_category.sql @@ -0,0 +1,21 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('product_sku_info_category_ab3') }} +select + _airbyte_info_hashid, + {{ adapter.quote('id') }}, + _id, + {{ adapter.quote('name') }}, + searchstring, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_category_hashid +from {{ ref('product_sku_info_category_ab3') }} +-- category at product-sku/info/category from {{ ref('product_sku_info') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/product_sku_info_inv__ory_location_location.sql b/models/generated/airbyte_tables/unibag/product_sku_info_inv__ory_location_location.sql new file mode 100644 index 0000000..a0872d4 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/product_sku_info_inv__ory_location_location.sql @@ -0,0 +1,19 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('product_sku_info_inv__ory_location_location_ab3') }} +select + _airbyte_location_hashid, + {{ adapter.quote('type') }}, + coordinates, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_location_5_hashid +from {{ ref('product_sku_info_inv__ory_location_location_ab3') }} +-- location at product-sku/info/inventory/location/location from {{ ref('product_sku_info_inventory_location') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/product_sku_info_inventory.sql b/models/generated/airbyte_tables/unibag/product_sku_info_inventory.sql new file mode 100644 index 0000000..f5a5381 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/product_sku_info_inventory.sql @@ -0,0 +1,22 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('product_sku_info_inventory_ab3') }} +select + _airbyte_info_hashid, + {{ adapter.quote('id') }}, + _id, + {{ adapter.quote('name') }}, + {{ adapter.quote('location') }}, + searchstring, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_inventory_hashid +from {{ ref('product_sku_info_inventory_ab3') }} +-- inventory at product-sku/info/inventory from {{ ref('product_sku_info') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/product_sku_info_inventory_location.sql b/models/generated/airbyte_tables/unibag/product_sku_info_inventory_location.sql new file mode 100644 index 0000000..dc6c026 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/product_sku_info_inventory_location.sql @@ -0,0 +1,22 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('product_sku_info_inventory_location_ab3') }} +select + _airbyte_inventory_hashid, + ward, + address, + district, + {{ adapter.quote('location') }}, + province, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_location_hashid +from {{ ref('product_sku_info_inventory_location_ab3') }} +-- location at product-sku/info/inventory/location from {{ ref('product_sku_info_inventory') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/product_sku_info_supplier.sql b/models/generated/airbyte_tables/unibag/product_sku_info_supplier.sql new file mode 100644 index 0000000..90080c4 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/product_sku_info_supplier.sql @@ -0,0 +1,21 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('product_sku_info_supplier_ab3') }} +select + _airbyte_info_hashid, + {{ adapter.quote('id') }}, + _id, + {{ adapter.quote('name') }}, + searchstring, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_supplier_hashid +from {{ ref('product_sku_info_supplier_ab3') }} +-- supplier at product-sku/info/supplier from {{ ref('product_sku_info') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/product_sku_price.sql b/models/generated/airbyte_tables/unibag/product_sku_price.sql new file mode 100644 index 0000000..d24f6e2 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/product_sku_price.sql @@ -0,0 +1,24 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('product_sku_price_ab3') }} +select + _airbyte_product_sku_hashid, + base, + market, + profit, + maximum, + minimum, + supplier, + wholesalebonus, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_price_hashid +from {{ ref('product_sku_price_ab3') }} +-- price at product-sku/price from {{ ref('product_sku') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/product_sku_pricepercent.sql b/models/generated/airbyte_tables/unibag/product_sku_pricepercent.sql new file mode 100644 index 0000000..20c0c48 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/product_sku_pricepercent.sql @@ -0,0 +1,19 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('product_sku_pricepercent_ab3') }} +select + _airbyte_product_sku_hashid, + supplier, + minimumpricedifferential, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_pricepercent_hashid +from {{ ref('product_sku_pricepercent_ab3') }} +-- pricepercent at product-sku/pricePercent from {{ ref('product_sku') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/product_sku_statistic.sql b/models/generated/airbyte_tables/unibag/product_sku_statistic.sql new file mode 100644 index 0000000..4087a3e --- /dev/null +++ b/models/generated/airbyte_tables/unibag/product_sku_statistic.sql @@ -0,0 +1,25 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('product_sku_statistic_ab3') }} +select + _airbyte_product_sku_hashid, + saletotal, + salepending, + salewaiting, + salecashback, + salecancelled, + saledelivered, + saledelivering, + salepaymentprocessing, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_statistic_hashid +from {{ ref('product_sku_statistic_ab3') }} +-- statistic at product-sku/statistic from {{ ref('product_sku') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/product_sku_versions_info.sql b/models/generated/airbyte_tables/unibag/product_sku_versions_info.sql new file mode 100644 index 0000000..bf223a2 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/product_sku_versions_info.sql @@ -0,0 +1,22 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('product_sku_versions_info_ab3') }} +select + _airbyte_product_sku_versions_hashid, + weight, + category, + supplier, + dimension, + inventory, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_info_hashid +from {{ ref('product_sku_versions_info_ab3') }} +-- info at product-sku-versions/info from {{ ref('product_sku_versions') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/product_sku_versions_info_category.sql b/models/generated/airbyte_tables/unibag/product_sku_versions_info_category.sql new file mode 100644 index 0000000..656a7f5 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/product_sku_versions_info_category.sql @@ -0,0 +1,20 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('product_sku_versions_info_category_ab3') }} +select + _airbyte_info_hashid, + {{ adapter.quote('id') }}, + {{ adapter.quote('name') }}, + searchstring, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_category_hashid +from {{ ref('product_sku_versions_info_category_ab3') }} +-- category at product-sku-versions/info/category from {{ ref('product_sku_versions_info') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/product_sku_versions_info_inventory.sql b/models/generated/airbyte_tables/unibag/product_sku_versions_info_inventory.sql new file mode 100644 index 0000000..db06d5f --- /dev/null +++ b/models/generated/airbyte_tables/unibag/product_sku_versions_info_inventory.sql @@ -0,0 +1,21 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('product_sku_versions_info_inventory_ab3') }} +select + _airbyte_info_hashid, + {{ adapter.quote('id') }}, + _id, + {{ adapter.quote('name') }}, + searchstring, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_inventory_hashid +from {{ ref('product_sku_versions_info_inventory_ab3') }} +-- inventory at product-sku-versions/info/inventory from {{ ref('product_sku_versions_info') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/product_sku_versions_info_supplier.sql b/models/generated/airbyte_tables/unibag/product_sku_versions_info_supplier.sql new file mode 100644 index 0000000..cb39c1d --- /dev/null +++ b/models/generated/airbyte_tables/unibag/product_sku_versions_info_supplier.sql @@ -0,0 +1,20 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('product_sku_versions_info_supplier_ab3') }} +select + _airbyte_info_hashid, + {{ adapter.quote('id') }}, + {{ adapter.quote('name') }}, + searchstring, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_supplier_hashid +from {{ ref('product_sku_versions_info_supplier_ab3') }} +-- supplier at product-sku-versions/info/supplier from {{ ref('product_sku_versions_info') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/product_sku_versions_price.sql b/models/generated/airbyte_tables/unibag/product_sku_versions_price.sql new file mode 100644 index 0000000..2c632b6 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/product_sku_versions_price.sql @@ -0,0 +1,22 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('product_sku_versions_price_ab3') }} +select + _airbyte_product_sku_versions_hashid, + base, + market, + maximum, + minimum, + supplier, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_price_hashid +from {{ ref('product_sku_versions_price_ab3') }} +-- price at product-sku-versions/price from {{ ref('product_sku_versions') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/product_sku_versions_statistic.sql b/models/generated/airbyte_tables/unibag/product_sku_versions_statistic.sql new file mode 100644 index 0000000..da12b57 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/product_sku_versions_statistic.sql @@ -0,0 +1,25 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('product_sku_versions_statistic_ab3') }} +select + _airbyte_product_sku_versions_hashid, + saletotal, + salepending, + salewaiting, + salecashback, + salecancelled, + saledelivered, + saledelivering, + salepaymentprocessing, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_statistic_hashid +from {{ ref('product_sku_versions_statistic_ab3') }} +-- statistic at product-sku-versions/statistic from {{ ref('product_sku_versions') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/products_info.sql b/models/generated/airbyte_tables/unibag/products_info.sql new file mode 100644 index 0000000..56ace36 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/products_info.sql @@ -0,0 +1,21 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('products_info_ab3') }} +select + _airbyte_products_hashid, + profit, + category, + supplier, + inventory, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_info_hashid +from {{ ref('products_info_ab3') }} +-- info at products/info from {{ ref('products') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/products_info_category.sql b/models/generated/airbyte_tables/unibag/products_info_category.sql new file mode 100644 index 0000000..ac7373a --- /dev/null +++ b/models/generated/airbyte_tables/unibag/products_info_category.sql @@ -0,0 +1,21 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('products_info_category_ab3') }} +select + _airbyte_info_hashid, + {{ adapter.quote('id') }}, + _id, + {{ adapter.quote('name') }}, + searchstring, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_category_hashid +from {{ ref('products_info_category_ab3') }} +-- category at products/info/category from {{ ref('products_info') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/products_info_inventory.sql b/models/generated/airbyte_tables/unibag/products_info_inventory.sql new file mode 100644 index 0000000..52b6da1 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/products_info_inventory.sql @@ -0,0 +1,22 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('products_info_inventory_ab3') }} +select + _airbyte_info_hashid, + {{ adapter.quote('id') }}, + _id, + {{ adapter.quote('name') }}, + {{ adapter.quote('location') }}, + searchstring, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_inventory_hashid +from {{ ref('products_info_inventory_ab3') }} +-- inventory at products/info/inventory from {{ ref('products_info') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/products_info_inventory_location.sql b/models/generated/airbyte_tables/unibag/products_info_inventory_location.sql new file mode 100644 index 0000000..ed14f92 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/products_info_inventory_location.sql @@ -0,0 +1,23 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('products_info_inventory_location_ab3') }} +select + _airbyte_inventory_hashid, + ward, + address, + district, + {{ adapter.quote('location') }}, + province, + provincename, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_location_hashid +from {{ ref('products_info_inventory_location_ab3') }} +-- location at products/info/inventory/location from {{ ref('products_info_inventory') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/products_info_inventory_location_location.sql b/models/generated/airbyte_tables/unibag/products_info_inventory_location_location.sql new file mode 100644 index 0000000..670709f --- /dev/null +++ b/models/generated/airbyte_tables/unibag/products_info_inventory_location_location.sql @@ -0,0 +1,19 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('products_info_inventory_location_location_ab3') }} +select + _airbyte_location_hashid, + {{ adapter.quote('type') }}, + coordinates, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_location_5_hashid +from {{ ref('products_info_inventory_location_location_ab3') }} +-- location at products/info/inventory/location/location from {{ ref('products_info_inventory_location') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/products_info_supplier.sql b/models/generated/airbyte_tables/unibag/products_info_supplier.sql new file mode 100644 index 0000000..62fe778 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/products_info_supplier.sql @@ -0,0 +1,21 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('products_info_supplier_ab3') }} +select + _airbyte_info_hashid, + {{ adapter.quote('id') }}, + _id, + {{ adapter.quote('name') }}, + searchstring, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_supplier_hashid +from {{ ref('products_info_supplier_ab3') }} +-- supplier at products/info/supplier from {{ ref('products_info') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/products_order.sql b/models/generated/airbyte_tables/unibag/products_order.sql new file mode 100644 index 0000000..c29b2d2 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/products_order.sql @@ -0,0 +1,22 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('products_order_ab3') }} +select + _airbyte_products_hashid, + newest, + profit, + topsale, + scoreyesterday, + region_aibyte_transform, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_order_hashid +from {{ ref('products_order_ab3') }} +-- order at products/order from {{ ref('products') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/products_price.sql b/models/generated/airbyte_tables/unibag/products_price.sql new file mode 100644 index 0000000..531c7ac --- /dev/null +++ b/models/generated/airbyte_tables/unibag/products_price.sql @@ -0,0 +1,24 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('products_price_ab3') }} +select + _airbyte_products_hashid, + base, + market, + profit, + maximum, + minimum, + supplier, + wholesalebonus, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_price_hashid +from {{ ref('products_price_ab3') }} +-- price at products/price from {{ ref('products') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/products_pricepercent.sql b/models/generated/airbyte_tables/unibag/products_pricepercent.sql new file mode 100644 index 0000000..49b5942 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/products_pricepercent.sql @@ -0,0 +1,24 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('products_pricepercent_ab3') }} +select + _airbyte_products_hashid, + base, + selly, + market, + maximum, + minimum, + supplier, + minimumpricedifferential, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_pricepercent_hashid +from {{ ref('products_pricepercent_ab3') }} +-- pricepercent at products/pricePercent from {{ ref('products') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/products_reviewstatistic.sql b/models/generated/airbyte_tables/unibag/products_reviewstatistic.sql new file mode 100644 index 0000000..27e65d4 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/products_reviewstatistic.sql @@ -0,0 +1,31 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('products_reviewstatistic_ab3') }} +select + _airbyte_products_hashid, + total, + totalreview, + totalscore1, + totalscore2, + totalscore3, + totalscore4, + totalscore5, + scoreaverage, + totalhasmedia, + totalhascontent, + scoreaverageweektotal, + scoreaverageyeartotal, + scoreaveragemonthtotal, + scoreaveragetwomonthtotal, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_reviewstatistic_hashid +from {{ ref('products_reviewstatistic_ab3') }} +-- reviewstatistic at products/reviewStatistic from {{ ref('products') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/products_score.sql b/models/generated/airbyte_tables/unibag/products_score.sql new file mode 100644 index 0000000..709faf1 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/products_score.sql @@ -0,0 +1,21 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('products_score_ab3') }} +select + _airbyte_products_hashid, + {{ adapter.quote('view') }}, + {{ adapter.quote('order') }}, + profit, + {{ adapter.quote('current') }}, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_score_hashid +from {{ ref('products_score_ab3') }} +-- score at products/score from {{ ref('products') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/products_sharestatistic.sql b/models/generated/airbyte_tables/unibag/products_sharestatistic.sql new file mode 100644 index 0000000..d33c823 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/products_sharestatistic.sql @@ -0,0 +1,22 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('products_sharestatistic_ab3') }} +select + _airbyte_products_hashid, + totalshare, + totalsharefromsocialpost, + totalsharefromproductdetail, + totaluniquesharefromsocialpost, + totaluniquesharefromproductdetail, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_sharestatistic_hashid +from {{ ref('products_sharestatistic_ab3') }} +-- sharestatistic at products/shareStatistic from {{ ref('products') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/products_statistic.sql b/models/generated/airbyte_tables/unibag/products_statistic.sql new file mode 100644 index 0000000..8a17476 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/products_statistic.sql @@ -0,0 +1,39 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('products_statistic_ab3') }} +select + _airbyte_products_hashid, + {{ adapter.quote('view') }}, + skutotal, + saletotal, + skuactive, + totalpost, + salestotal, + salepending, + salewaiting, + salecashback, + salecancelled, + saledelivered, + saleweektotal, + saleyeartotal, + saledelivering, + salemonthtotal, + salesweektotal, + salesyeartotal, + salesmonthtotal, + saletwomonthtotal, + salestwomonthtotal, + salepaymentprocessing, + totalinventory_aibyte_transform, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_statistic_hashid +from {{ ref('products_statistic_ab3') }} +-- statistic at products/statistic from {{ ref('products') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/promotion_orders_supplier.sql b/models/generated/airbyte_tables/unibag/promotion_orders_supplier.sql new file mode 100644 index 0000000..fd7f424 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/promotion_orders_supplier.sql @@ -0,0 +1,20 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('promotion_orders_supplier_ab3') }} +select + _airbyte_promotion_orders_hashid, + _id, + {{ adapter.quote('name') }}, + searchstring, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_supplier_hashid +from {{ ref('promotion_orders_supplier_ab3') }} +-- supplier at promotion-orders/supplier from {{ ref('promotion_orders') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/promotions_applyfor.sql b/models/generated/airbyte_tables/unibag/promotions_applyfor.sql new file mode 100644 index 0000000..23beffb --- /dev/null +++ b/models/generated/airbyte_tables/unibag/promotions_applyfor.sql @@ -0,0 +1,21 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('promotions_applyfor_ab3') }} +select + _airbyte_promotions_hashid, + list, + {{ adapter.quote('type') }}, + provinces, + isapplyallorder, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_applyfor_hashid +from {{ ref('promotions_applyfor_ab3') }} +-- applyfor at promotions/applyFor from {{ ref('promotions') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/promotions_conditionforuser.sql b/models/generated/airbyte_tables/unibag/promotions_conditionforuser.sql new file mode 100644 index 0000000..4ac5cb2 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/promotions_conditionforuser.sql @@ -0,0 +1,20 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('promotions_conditionforuser_ab3') }} +select + _airbyte_promotions_hashid, + gender, + applyfor, + segments, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_conditionforuser_hashid +from {{ ref('promotions_conditionforuser_ab3') }} +-- conditionforuser at promotions/conditionForUser from {{ ref('promotions') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/promotions_options.sql b/models/generated/airbyte_tables/unibag/promotions_options.sql new file mode 100644 index 0000000..bcd1667 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/promotions_options.sql @@ -0,0 +1,21 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('promotions_options_ab3') }} +select + _airbyte_promotions_hashid, + bonus, + milestones, + suppliermilestones, + transactionminvalue, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_options_hashid +from {{ ref('promotions_options_ab3') }} +-- options at promotions/options from {{ ref('promotions') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/promotions_options_bonus.sql b/models/generated/airbyte_tables/unibag/promotions_options_bonus.sql new file mode 100644 index 0000000..b94b9a8 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/promotions_options_bonus.sql @@ -0,0 +1,19 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('promotions_options_bonus_ab3') }} +select + _airbyte_options_hashid, + {{ adapter.quote('type') }}, + {{ adapter.quote('value') }}, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_bonus_hashid +from {{ ref('promotions_options_bonus_ab3') }} +-- bonus at promotions/options/bonus from {{ ref('promotions_options') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/promotions_statistic.sql b/models/generated/airbyte_tables/unibag/promotions_statistic.sql new file mode 100644 index 0000000..b017591 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/promotions_statistic.sql @@ -0,0 +1,30 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('promotions_statistic_ab3') }} +select + _airbyte_promotions_hashid, + nmv, + usertotal, + quantitypendingtotal, + quantitysuccesstotal, + quantityrejectedtotal, + commissionpendingtotal, + commissionsuccesstotal, + commissionrejectedtotal, + quantitynotrejectedtotal, + suppliercommissionpending, + suppliercommissionsuccess, + commissionnotrejectedtotal, + suppliercommissionnotrejected, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_statistic_hashid +from {{ ref('promotions_statistic_ab3') }} +-- statistic at promotions/statistic from {{ ref('promotions') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/promotions_suppliercommission.sql b/models/generated/airbyte_tables/unibag/promotions_suppliercommission.sql new file mode 100644 index 0000000..0b558b5 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/promotions_suppliercommission.sql @@ -0,0 +1,19 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('promotions_suppliercommission_ab3') }} +select + _airbyte_promotions_hashid, + {{ adapter.quote('type') }}, + {{ adapter.quote('value') }}, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_suppliercommission_hashid +from {{ ref('promotions_suppliercommission_ab3') }} +-- suppliercommission at promotions/supplierCommission from {{ ref('promotions') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/session_deliveries.sql b/models/generated/airbyte_tables/unibag/session_deliveries.sql new file mode 100644 index 0000000..12eae50 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/session_deliveries.sql @@ -0,0 +1,34 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + unique_key = '_airbyte_ab_id', + schema = "unibag", + tags = [ "top-level" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('session_deliveries_ab3') }} +select + _id, + sessionorder AS session_order_id, + title, + service, + currency, + {{ adapter.quote('customer') }}::json->>'_id' AS customer_id, + {{ adapter.quote('customer') }}::json->>'name' AS customer_name, + {{ adapter.quote('customer') }}::json->>'phone' AS customer_phone, + {{ adapter.quote('delivery') }}::jsonb, + {{ adapter.quote('location') }}::jsonb, + {{ adapter.quote('promotion') }}::json->>'type' AS promotion_type, + {{ adapter.quote('promotion') }}::json->>'isApplied' AS promotion_is_applied, + {{ adapter.quote('promotion') }}::json->>'discount' AS promotion_discount, + {{ adapter.quote('promotion') }}::json->>'minOrderValue' AS promotion_min_order_value, + paymentmethod AS payment_method, + estimatetimedelivery AS estimate_time_delivery, + createdat::timestamp AS created_at, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_session_deliveries_hashid +from {{ ref('session_deliveries_ab3') }} +-- session_deliveries from {{ source('unibag', '_airbyte_raw_session_deliveries') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/session_deliveries_customer.sql b/models/generated/airbyte_tables/unibag/session_deliveries_customer.sql new file mode 100644 index 0000000..1350ce2 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/session_deliveries_customer.sql @@ -0,0 +1,20 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('session_deliveries_customer_ab3') }} +select + _airbyte_session_deliveries_hashid, + _id, + {{ adapter.quote('name') }}, + phone, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_customer_hashid +from {{ ref('session_deliveries_customer_ab3') }} +-- customer at session-deliveries/customer from {{ ref('session_deliveries') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/session_deliveries_delivery.sql b/models/generated/airbyte_tables/unibag/session_deliveries_delivery.sql new file mode 100644 index 0000000..4f5d942 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/session_deliveries_delivery.sql @@ -0,0 +1,33 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('session_deliveries_delivery_ab3') }} +select + _airbyte_session_deliveries_hashid, + _id, + fee, + {{ adapter.quote('desc') }}, + note, + title, + feeship, + currency, + sourceid, + couriername, + servicecode, + servicename, + deliverycode, + maxdeliverydays, + mindeliverydays, + realshippingfee, + estimatetimedelivery, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_delivery_hashid +from {{ ref('session_deliveries_delivery_ab3') }} +-- delivery at session-deliveries/delivery from {{ ref('session_deliveries') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/session_deliveries_delivery_feeship.sql b/models/generated/airbyte_tables/unibag/session_deliveries_delivery_feeship.sql new file mode 100644 index 0000000..402d47f --- /dev/null +++ b/models/generated/airbyte_tables/unibag/session_deliveries_delivery_feeship.sql @@ -0,0 +1,21 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('session_deliveries_delivery_feeship_ab3') }} +select + _airbyte_delivery_hashid, + cod, + total, + shipping, + insurance, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_feeship_hashid +from {{ ref('session_deliveries_delivery_feeship_ab3') }} +-- feeship at session-deliveries/delivery/feeShip from {{ ref('session_deliveries_delivery') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/session_deliveries_location.sql b/models/generated/airbyte_tables/unibag/session_deliveries_location.sql new file mode 100644 index 0000000..a8c73e7 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/session_deliveries_location.sql @@ -0,0 +1,23 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('session_deliveries_location_ab3') }} +select + _airbyte_session_deliveries_hashid, + _id, + ward, + address, + district, + province, + fulladdress, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_location_hashid +from {{ ref('session_deliveries_location_ab3') }} +-- location at session-deliveries/location from {{ ref('session_deliveries') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/session_deliveries_promotion.sql b/models/generated/airbyte_tables/unibag/session_deliveries_promotion.sql new file mode 100644 index 0000000..5a6396d --- /dev/null +++ b/models/generated/airbyte_tables/unibag/session_deliveries_promotion.sql @@ -0,0 +1,21 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('session_deliveries_promotion_ab3') }} +select + _airbyte_session_deliveries_hashid, + {{ adapter.quote('type') }}, + discount, + isapplied, + minordervalue, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_promotion_hashid +from {{ ref('session_deliveries_promotion_ab3') }} +-- promotion at session-deliveries/promotion from {{ ref('session_deliveries') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/session_deliveries_request.sql b/models/generated/airbyte_tables/unibag/session_deliveries_request.sql new file mode 100644 index 0000000..8194a14 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/session_deliveries_request.sql @@ -0,0 +1,27 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('session_deliveries_request_ab3') }} +select + _airbyte_session_deliveries_hashid, + {{ adapter.quote('to') }}, + {{ adapter.quote('from') }}, + items, + checksum, + codamount, + ordercode, + restockat, + ispreorder, + totalamount, + paymentmethod, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_request_hashid +from {{ ref('session_deliveries_request_ab3') }} +-- request at session-deliveries/request from {{ ref('session_deliveries') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/session_deliveries_request_from.sql b/models/generated/airbyte_tables/unibag/session_deliveries_request_from.sql new file mode 100644 index 0000000..24f78a8 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/session_deliveries_request_from.sql @@ -0,0 +1,19 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('session_deliveries_request_from_ab3') }} +select + _airbyte_request_hashid, + userid, + warehouseid, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_from_hashid +from {{ ref('session_deliveries_request_from_ab3') }} +-- from at session-deliveries/request/from from {{ ref('session_deliveries_request') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/session_deliveries_request_to.sql b/models/generated/airbyte_tables/unibag/session_deliveries_request_to.sql new file mode 100644 index 0000000..fe3562a --- /dev/null +++ b/models/generated/airbyte_tables/unibag/session_deliveries_request_to.sql @@ -0,0 +1,20 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('session_deliveries_request_to_ab3') }} +select + _airbyte_request_hashid, + {{ adapter.quote('name') }}, + phone, + {{ adapter.quote('location') }}, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_to_hashid +from {{ ref('session_deliveries_request_to_ab3') }} +-- to at session-deliveries/request/to from {{ ref('session_deliveries_request') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/session_deliveries_request_to_location.sql b/models/generated/airbyte_tables/unibag/session_deliveries_request_to_location.sql new file mode 100644 index 0000000..eadb058 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/session_deliveries_request_to_location.sql @@ -0,0 +1,21 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('session_deliveries_request_to_location_ab3') }} +select + _airbyte_to_hashid, + address, + wardcode, + districtcode, + provincecode, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_location_hashid +from {{ ref('session_deliveries_request_to_location_ab3') }} +-- location at session-deliveries/request/to/location from {{ ref('session_deliveries_request_to') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/social_posts_sharestatistic.sql b/models/generated/airbyte_tables/unibag/social_posts_sharestatistic.sql new file mode 100644 index 0000000..cf54a2f --- /dev/null +++ b/models/generated/airbyte_tables/unibag/social_posts_sharestatistic.sql @@ -0,0 +1,22 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('social_posts_sharestatistic_ab3') }} +select + _airbyte_social_posts_hashid, + totalshare, + totalsharefromsocialpost, + totalsharefromproductdetail, + totaluniquesharefromsocialpost, + totaluniquesharefromproductdetail, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_sharestatistic_hashid +from {{ ref('social_posts_sharestatistic_ab3') }} +-- sharestatistic at social-posts/shareStatistic from {{ ref('social_posts') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/social_posts_statistic.sql b/models/generated/airbyte_tables/unibag/social_posts_statistic.sql new file mode 100644 index 0000000..a62e2ac --- /dev/null +++ b/models/generated/airbyte_tables/unibag/social_posts_statistic.sql @@ -0,0 +1,23 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('social_posts_statistic_ab3') }} +select + _airbyte_social_posts_hashid, + likes, + {{ adapter.quote('views') }}, + {{ adapter.quote('comments') }}, + uniqueviews, + shares_aibyte_transform, + uniqueshares_aibyte_transform, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_statistic_hashid +from {{ ref('social_posts_statistic_ab3') }} +-- statistic at social-posts/statistic from {{ ref('social_posts') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/suppliers_balance.sql b/models/generated/airbyte_tables/unibag/suppliers_balance.sql new file mode 100644 index 0000000..467d892 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/suppliers_balance.sql @@ -0,0 +1,26 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('suppliers_balance_ab3') }} +select + _airbyte_suppliers_hashid, + currentcash, + orderpendingcash, + totalpendingcash, + withdrawrejectcash, + orderreconciledcash, + withdrawpendingcash, + withdrawsuccesscash, + changebalancerequestapproved, + orderwaitingforreconcilecash, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_balance_hashid +from {{ ref('suppliers_balance_ab3') }} +-- balance at suppliers/balance from {{ ref('suppliers') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/suppliers_bank.sql b/models/generated/airbyte_tables/unibag/suppliers_bank.sql new file mode 100644 index 0000000..b23ea8b --- /dev/null +++ b/models/generated/airbyte_tables/unibag/suppliers_bank.sql @@ -0,0 +1,21 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('suppliers_bank_ab3') }} +select + _airbyte_suppliers_hashid, + bank, + branch, + cardnumber, + cardholdername, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_bank_hashid +from {{ ref('suppliers_bank_ab3') }} +-- bank at suppliers/bank from {{ ref('suppliers') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/suppliers_location.sql b/models/generated/airbyte_tables/unibag/suppliers_location.sql new file mode 100644 index 0000000..7580b07 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/suppliers_location.sql @@ -0,0 +1,23 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('suppliers_location_ab3') }} +select + _airbyte_suppliers_hashid, + ward, + address, + district, + {{ adapter.quote('location') }}, + province, + fulladdress, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_location_hashid +from {{ ref('suppliers_location_ab3') }} +-- location at suppliers/location from {{ ref('suppliers') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/suppliers_logo.sql b/models/generated/airbyte_tables/unibag/suppliers_logo.sql new file mode 100644 index 0000000..8bdaf10 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/suppliers_logo.sql @@ -0,0 +1,20 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('suppliers_logo_ab3') }} +select + _airbyte_suppliers_hashid, + _id, + {{ adapter.quote('name') }}, + dimensions, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_logo_hashid +from {{ ref('suppliers_logo_ab3') }} +-- logo at suppliers/logo from {{ ref('suppliers') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/suppliers_logo_dimensions.sql b/models/generated/airbyte_tables/unibag/suppliers_logo_dimensions.sql new file mode 100644 index 0000000..7cf5363 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/suppliers_logo_dimensions.sql @@ -0,0 +1,19 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('suppliers_logo_dimensions_ab3') }} +select + _airbyte_logo_hashid, + md, + sm, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_dimensions_hashid +from {{ ref('suppliers_logo_dimensions_ab3') }} +-- dimensions at suppliers/logo/dimensions from {{ ref('suppliers_logo') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/suppliers_logo_dimensions_md.sql b/models/generated/airbyte_tables/unibag/suppliers_logo_dimensions_md.sql new file mode 100644 index 0000000..940505f --- /dev/null +++ b/models/generated/airbyte_tables/unibag/suppliers_logo_dimensions_md.sql @@ -0,0 +1,20 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('suppliers_logo_dimensions_md_ab3') }} +select + _airbyte_dimensions_hashid, + url, + width, + height, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_md_hashid +from {{ ref('suppliers_logo_dimensions_md_ab3') }} +-- md at suppliers/logo/dimensions/md from {{ ref('suppliers_logo_dimensions') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/suppliers_logo_dimensions_sm.sql b/models/generated/airbyte_tables/unibag/suppliers_logo_dimensions_sm.sql new file mode 100644 index 0000000..b626633 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/suppliers_logo_dimensions_sm.sql @@ -0,0 +1,20 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('suppliers_logo_dimensions_sm_ab3') }} +select + _airbyte_dimensions_hashid, + url, + width, + height, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_sm_hashid +from {{ ref('suppliers_logo_dimensions_sm_ab3') }} +-- sm at suppliers/logo/dimensions/sm from {{ ref('suppliers_logo_dimensions') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/suppliers_reviewstatistic.sql b/models/generated/airbyte_tables/unibag/suppliers_reviewstatistic.sql new file mode 100644 index 0000000..0d98a06 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/suppliers_reviewstatistic.sql @@ -0,0 +1,31 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('suppliers_reviewstatistic_ab3') }} +select + _airbyte_suppliers_hashid, + total, + totalreview, + totalscore1, + totalscore2, + totalscore3, + totalscore4, + totalscore5, + scoreaverage, + totalhasmedia, + totalhascontent, + scoreaverageweektotal, + scoreaverageyeartotal, + scoreaveragemonthtotal, + scoreaveragetwomonthtotal, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_reviewstatistic_hashid +from {{ ref('suppliers_reviewstatistic_ab3') }} +-- reviewstatistic at suppliers/reviewStatistic from {{ ref('suppliers') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/suppliers_statistic.sql b/models/generated/airbyte_tables/unibag/suppliers_statistic.sql new file mode 100644 index 0000000..4ef1e16 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/suppliers_statistic.sql @@ -0,0 +1,29 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('suppliers_statistic_ab3') }} +select + _airbyte_suppliers_hashid, + salestotal, + salespending, + salessuccess, + totalproduct, + salescancelled, + salesweektotal, + salesyeartotal, + totalinventory, + salesmonthtotal, + totalquantitysale, + salestwomonthtotal, + totalhasorderseller, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_statistic_hashid +from {{ ref('suppliers_statistic_ab3') }} +-- statistic at suppliers/statistic from {{ ref('suppliers') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/team_activities_options.sql b/models/generated/airbyte_tables/unibag/team_activities_options.sql new file mode 100644 index 0000000..6b7e7b2 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/team_activities_options.sql @@ -0,0 +1,19 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('team_activities_options_ab3') }} +select + _airbyte_team_activities_hashid, + {{ adapter.quote('name') }}, + {{ adapter.quote('role') }}, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_options_hashid +from {{ ref('team_activities_options_ab3') }} +-- options at team-activities/options from {{ ref('team_activities') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/team_members_statistic.sql b/models/generated/airbyte_tables/unibag/team_members_statistic.sql new file mode 100644 index 0000000..3e1e165 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/team_members_statistic.sql @@ -0,0 +1,37 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('team_members_statistic_ab3') }} +select + _airbyte_team_members_hashid, + sales, + transactiontotal, + transactionpending, + transactionsuccess, + transactionrejected, + cashtransactiontotal, + transactiondelivered, + transactiondelivering, + cashtransactionpending, + cashtransactionsuccess, + cashtransactionrejected, + cashtransactiondelivered, + cashtransactiondelivering, + transactionwaitingapprove, + transactionpaymentprocessing, + cashtransactionwaitingapprove, + thismonthsale_aibyte_transform, + lastmonthsales_aibyte_transform, + thismonthsales_aibyte_transform, + cashtransactionpaymentprocessing, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_statistic_hashid +from {{ ref('team_members_statistic_ab3') }} +-- statistic at team-members/statistic from {{ ref('team_members') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/team_members_statisticmonth.sql b/models/generated/airbyte_tables/unibag/team_members_statisticmonth.sql new file mode 100644 index 0000000..d403794 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/team_members_statisticmonth.sql @@ -0,0 +1,35 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('team_members_statisticmonth_ab3') }} +select + _airbyte_team_members_hashid, + sales, + thismonthsale, + transactiontotal, + transactionpending, + transactionsuccess, + transactionrejected, + cashtransactiontotal, + transactiondelivered, + transactiondelivering, + cashtransactionpending, + cashtransactionsuccess, + cashtransactionrejected, + cashtransactiondelivered, + cashtransactiondelivering, + transactionwaitingapprove, + transactionpaymentprocessing, + cashtransactionwaitingapprove, + cashtransactionpaymentprocessing, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_statisticmonth_hashid +from {{ ref('team_members_statisticmonth_ab3') }} +-- statisticmonth at team-members/statisticMonth from {{ ref('team_members') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/teams_information.sql b/models/generated/airbyte_tables/unibag/teams_information.sql new file mode 100644 index 0000000..4939472 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/teams_information.sql @@ -0,0 +1,18 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('teams_information_ab3') }} +select + _airbyte_teams_hashid, + communicationchannel, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_information_hashid +from {{ ref('teams_information_ab3') }} +-- information at teams/information from {{ ref('teams') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/teams_level.sql b/models/generated/airbyte_tables/unibag/teams_level.sql new file mode 100644 index 0000000..f0f16d4 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/teams_level.sql @@ -0,0 +1,27 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('teams_level_ab3') }} +select + _airbyte_teams_hashid, + {{ adapter.quote('name') }}, + color, + {{ adapter.quote('level') }}, + expiredat, + nextlevel, + bonuspercent, + maximumvipmember, + levelatstartofmonth, + maximumnumbermember, + maximumnumberviceleader, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_level_hashid +from {{ ref('teams_level_ab3') }} +-- level at teams/level from {{ ref('teams') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/teams_logo.sql b/models/generated/airbyte_tables/unibag/teams_logo.sql new file mode 100644 index 0000000..7a8ba6c --- /dev/null +++ b/models/generated/airbyte_tables/unibag/teams_logo.sql @@ -0,0 +1,20 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('teams_logo_ab3') }} +select + _airbyte_teams_hashid, + _id, + {{ adapter.quote('name') }}, + dimensions, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_logo_hashid +from {{ ref('teams_logo_ab3') }} +-- logo at teams/logo from {{ ref('teams') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/teams_logo_dimensions.sql b/models/generated/airbyte_tables/unibag/teams_logo_dimensions.sql new file mode 100644 index 0000000..b9c70f4 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/teams_logo_dimensions.sql @@ -0,0 +1,19 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('teams_logo_dimensions_ab3') }} +select + _airbyte_logo_hashid, + md, + sm, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_dimensions_hashid +from {{ ref('teams_logo_dimensions_ab3') }} +-- dimensions at teams/logo/dimensions from {{ ref('teams_logo') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/teams_logo_dimensions_md.sql b/models/generated/airbyte_tables/unibag/teams_logo_dimensions_md.sql new file mode 100644 index 0000000..68df08b --- /dev/null +++ b/models/generated/airbyte_tables/unibag/teams_logo_dimensions_md.sql @@ -0,0 +1,20 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('teams_logo_dimensions_md_ab3') }} +select + _airbyte_dimensions_hashid, + url, + width, + height, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_md_hashid +from {{ ref('teams_logo_dimensions_md_ab3') }} +-- md at teams/logo/dimensions/md from {{ ref('teams_logo_dimensions') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/teams_logo_dimensions_sm.sql b/models/generated/airbyte_tables/unibag/teams_logo_dimensions_sm.sql new file mode 100644 index 0000000..3601942 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/teams_logo_dimensions_sm.sql @@ -0,0 +1,20 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('teams_logo_dimensions_sm_ab3') }} +select + _airbyte_dimensions_hashid, + url, + width, + height, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_sm_hashid +from {{ ref('teams_logo_dimensions_sm_ab3') }} +-- sm at teams/logo/dimensions/sm from {{ ref('teams_logo_dimensions') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/teams_statistic.sql b/models/generated/airbyte_tables/unibag/teams_statistic.sql new file mode 100644 index 0000000..f81e737 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/teams_statistic.sql @@ -0,0 +1,41 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('teams_statistic_ab3') }} +select + _airbyte_teams_hashid, + sales, + membertotal, + lastmonthsales, + thismonthsales, + transactiontotal, + transactionpending, + transactionsuccess, + transactionrejected, + cashtransactiontotal, + membertotalremaining, + transactiondelivered, + transactiondelivering, + cashtransactionpending, + cashtransactionsuccess, + cashtransactionrejected, + cashtransactiondelivered, + cashtransactiondelivering, + transactionwaitingapprove, + transactionpaymentprocessing, + cashtransactionwaitingapprove, + thismonthsale_aibyte_transform, + vipmembertotal_aibyte_transform, + cashtransactionpaymentprocessing, + memberrequesttotalpending_aibyte_transform, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_statistic_hashid +from {{ ref('teams_statistic_ab3') }} +-- statistic at teams/statistic from {{ ref('teams') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/user_identifications__ation_addressentities.sql b/models/generated/airbyte_tables/unibag/user_identifications__ation_addressentities.sql new file mode 100644 index 0000000..3c29e5a --- /dev/null +++ b/models/generated/airbyte_tables/unibag/user_identifications__ation_addressentities.sql @@ -0,0 +1,21 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('user_identifications__ation_addressentities_ab3') }} +select + _airbyte_detectinformation_hashid, + ward, + street, + district, + province, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_addressentities_hashid +from {{ ref('user_identifications__ation_addressentities_ab3') }} +-- addressentities at user-identifications/detectInformation/addressEntities from {{ ref('user_identifications_detectinformation') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/user_identifications__ontside_dimensions_md.sql b/models/generated/airbyte_tables/unibag/user_identifications__ontside_dimensions_md.sql new file mode 100644 index 0000000..7f9c0f2 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/user_identifications__ontside_dimensions_md.sql @@ -0,0 +1,20 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('user_identifications__ontside_dimensions_md_ab3') }} +select + _airbyte_dimensions_hashid, + url, + width, + height, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_md_hashid +from {{ ref('user_identifications__ontside_dimensions_md_ab3') }} +-- md at user-identifications/frontSide/dimensions/md from {{ ref('user_identifications_frontside_dimensions') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/user_identifications__ontside_dimensions_sm.sql b/models/generated/airbyte_tables/unibag/user_identifications__ontside_dimensions_sm.sql new file mode 100644 index 0000000..ecc4432 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/user_identifications__ontside_dimensions_sm.sql @@ -0,0 +1,20 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('user_identifications__ontside_dimensions_sm_ab3') }} +select + _airbyte_dimensions_hashid, + url, + width, + height, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_sm_hashid +from {{ ref('user_identifications__ontside_dimensions_sm_ab3') }} +-- sm at user-identifications/frontSide/dimensions/sm from {{ ref('user_identifications_frontside_dimensions') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/user_identifications_backside.sql b/models/generated/airbyte_tables/unibag/user_identifications_backside.sql new file mode 100644 index 0000000..5f1b577 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/user_identifications_backside.sql @@ -0,0 +1,20 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('user_identifications_backside_ab3') }} +select + _airbyte_user_identifications_hashid, + _id, + {{ adapter.quote('name') }}, + dimensions, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_backside_hashid +from {{ ref('user_identifications_backside_ab3') }} +-- backside at user-identifications/backSide from {{ ref('user_identifications') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/user_identifications_backside_dimensions.sql b/models/generated/airbyte_tables/unibag/user_identifications_backside_dimensions.sql new file mode 100644 index 0000000..8aa71de --- /dev/null +++ b/models/generated/airbyte_tables/unibag/user_identifications_backside_dimensions.sql @@ -0,0 +1,19 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('user_identifications_backside_dimensions_ab3') }} +select + _airbyte_backside_hashid, + md, + sm, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_dimensions_hashid +from {{ ref('user_identifications_backside_dimensions_ab3') }} +-- dimensions at user-identifications/backSide/dimensions from {{ ref('user_identifications_backside') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/user_identifications_backside_dimensions_md.sql b/models/generated/airbyte_tables/unibag/user_identifications_backside_dimensions_md.sql new file mode 100644 index 0000000..030bb15 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/user_identifications_backside_dimensions_md.sql @@ -0,0 +1,20 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('user_identifications_backside_dimensions_md_ab3') }} +select + _airbyte_dimensions_hashid, + url, + width, + height, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_md_hashid +from {{ ref('user_identifications_backside_dimensions_md_ab3') }} +-- md at user-identifications/backSide/dimensions/md from {{ ref('user_identifications_backside_dimensions') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/user_identifications_backside_dimensions_sm.sql b/models/generated/airbyte_tables/unibag/user_identifications_backside_dimensions_sm.sql new file mode 100644 index 0000000..2b472d6 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/user_identifications_backside_dimensions_sm.sql @@ -0,0 +1,20 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('user_identifications_backside_dimensions_sm_ab3') }} +select + _airbyte_dimensions_hashid, + url, + width, + height, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_sm_hashid +from {{ ref('user_identifications_backside_dimensions_sm_ab3') }} +-- sm at user-identifications/backSide/dimensions/sm from {{ ref('user_identifications_backside_dimensions') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/user_identifications_detectinformation.sql b/models/generated/airbyte_tables/unibag/user_identifications_detectinformation.sql new file mode 100644 index 0000000..0c20753 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/user_identifications_detectinformation.sql @@ -0,0 +1,37 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('user_identifications_detectinformation_ab3') }} +select + _airbyte_user_identifications_hashid, + {{ adapter.quote('id') }}, + dob, + doe, + sex, + home, + {{ adapter.quote('name') }}, + {{ adapter.quote('type') }}, + idprob, + address, + dobprob, + doeprob, + sexprob, + typenew, + homeprob, + nameprob, + addressprob, + nationality, + overallscore, + addressentities, + nationalityprob, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_detectinformation_hashid +from {{ ref('user_identifications_detectinformation_ab3') }} +-- detectinformation at user-identifications/detectInformation from {{ ref('user_identifications') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/user_identifications_frontside.sql b/models/generated/airbyte_tables/unibag/user_identifications_frontside.sql new file mode 100644 index 0000000..0e70008 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/user_identifications_frontside.sql @@ -0,0 +1,20 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('user_identifications_frontside_ab3') }} +select + _airbyte_user_identifications_hashid, + _id, + {{ adapter.quote('name') }}, + dimensions, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_frontside_hashid +from {{ ref('user_identifications_frontside_ab3') }} +-- frontside at user-identifications/frontSide from {{ ref('user_identifications') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/user_identifications_frontside_dimensions.sql b/models/generated/airbyte_tables/unibag/user_identifications_frontside_dimensions.sql new file mode 100644 index 0000000..ba69f85 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/user_identifications_frontside_dimensions.sql @@ -0,0 +1,19 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('user_identifications_frontside_dimensions_ab3') }} +select + _airbyte_frontside_hashid, + md, + sm, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_dimensions_hashid +from {{ ref('user_identifications_frontside_dimensions_ab3') }} +-- dimensions at user-identifications/frontSide/dimensions from {{ ref('user_identifications_frontside') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/users_avatar.sql b/models/generated/airbyte_tables/unibag/users_avatar.sql new file mode 100644 index 0000000..62352d6 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/users_avatar.sql @@ -0,0 +1,20 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('users_avatar_ab3') }} +select + _airbyte_users_hashid, + _id, + {{ adapter.quote('name') }}, + dimensions, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_avatar_hashid +from {{ ref('users_avatar_ab3') }} +-- avatar at users/avatar from {{ ref('users') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/users_avatar_dimensions.sql b/models/generated/airbyte_tables/unibag/users_avatar_dimensions.sql new file mode 100644 index 0000000..3e0f0a1 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/users_avatar_dimensions.sql @@ -0,0 +1,19 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('users_avatar_dimensions_ab3') }} +select + _airbyte_avatar_hashid, + md, + sm, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_dimensions_hashid +from {{ ref('users_avatar_dimensions_ab3') }} +-- dimensions at users/avatar/dimensions from {{ ref('users_avatar') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/users_avatar_dimensions_md.sql b/models/generated/airbyte_tables/unibag/users_avatar_dimensions_md.sql new file mode 100644 index 0000000..da4e77c --- /dev/null +++ b/models/generated/airbyte_tables/unibag/users_avatar_dimensions_md.sql @@ -0,0 +1,20 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('users_avatar_dimensions_md_ab3') }} +select + _airbyte_dimensions_hashid, + url, + width, + height, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_md_hashid +from {{ ref('users_avatar_dimensions_md_ab3') }} +-- md at users/avatar/dimensions/md from {{ ref('users_avatar_dimensions') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/users_avatar_dimensions_sm.sql b/models/generated/airbyte_tables/unibag/users_avatar_dimensions_sm.sql new file mode 100644 index 0000000..73208e4 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/users_avatar_dimensions_sm.sql @@ -0,0 +1,20 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('users_avatar_dimensions_sm_ab3') }} +select + _airbyte_dimensions_hashid, + url, + width, + height, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_sm_hashid +from {{ ref('users_avatar_dimensions_sm_ab3') }} +-- sm at users/avatar/dimensions/sm from {{ ref('users_avatar_dimensions') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/users_email.sql b/models/generated/airbyte_tables/unibag/users_email.sql new file mode 100644 index 0000000..c937297 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/users_email.sql @@ -0,0 +1,20 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('users_email_ab3') }} +select + _airbyte_users_hashid, + email, + verified, + verifiedat, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_email_hashid +from {{ ref('users_email_ab3') }} +-- email at users/email from {{ ref('users') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/users_facebook.sql b/models/generated/airbyte_tables/unibag/users_facebook.sql new file mode 100644 index 0000000..ac84305 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/users_facebook.sql @@ -0,0 +1,23 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('users_facebook_ab3') }} +select + _airbyte_users_hashid, + {{ adapter.quote('id') }}, + {{ adapter.quote('name') }}, + email, + photo, + {{ adapter.quote('token') }}, + gender, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_facebook_hashid +from {{ ref('users_facebook_ab3') }} +-- facebook at users/facebook from {{ ref('users') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/users_identification.sql b/models/generated/airbyte_tables/unibag/users_identification.sql new file mode 100644 index 0000000..e4436bd --- /dev/null +++ b/models/generated/airbyte_tables/unibag/users_identification.sql @@ -0,0 +1,22 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('users_identification_ab3') }} +select + _airbyte_users_hashid, + _id, + note, + status, + timeupdate, + completedat, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_identification_hashid +from {{ ref('users_identification_ab3') }} +-- identification at users/identification from {{ ref('users') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/users_info.sql b/models/generated/airbyte_tables/unibag/users_info.sql new file mode 100644 index 0000000..b79473c --- /dev/null +++ b/models/generated/airbyte_tables/unibag/users_info.sql @@ -0,0 +1,20 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('users_info_ab3') }} +select + _airbyte_users_hashid, + email, + gender, + citycode, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_info_hashid +from {{ ref('users_info_ab3') }} +-- info at users/info from {{ ref('users') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/users_membership.sql b/models/generated/airbyte_tables/unibag/users_membership.sql new file mode 100644 index 0000000..309c1a2 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/users_membership.sql @@ -0,0 +1,22 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('users_membership_ab3') }} +select + _airbyte_users_hashid, + expireat, + nextlevel, + currentlevel, + currenttransactioncount, + currentsales_aibyte_transform, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_membership_hashid +from {{ ref('users_membership_ab3') }} +-- membership at users/membership from {{ ref('users') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/users_phone.sql b/models/generated/airbyte_tables/unibag/users_phone.sql new file mode 100644 index 0000000..196ee16 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/users_phone.sql @@ -0,0 +1,22 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('users_phone_ab3') }} +select + _airbyte_users_hashid, + {{ adapter.quote('full') }}, + {{ adapter.quote('number') }}, + verified, + verifiedat, + countrycode, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_phone_hashid +from {{ ref('users_phone_ab3') }} +-- phone at users/phone from {{ ref('users') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/users_referral.sql b/models/generated/airbyte_tables/unibag/users_referral.sql new file mode 100644 index 0000000..998a9f8 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/users_referral.sql @@ -0,0 +1,21 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('users_referral_ab3') }} +select + _airbyte_users_hashid, + code, + enabled, + enabledat, + sharecontent, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_referral_hashid +from {{ ref('users_referral_ab3') }} +-- referral at users/referral from {{ ref('users') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/users_statistic.sql b/models/generated/airbyte_tables/unibag/users_statistic.sql new file mode 100644 index 0000000..b889530 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/users_statistic.sql @@ -0,0 +1,73 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('users_statistic_ab3') }} +select + _airbyte_users_hashid, + cashtotal, + cashpending, + cashcashback, + cashgivegift, + cashrejected, + taxtotalcash, + totalgiftbox, + totaltickets, + cashcancelled, + cashdelivered, + cashremaining, + customertotal, + totalcartitem, + withdrawtotal, + cashdelivering, + taxcashpending, + withdrawpending, + withdrawsuccess, + revenuelastmonth, + totalsalesuccess, + transactiontotal, + withdrawrejected, + cashwithdrawtotal, + cashwaitingapprove, + transactionpending, + transactionsuccess, + cashwithdrawpending, + cashwithdrawsuccess, + highestmonthlysales, + transactionrejected, + cashwithdrawrejected, + teambonuspendingcash, + teambonussuccesscash, + transactiondelivered, + cashpaymentprocessing, + transactiondelivering, + eventrewardpendingcash, + eventrewardsuccesscash, + transactioncashpending, + voucherbonuspendingcash, + voucherbonussuccesscash, + eventreferralpendingcash, + eventreferralsuccesscash, + promotionbonuspendingcash, + promotionbonussuccesscash, + transactionwaitingapprove, + commissiontransactiontotal, + membershipbonuspendingcash, + membershipbonussuccesscash, + commissiontransactionpending, + transactionpaymentprocessing, + commissiontransactioncashback, + commissiontransactionrejected, + commissiontransactiondelivered, + commissiontransactiondelivering, + revenuethismonth_aibyte_transform, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_statistic_hashid +from {{ ref('users_statistic_ab3') }} +-- statistic at users/statistic from {{ ref('users') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/users_team.sql b/models/generated/airbyte_tables/unibag/users_team.sql new file mode 100644 index 0000000..db8df84 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/users_team.sql @@ -0,0 +1,20 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('users_team_ab3') }} +select + _airbyte_users_hashid, + _id, + {{ adapter.quote('name') }}, + {{ adapter.quote('role') }}, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_team_hashid +from {{ ref('users_team_ab3') }} +-- team at users/team from {{ ref('users') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/users_zalo.sql b/models/generated/airbyte_tables/unibag/users_zalo.sql new file mode 100644 index 0000000..d74e52c --- /dev/null +++ b/models/generated/airbyte_tables/unibag/users_zalo.sql @@ -0,0 +1,21 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('users_zalo_ab3') }} +select + _airbyte_users_hashid, + {{ adapter.quote('id') }}, + {{ adapter.quote('name') }}, + photo, + {{ adapter.quote('token') }}, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_zalo_hashid +from {{ ref('users_zalo_ab3') }} +-- zalo at users/zalo from {{ ref('users') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/vouchers_applyfor.sql b/models/generated/airbyte_tables/unibag/vouchers_applyfor.sql new file mode 100644 index 0000000..a3e2f2f --- /dev/null +++ b/models/generated/airbyte_tables/unibag/vouchers_applyfor.sql @@ -0,0 +1,21 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('vouchers_applyfor_ab3') }} +select + _airbyte_vouchers_hashid, + list, + {{ adapter.quote('type') }}, + provinces, + isapplyallorder, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_applyfor_hashid +from {{ ref('vouchers_applyfor_ab3') }} +-- applyfor at vouchers/applyFor from {{ ref('vouchers') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/vouchers_logo.sql b/models/generated/airbyte_tables/unibag/vouchers_logo.sql new file mode 100644 index 0000000..95c270d --- /dev/null +++ b/models/generated/airbyte_tables/unibag/vouchers_logo.sql @@ -0,0 +1,20 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('vouchers_logo_ab3') }} +select + _airbyte_vouchers_hashid, + _id, + {{ adapter.quote('name') }}, + dimensions, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_logo_hashid +from {{ ref('vouchers_logo_ab3') }} +-- logo at vouchers/logo from {{ ref('vouchers') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/vouchers_logo_dimensions.sql b/models/generated/airbyte_tables/unibag/vouchers_logo_dimensions.sql new file mode 100644 index 0000000..7b38a17 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/vouchers_logo_dimensions.sql @@ -0,0 +1,19 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('vouchers_logo_dimensions_ab3') }} +select + _airbyte_logo_hashid, + md, + sm, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_dimensions_hashid +from {{ ref('vouchers_logo_dimensions_ab3') }} +-- dimensions at vouchers/logo/dimensions from {{ ref('vouchers_logo') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/vouchers_logo_dimensions_md.sql b/models/generated/airbyte_tables/unibag/vouchers_logo_dimensions_md.sql new file mode 100644 index 0000000..8d047da --- /dev/null +++ b/models/generated/airbyte_tables/unibag/vouchers_logo_dimensions_md.sql @@ -0,0 +1,20 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('vouchers_logo_dimensions_md_ab3') }} +select + _airbyte_dimensions_hashid, + url, + width, + height, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_md_hashid +from {{ ref('vouchers_logo_dimensions_md_ab3') }} +-- md at vouchers/logo/dimensions/md from {{ ref('vouchers_logo_dimensions') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/vouchers_logo_dimensions_sm.sql b/models/generated/airbyte_tables/unibag/vouchers_logo_dimensions_sm.sql new file mode 100644 index 0000000..b2609b1 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/vouchers_logo_dimensions_sm.sql @@ -0,0 +1,20 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('vouchers_logo_dimensions_sm_ab3') }} +select + _airbyte_dimensions_hashid, + url, + width, + height, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_sm_hashid +from {{ ref('vouchers_logo_dimensions_sm_ab3') }} +-- sm at vouchers/logo/dimensions/sm from {{ ref('vouchers_logo_dimensions') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/vouchers_options.sql b/models/generated/airbyte_tables/unibag/vouchers_options.sql new file mode 100644 index 0000000..d37a072 --- /dev/null +++ b/models/generated/airbyte_tables/unibag/vouchers_options.sql @@ -0,0 +1,20 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('vouchers_options_ab3') }} +select + _airbyte_vouchers_hashid, + bonus, + milestones, + transactionminvalue, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_options_hashid +from {{ ref('vouchers_options_ab3') }} +-- options at vouchers/options from {{ ref('vouchers') }} +where 1 = 1 + diff --git a/models/generated/airbyte_tables/unibag/vouchers_options_bonus.sql b/models/generated/airbyte_tables/unibag/vouchers_options_bonus.sql new file mode 100644 index 0000000..6cb261c --- /dev/null +++ b/models/generated/airbyte_tables/unibag/vouchers_options_bonus.sql @@ -0,0 +1,19 @@ +{{ config( + indexes = [{'columns':['_airbyte_emitted_at'],'type':'btree'}], + schema = "unibag", + tags = [ "nested" ] +) }} +-- Final base SQL model +-- depends_on: {{ ref('vouchers_options_bonus_ab3') }} +select + _airbyte_options_hashid, + {{ adapter.quote('type') }}, + {{ adapter.quote('value') }}, + _airbyte_ab_id, + _airbyte_emitted_at, + {{ current_timestamp() }} as _airbyte_normalized_at, + _airbyte_bonus_hashid +from {{ ref('vouchers_options_bonus_ab3') }} +-- bonus at vouchers/options/bonus from {{ ref('vouchers_options') }} +where 1 = 1 + diff --git a/models/generated/sources.yml b/models/generated/sources.yml index 8fdcd74..cffd1b7 100644 --- a/models/generated/sources.yml +++ b/models/generated/sources.yml @@ -29,6 +29,7 @@ sources: - name: _airbyte_raw_promotion_orders - name: _airbyte_raw_promotions - name: _airbyte_raw_referrals + - name: _airbyte_raw_session_deliveries - name: _airbyte_raw_social_post_views - name: _airbyte_raw_social_posts - name: _airbyte_raw_suppliers