Commit 405ade9a by wangyulong

1.query特征与query-user交叉特征Redis同步

parent 8eb04015
......@@ -49,7 +49,7 @@ select S.key_word,
from
(
select key_word,product_id
from secoo_search.search_model_action_data_sample
from secoo_search.search_model_action_data_sample_2
group by key_word,product_id
) S
left join secoo_search.search_data_query_original_feature Q
......
--搜索query特征
create external table if not exists secoo_search.search_data_query_original_feature
(
keyword string comment 'query词',
......
......@@ -39,7 +39,7 @@ SELECT
query_search_uv,
concat_ws(',',
(case round(nvl(query_gender,0),0) when 0 then '1,0' when 1 then '0,1' else '1,0' end),
(case round(nvl(query_gender,0),0) when 0 then '1,0,0' when 1 then '0,1,0' when 2 then '0,0,1' else '1,0,0' end),
(case round(nvl(query_contains_other_word,0),0) when 0 then '1,0' when 1 then '0,1' else '1,0' end),
cast(round(nvl(query_word_size,0),4) as string),
cast(round(nvl(query_search_pv,0),4) as string),
......
-- 商品特征表
-- 用户特征表
create external table if not exists secoo_search.search_data_user_feature
(
device_id string comment '设备id',
1YearOrderTicketProductCount string comment '1年下单量',
addCartIn7Days string comment '7天加购量',
1YearCartProductCount string comment '1年加购量',
1YearOrderProductManCount string comment '1年男性订单',
1YearOrderProductManPriceAmt string comment '',
30DaysChannelPvJrzk string comment '今日折扣',
1YearOrderTicketCategoryCount string comment '',
30DaysDetailPv string comment '',
userInterestCategory1_0 string comment '',
userInterestCategory2_0 string comment '',
userInterestCategory1_1 string comment '',
userInterestCategory2_1 string comment '',
userInterestCategory3_0 string comment '',
30DaysSearchCategoryCount string comment '',
1YearOrderPayPriceAmt string comment '',
userInterestCategory1_2 string comment '',
30DaysSearchBrandCount string comment '',
userInterestCategory1_3 string comment '',
userInterestCategory2_2 string comment '',
userInterestCategory3_1 string comment '',
1YearCartCategoryCount string comment '',
userInterestCategory2_3 string comment '',
userInterestCategory1_4 string comment '',
userInterestCategory3_2 string comment '',
userInterestCategory1_5 string comment '',
userInterestCategory3_3 string comment '',
1YearOrderProductOtherCount string comment '',
30DaysDetailPva string comment '',
userInterestCategory2_4 string comment '',
1YearOrderUsePointCount string comment '',
30DaysChannelPvPaiHangBang string comment '',
30daysChannelPvXinPinBang string comment '',
1YearAddFavCategoryCount string comment '',
userInterestCategory3_4 string comment '',
userInterestCategory2_5 string comment '',
activeInWeekends string comment '',
1YearOrderCount string comment '',
30DaysDetailPvb string comment '',
1YearOrderPayProductCount string comment '',
1YearOrderUsePointPriceAmt string comment '',
1YearAddFavProductCount string comment '',
30DaysDetailPvab string comment '',
userInterestCategory3_5 string comment '',
deviceType string comment '',
activeIn7Days string comment '',
gender string comment '',
purchasedBrand100 string comment '',
30DaysChannelPvRenQiBang string comment '',
1YearCartPriceAmt string comment '',
regularCustomer string comment '',
1YearOrderPayBrandCount string comment '',
1YearOrderTicketBrandCount string comment '',
1YearOrderProductOtherPriceAmt string comment '',
1YearOrderProductCountAvg string comment '',
favoriteIn7Days string comment '',
30DaysDetailPvn string comment '',
1YearAddFavPriceAmt string comment '',
1YearOrderProductWomanPriceAmt string comment '',
1YearOrderProductWomanCount string comment '',
30DaysChannelPvXscj string comment '',
1YearOrderTicketPriceAmt string comment '',
userInterestBrand_0 string comment '',
1YearAddFavBrandCount string comment '',
userInterestBrand_1 string comment '',
userInterestBrand_2 string comment '',
1YearOrderPayCount string comment '',
30DaysChannelPvAoLai string comment '',
userInterestBrand_3 string comment '',
30DaysDetailPvs string comment '',
purchasedItems string comment '',
30DaysSearchCount string comment '',
1YearCartBrandCount string comment '',
1YearOrderTicketCount string comment '',
1YearOrderPayCategoryCount string comment ''
device_id string comment '设备id',
1YearOrderTicketProductCount string comment '1年下单量',
addCartIn7Days string comment '7天加购量',
1YearCartProductCount string comment '1年加购量',
1YearOrderProductManCount string comment '1年男性订单',
1YearOrderProductManPriceAmt string comment '',
30DaysChannelPvJrzk string comment '今日折扣',
1YearOrderTicketCategoryCount string comment '',
30DaysDetailPv string comment '',
userInterestCategory1_0 string comment '用户第一个一级品类偏好',
userInterestCategory2_0 string comment '用户第一个二级品类偏好',
userInterestCategory1_1 string comment '用户第二个一级品类偏好',
userInterestCategory2_1 string comment '用户第二个二级品类偏好',
userInterestCategory3_0 string comment '用户第一个三级品类偏好',
30DaysSearchCategoryCount string comment '',
1YearOrderPayPriceAmt string comment '',
userInterestCategory1_2 string comment '用户第三个一级品类偏好',
30DaysSearchBrandCount string comment '',
userInterestCategory1_3 string comment '用户第四个一级品类偏好',
userInterestCategory2_2 string comment '用户第三个二级品类偏好',
userInterestCategory3_1 string comment '用户第二个三级品类偏好',
1YearCartCategoryCount string comment '',
userInterestCategory2_3 string comment '用户第四个二级品类偏好',
userInterestCategory1_4 string comment '用户第五个一级品类偏好',
userInterestCategory3_2 string comment '用户第二个三级品类偏好',
userInterestCategory1_5 string comment '用户第六个一级品类偏好',
userInterestCategory3_3 string comment '用户第四个三级品类偏好',
1YearOrderProductOtherCount string comment '',
30DaysDetailPva string comment '',
userInterestCategory2_4 string comment '用户第五个二级品类偏好',
1YearOrderUsePointCount string comment '',
30DaysChannelPvPaiHangBang string comment '',
30daysChannelPvXinPinBang string comment '',
1YearAddFavCategoryCount string comment '',
userInterestCategory3_4 string comment '用户第五个三级品类偏好',
userInterestCategory2_5 string comment '用户第六个二级品类偏好',
activeInWeekends string comment '',
1YearOrderCount string comment '',
30DaysDetailPvb string comment '',
1YearOrderPayProductCount string comment '',
1YearOrderUsePointPriceAmt string comment '',
1YearAddFavProductCount string comment '',
30DaysDetailPvab string comment '',
userInterestCategory3_5 string comment '用户第六个三级品类偏好',
deviceType string comment '',
activeIn7Days string comment '',
gender string comment '',
purchasedBrand100 string comment '',
30DaysChannelPvRenQiBang string comment '',
1YearCartPriceAmt string comment '',
regularCustomer string comment '',
1YearOrderPayBrandCount string comment '',
1YearOrderTicketBrandCount string comment '',
1YearOrderProductOtherPriceAmt string comment '',
1YearOrderProductCountAvg string comment '',
favoriteIn7Days string comment '',
30DaysDetailPvn string comment '',
1YearAddFavPriceAmt string comment '',
1YearOrderProductWomanPriceAmt string comment '',
1YearOrderProductWomanCount string comment '',
30DaysChannelPvXscj string comment '',
1YearOrderTicketPriceAmt string comment '',
userInterestBrand_0 string comment '用户第一个品牌偏好',
1YearAddFavBrandCount string comment '',
userInterestBrand_1 string comment '用户第二个品牌偏好',
userInterestBrand_2 string comment '用户第三个品牌偏好',
1YearOrderPayCount string comment '',
30DaysChannelPvAoLai string comment '',
userInterestBrand_3 string comment '用户第四个品牌偏好',
30DaysDetailPvs string comment '',
purchasedItems string comment '',
30DaysSearchCount string comment '',
1YearCartBrandCount string comment '',
1YearOrderTicketCount string comment '',
1YearOrderPayCategoryCount string comment ''
) comment '用户特征'
partitioned by (
p_day date comment '分区日期'
......
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