Commit e4deea7a by xupeng

修正 user_product_buy_is_match 、user_product_buy_price_level

parent 1e59ad1e
......@@ -42,10 +42,21 @@ select
T1.prodanduserpurchbig100,
T1.prodpriceinuserbrowsing,
T1.prodpriceinuserpurch,
T2.user_product_buy_is_match,
T2.user_product_buy_price_level
case when T4.buy_sku_cat2_price_level = T3.cate_2_price_level then 1 else 0 end as user_product_buy_is_match,
T4.buy_sku_cat2_price_level as user_product_buy_price_level
from ${table_name} T1
left join secoo_search.search_data_cross_feature_user_product_buy T2 on T2.p_day = '${yesterday}' and T1.device_id = T2.device_id and T1.product_id = T2.product_id
left join secoo_fact.fact_search_product_wide_p_day T2 on T2.p_day = '${today_param}' and T1.product_id = T2.product_id
left join secoo_fact.fact_search_product_55_30d_click_product_p_day T3 on T3.p_day = ${yesterday} and T2.main_id = T3.product_main_id
left join (
select
uuid,
category_id_2,
max(buy_sku_cat2_price_level) as buy_sku_cat2_price_level
from secoo_app.app_search_uuid_sku_price_level
where p_day = ${yesterday}
group by uuid, category_id_2
) T4 on T1.device_id = T4.uuid
;"
hive -e "SELECT
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment