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
780b0206
Commit
780b0206
authored
Jun 11, 2021
by
lishihang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
'ADD:feature'
parent
bdf04c7b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
insert_cross_feature_query_user.sql
src/main/scripts/cross_feature/query_user/insert_cross_feature_query_user.sql
+6
-6
insert_query_brand_category_table.sql
src/main/scripts/query_feature/insert_query_brand_category_table.sql
+1
-1
No files found.
src/main/scripts/cross_feature/query_user/insert_cross_feature_query_user.sql
View file @
780b0206
...
...
@@ -84,7 +84,7 @@ drop table tmp.tmp_query_category_base_cross_lsh;
create
table
if
not
exists
tmp
.
tmp_query_category_base_cross_lsh
as
select
key_word
,
search_device_id
,
split
(
search_categorys
,
','
)[
0
]
search_categorys
from
secoo_fact_hour
.
fact_search_detail_union_p_hour_inrc
where
search_device_id
is
not
null
and
p_day
>=
date_sub
(
current_date
(),
15
)
and
p_day
<=
date_sub
(
current_date
(),
1
)
where
search_device_id
is
not
null
and
p_day
>=
date_sub
(
current_date
(),
60
)
and
p_day
<=
date_sub
(
current_date
(),
1
)
group
by
key_word
,
search_device_id
,
split
(
search_categorys
,
','
)[
0
];
--搜索识别品牌交叉特征基础表
...
...
@@ -92,7 +92,7 @@ drop table tmp.tmp_query_brand_base_cross_lsh;
create
table
if
not
exists
tmp
.
tmp_query_brand_base_cross_lsh
as
select
key_word
,
search_device_id
,
split
(
search_brands
,
','
)[
0
]
search_brands
from
secoo_fact_hour
.
fact_search_detail_union_p_hour_inrc
where
search_device_id
is
not
null
and
p_day
>=
date_sub
(
current_date
(),
15
)
and
p_day
<=
date_sub
(
current_date
(),
1
)
where
search_device_id
is
not
null
and
p_day
>=
date_sub
(
current_date
(),
60
)
and
p_day
<=
date_sub
(
current_date
(),
1
)
group
by
key_word
,
search_device_id
,
split
(
search_brands
,
','
)[
0
];
...
...
@@ -138,7 +138,7 @@ drop table tmp.tmp_query_category_cart_base_cross_lsh;
create
table
if
not
exists
tmp
.
tmp_query_category_cart_base_cross_lsh
as
select
key_word
,
add_cart_device_id
,
product_category_id
from
secoo_fact_hour
.
fact_search_detail_union_p_hour_inrc
where
add_cart_device_id
is
not
null
and
p_day
>=
date_sub
(
current_date
(),
15
)
and
p_day
<=
date_sub
(
current_date
(),
1
)
where
add_cart_device_id
is
not
null
and
p_day
>=
date_sub
(
current_date
(),
60
)
and
p_day
<=
date_sub
(
current_date
(),
1
)
group
by
key_word
,
add_cart_device_id
,
product_category_id
;
...
...
@@ -147,7 +147,7 @@ drop table tmp.tmp_query_brand_cart_base_cross_lsh;
create
table
if
not
exists
tmp
.
tmp_query_brand_cart_base_cross_lsh
as
select
key_word
,
add_cart_device_id
,
product_brand_id
from
secoo_fact_hour
.
fact_search_detail_union_p_hour_inrc
where
add_cart_device_id
is
not
null
and
p_day
>=
date_sub
(
current_date
(),
15
)
and
p_day
<=
date_sub
(
current_date
(),
1
)
where
add_cart_device_id
is
not
null
and
p_day
>=
date_sub
(
current_date
(),
60
)
and
p_day
<=
date_sub
(
current_date
(),
1
)
group
by
key_word
,
add_cart_device_id
,
product_brand_id
;
...
...
@@ -193,7 +193,7 @@ drop table tmp.tmp_query_category_pay_base_cross_lsh;
create
table
if
not
exists
tmp
.
tmp_query_category_pay_base_cross_lsh
as
select
key_word
,
pay_device_id
,
product_category_id
from
secoo_fact_hour
.
fact_search_detail_union_p_hour_inrc
where
pay_device_id
is
not
null
and
p_day
>=
date_sub
(
current_date
(),
15
)
and
p_day
<=
date_sub
(
current_date
(),
1
)
where
pay_device_id
is
not
null
and
p_day
>=
date_sub
(
current_date
(),
60
)
and
p_day
<=
date_sub
(
current_date
(),
1
)
group
by
key_word
,
pay_device_id
,
product_category_id
;
--搜索购买品牌交叉特征基础表
...
...
@@ -201,7 +201,7 @@ drop table tmp.tmp_query_brand_pay_base_cross_lsh;
create
table
if
not
exists
tmp
.
tmp_query_brand_pay_base_cross_lsh
as
select
key_word
,
pay_device_id
,
product_brand_id
from
secoo_fact_hour
.
fact_search_detail_union_p_hour_inrc
where
pay_device_id
is
not
null
and
p_day
>=
date_sub
(
current_date
(),
15
)
and
p_day
<=
date_sub
(
current_date
(),
1
)
where
pay_device_id
is
not
null
and
p_day
>=
date_sub
(
current_date
(),
60
)
and
p_day
<=
date_sub
(
current_date
(),
1
)
group
by
key_word
,
pay_device_id
,
product_brand_id
;
...
...
src/main/scripts/query_feature/insert_query_brand_category_table.sql
View file @
780b0206
...
...
@@ -3,7 +3,7 @@ drop table tmp.tmp_query_base_lsh;
create
table
if
not
exists
tmp
.
tmp_query_base_lsh
as
select
key_word
,
product_brand_id
,
product_category_id
,
is_action_add_cart
,
is_pay_success
from
secoo_fact_hour
.
fact_search_detail_union_p_hour_inrc
where
p_day
>=
date_sub
(
current_date
(),
15
)
and
p_day
<=
date_sub
(
current_date
(),
1
);
where
p_day
>=
date_sub
(
current_date
(),
60
)
and
p_day
<=
date_sub
(
current_date
(),
1
);
--query最近加购的品牌 Top5
...
...
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