Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
search-model-data
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
田川
search-model-data
Commits
405ade9a
Commit
405ade9a
authored
Jul 22, 2021
by
wangyulong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.query特征与query-user交叉特征Redis同步
parent
8eb04015
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
79 additions
and
78 deletions
+79
-78
insert_cross_feature_query_product.sql
src/main/scripts/cross_feature/query_product/insert_cross_feature_query_product.sql
+1
-1
create_query_feature_table.sql
src/main/scripts/query_feature/create_query_feature_table.sql
+1
-0
insert_query_feature_ext_table.sql
src/main/scripts/query_feature/insert_query_feature_ext_table.sql
+1
-1
create_search_user_feature_table.sql
src/main/scripts/user_feature/create_search_user_feature_table.sql
+76
-76
No files found.
src/main/scripts/cross_feature/query_product/insert_cross_feature_query_product.sql
View file @
405ade9a
...
@@ -49,7 +49,7 @@ select S.key_word,
...
@@ -49,7 +49,7 @@ select S.key_word,
from
from
(
(
select
key_word
,
product_id
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
group
by
key_word
,
product_id
)
S
)
S
left
join
secoo_search
.
search_data_query_original_feature
Q
left
join
secoo_search
.
search_data_query_original_feature
Q
...
...
src/main/scripts/query_feature/create_query_feature_table.sql
View file @
405ade9a
--搜索query特征
create
external
table
if
not
exists
secoo_search
.
search_data_query_original_feature
create
external
table
if
not
exists
secoo_search
.
search_data_query_original_feature
(
(
keyword
string
comment
'query词'
,
keyword
string
comment
'query词'
,
...
...
src/main/scripts/query_feature/insert_query_feature_ext_table.sql
View file @
405ade9a
...
@@ -39,7 +39,7 @@ SELECT
...
@@ -39,7 +39,7 @@ SELECT
query_search_uv
,
query_search_uv
,
concat_ws
(
','
,
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
),
(
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_word_size
,
0
),
4
)
as
string
),
cast
(
round
(
nvl
(
query_search_pv
,
0
),
4
)
as
string
),
cast
(
round
(
nvl
(
query_search_pv
,
0
),
4
)
as
string
),
...
...
src/main/scripts/user_feature/create_search_user_feature_table.sql
View file @
405ade9a
--
商品
特征表
--
用户
特征表
create
external
table
if
not
exists
secoo_search
.
search_data_user_feature
create
external
table
if
not
exists
secoo_search
.
search_data_user_feature
(
(
device_id
string
comment
'设备id'
,
device_id
string
comment
'设备id'
,
1
YearOrderTicketProductCount
string
comment
'1年下单量'
,
1
YearOrderTicketProductCount
string
comment
'1年下单量'
,
addCartIn7Days
string
comment
'7天加购量'
,
addCartIn7Days
string
comment
'7天加购量'
,
1
YearCartProductCount
string
comment
'1年加购量'
,
1
YearCartProductCount
string
comment
'1年加购量'
,
1
YearOrderProductManCount
string
comment
'1年男性订单'
,
1
YearOrderProductManCount
string
comment
'1年男性订单'
,
1
YearOrderProductManPriceAmt
string
comment
''
,
1
YearOrderProductManPriceAmt
string
comment
''
,
30
DaysChannelPvJrzk
string
comment
'今日折扣'
,
30
DaysChannelPvJrzk
string
comment
'今日折扣'
,
1
YearOrderTicketCategoryCount
string
comment
''
,
1
YearOrderTicketCategoryCount
string
comment
''
,
30
DaysDetailPv
string
comment
''
,
30
DaysDetailPv
string
comment
''
,
userInterestCategory1_0
string
comment
'
'
,
userInterestCategory1_0
string
comment
'用户第一个一级品类偏好
'
,
userInterestCategory2_0
string
comment
'
'
,
userInterestCategory2_0
string
comment
'用户第一个二级品类偏好
'
,
userInterestCategory1_1
string
comment
'
'
,
userInterestCategory1_1
string
comment
'用户第二个一级品类偏好
'
,
userInterestCategory2_1
string
comment
'
'
,
userInterestCategory2_1
string
comment
'用户第二个二级品类偏好
'
,
userInterestCategory3_0
string
comment
'
'
,
userInterestCategory3_0
string
comment
'用户第一个三级品类偏好
'
,
30
DaysSearchCategoryCount
string
comment
''
,
30
DaysSearchCategoryCount
string
comment
''
,
1
YearOrderPayPriceAmt
string
comment
''
,
1
YearOrderPayPriceAmt
string
comment
''
,
userInterestCategory1_2
string
comment
'
'
,
userInterestCategory1_2
string
comment
'用户第三个一级品类偏好
'
,
30
DaysSearchBrandCount
string
comment
''
,
30
DaysSearchBrandCount
string
comment
''
,
userInterestCategory1_3
string
comment
'
'
,
userInterestCategory1_3
string
comment
'用户第四个一级品类偏好
'
,
userInterestCategory2_2
string
comment
'
'
,
userInterestCategory2_2
string
comment
'用户第三个二级品类偏好
'
,
userInterestCategory3_1
string
comment
'
'
,
userInterestCategory3_1
string
comment
'用户第二个三级品类偏好
'
,
1
YearCartCategoryCount
string
comment
''
,
1
YearCartCategoryCount
string
comment
''
,
userInterestCategory2_3
string
comment
'
'
,
userInterestCategory2_3
string
comment
'用户第四个二级品类偏好
'
,
userInterestCategory1_4
string
comment
'
'
,
userInterestCategory1_4
string
comment
'用户第五个一级品类偏好
'
,
userInterestCategory3_2
string
comment
'
'
,
userInterestCategory3_2
string
comment
'用户第二个三级品类偏好
'
,
userInterestCategory1_5
string
comment
'
'
,
userInterestCategory1_5
string
comment
'用户第六个一级品类偏好
'
,
userInterestCategory3_3
string
comment
'
'
,
userInterestCategory3_3
string
comment
'用户第四个三级品类偏好
'
,
1
YearOrderProductOtherCount
string
comment
''
,
1
YearOrderProductOtherCount
string
comment
''
,
30
DaysDetailPva
string
comment
''
,
30
DaysDetailPva
string
comment
''
,
userInterestCategory2_4
string
comment
'
'
,
userInterestCategory2_4
string
comment
'用户第五个二级品类偏好
'
,
1
YearOrderUsePointCount
string
comment
''
,
1
YearOrderUsePointCount
string
comment
''
,
30
DaysChannelPvPaiHangBang
string
comment
''
,
30
DaysChannelPvPaiHangBang
string
comment
''
,
30
daysChannelPvXinPinBang
string
comment
''
,
30
daysChannelPvXinPinBang
string
comment
''
,
1
YearAddFavCategoryCount
string
comment
''
,
1
YearAddFavCategoryCount
string
comment
''
,
userInterestCategory3_4
string
comment
'
'
,
userInterestCategory3_4
string
comment
'用户第五个三级品类偏好
'
,
userInterestCategory2_5
string
comment
'
'
,
userInterestCategory2_5
string
comment
'用户第六个二级品类偏好
'
,
activeInWeekends
string
comment
''
,
activeInWeekends
string
comment
''
,
1
YearOrderCount
string
comment
''
,
1
YearOrderCount
string
comment
''
,
30
DaysDetailPvb
string
comment
''
,
30
DaysDetailPvb
string
comment
''
,
1
YearOrderPayProductCount
string
comment
''
,
1
YearOrderPayProductCount
string
comment
''
,
1
YearOrderUsePointPriceAmt
string
comment
''
,
1
YearOrderUsePointPriceAmt
string
comment
''
,
1
YearAddFavProductCount
string
comment
''
,
1
YearAddFavProductCount
string
comment
''
,
30
DaysDetailPvab
string
comment
''
,
30
DaysDetailPvab
string
comment
''
,
userInterestCategory3_5
string
comment
'
'
,
userInterestCategory3_5
string
comment
'用户第六个三级品类偏好
'
,
deviceType
string
comment
''
,
deviceType
string
comment
''
,
activeIn7Days
string
comment
''
,
activeIn7Days
string
comment
''
,
gender
string
comment
''
,
gender
string
comment
''
,
purchasedBrand100
string
comment
''
,
purchasedBrand100
string
comment
''
,
30
DaysChannelPvRenQiBang
string
comment
''
,
30
DaysChannelPvRenQiBang
string
comment
''
,
1
YearCartPriceAmt
string
comment
''
,
1
YearCartPriceAmt
string
comment
''
,
regularCustomer
string
comment
''
,
regularCustomer
string
comment
''
,
1
YearOrderPayBrandCount
string
comment
''
,
1
YearOrderPayBrandCount
string
comment
''
,
1
YearOrderTicketBrandCount
string
comment
''
,
1
YearOrderTicketBrandCount
string
comment
''
,
1
YearOrderProductOtherPriceAmt
string
comment
''
,
1
YearOrderProductOtherPriceAmt
string
comment
''
,
1
YearOrderProductCountAvg
string
comment
''
,
1
YearOrderProductCountAvg
string
comment
''
,
favoriteIn7Days
string
comment
''
,
favoriteIn7Days
string
comment
''
,
30
DaysDetailPvn
string
comment
''
,
30
DaysDetailPvn
string
comment
''
,
1
YearAddFavPriceAmt
string
comment
''
,
1
YearAddFavPriceAmt
string
comment
''
,
1
YearOrderProductWomanPriceAmt
string
comment
''
,
1
YearOrderProductWomanPriceAmt
string
comment
''
,
1
YearOrderProductWomanCount
string
comment
''
,
1
YearOrderProductWomanCount
string
comment
''
,
30
DaysChannelPvXscj
string
comment
''
,
30
DaysChannelPvXscj
string
comment
''
,
1
YearOrderTicketPriceAmt
string
comment
''
,
1
YearOrderTicketPriceAmt
string
comment
''
,
userInterestBrand_0
string
comment
'
'
,
userInterestBrand_0
string
comment
'用户第一个品牌偏好
'
,
1
YearAddFavBrandCount
string
comment
''
,
1
YearAddFavBrandCount
string
comment
''
,
userInterestBrand_1
string
comment
'
'
,
userInterestBrand_1
string
comment
'用户第二个品牌偏好
'
,
userInterestBrand_2
string
comment
'
'
,
userInterestBrand_2
string
comment
'用户第三个品牌偏好
'
,
1
YearOrderPayCount
string
comment
''
,
1
YearOrderPayCount
string
comment
''
,
30
DaysChannelPvAoLai
string
comment
''
,
30
DaysChannelPvAoLai
string
comment
''
,
userInterestBrand_3
string
comment
'
'
,
userInterestBrand_3
string
comment
'用户第四个品牌偏好
'
,
30
DaysDetailPvs
string
comment
''
,
30
DaysDetailPvs
string
comment
''
,
purchasedItems
string
comment
''
,
purchasedItems
string
comment
''
,
30
DaysSearchCount
string
comment
''
,
30
DaysSearchCount
string
comment
''
,
1
YearCartBrandCount
string
comment
''
,
1
YearCartBrandCount
string
comment
''
,
1
YearOrderTicketCount
string
comment
''
,
1
YearOrderTicketCount
string
comment
''
,
1
YearOrderPayCategoryCount
string
comment
''
1
YearOrderPayCategoryCount
string
comment
''
)
comment
'用户特征'
)
comment
'用户特征'
partitioned
by
(
partitioned
by
(
p_day
date
comment
'分区日期'
p_day
date
comment
'分区日期'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment