Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
ffm-baseline
Project
Project
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ML
ffm-baseline
Commits
ed51236d
Commit
ed51236d
authored
Nov 21, 2018
by
王志伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改统计参数
parent
0a94f32e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
30 deletions
+34
-30
app_list.scala
eda/feededa/src/main/scala/com/gmei/app_list.scala
+34
-30
No files found.
eda/feededa/src/main/scala/com/gmei/app_list.scala
View file @
ed51236d
...
...
@@ -325,13 +325,13 @@ object coincidence_xinyang {
//1.重合用户的美购数
val
meigou_coincidence_num
=
sc
.
sql
(
s
"""
|select count(service_id) as meigou_coincidence_num
|select count(
ov.
service_id) as meigou_coincidence_num
|from online.ml_meigou_order_detail ov left join coincidence_id
|on ov.device_id = coincidence_id.device_id
|where partition_date = '20181120'
|and coincidence_id.device_id is not null
|and pay_time is not null
|and pay_time >= '2017-11-18'
|and
ov.
pay_time is not null
|and
ov.
pay_time >= '2017-11-18'
"""
.
stripMargin
)
meigou_coincidence_num
.
show
()
...
...
@@ -340,26 +340,26 @@ object coincidence_xinyang {
//2.重合用户进行美购的用户数
val
meigou_pay_device
=
sc
.
sql
(
s
"""
|select count(distinct(service_id)) as meigou_coincidence_num
|select count(distinct(
ov.
service_id)) as meigou_coincidence_num
|from online.ml_meigou_order_detail ov left join coincidence_id
|on ov.device_id = coincidence_id.device_id
|where partition_date = '20181120'
|and coincidence_id.device_id is not null
|and pay_time is not null
|and pay_time >= '2017-11-18'
|and
ov.
pay_time is not null
|and
ov.
pay_time >= '2017-11-18'
"""
.
stripMargin
)
meigou_pay_device
.
show
()
//3.所有获得应用列表的用户的美购数
val
meigou_pay_all
=
sc
.
sql
(
s
"""
|select count(device_id) as meigou_pay_device
|select count(
od.
device_id) as meigou_pay_device
|from online.ml_meigou_order_detail od inner join all_id
|on od.device_id = all_id.device_id
|where partition_date = '20181120'
|and all_id.device_id is not null
|and pay_time is not null
|and pay_time >= '2017-11-18'
|and
od.
pay_time is not null
|and
od.
pay_time >= '2017-11-18'
"""
.
stripMargin
)
meigou_pay_all
.
show
()
...
...
@@ -367,62 +367,66 @@ object coincidence_xinyang {
//4.所有获得应用列表用户进行美购的用户数
val
meigou_pay_device_all
=
sc
.
sql
(
s
"""
|select count(distinct(device_id)) as meigou_pay_device
|select count(distinct(
od.
device_id)) as meigou_pay_device
|from online.ml_meigou_order_detail od inner join all_id
|on od.device_id = all_id.device_id
|where partition_date = '20181120'
|and all_id.device_id is not null
|and pay_time is not null
|and pay_time >= '2017-11-18'
|and
od.
pay_time is not null
|and
od.
pay_time >= '2017-11-18'
"""
.
stripMargin
)
meigou_pay_device_all
.
show
()
/*
//截止目前获得的与新氧重合的用户数咨询统计
//截止目前获得的与新氧重合的用户数咨询统计
val
zixun_num_all
=
sc
.
sql
(
s
"""
|select count(cl_id) as zixun_num_all
|from online.tl_hdfs_maidian_view ov
inner join all_devi
ce_id
|on ov.cl_id =
all_devi
ce_id.device_id
|select count(
ov.
cl_id) as zixun_num_all
|from online.tl_hdfs_maidian_view ov
left join coinciden
ce_id
|on ov.cl_id =
coinciden
ce_id.device_id
|where partition_date >= '20180501'
|and coincidence_id.device_id is not null
|and action = 'welfare_detail_click_message'
"""
.
stripMargin
)
.repartition(100)
)
zixun_num_all
.
show
()
val
zixun_device_all
=
sc
.
sql
(
s
"""
|select count(distinct(cl_id)) as zixun_num_all
|from online.tl_hdfs_maidian_view ov
inner join all_devi
ce_id
|on ov.cl_id =
all_devi
ce_id.device_id
|select count(distinct(
ov.
cl_id)) as zixun_num_all
|from online.tl_hdfs_maidian_view ov
left join coinciden
ce_id
|on ov.cl_id =
coinciden
ce_id.device_id
|where partition_date >= '20180501'
|and coincidence_id.device_id is not null
|and action = 'welfare_detail_click_message'
"""
.
stripMargin
)
.repartition(100)
)
zixun_device_all
.
show
()
val
zixun_num_co
=
sc
.
sql
(
s
"""
|select count(cl_id) as zixun_num_co
|from online.tl_hdfs_maidian_view
|select count(distinct(ov.cl_id)) as zixun_num_all
|from online.tl_hdfs_maidian_view ov left join all_id
|on ov.cl_id = coincidence_id.device_id
|where partition_date >= '20180501'
|and coincidence_id.device_id is not null
|and action = 'welfare_detail_click_message'
|and cl_id in (select distinct(device_id) from device_id_coincidence)
"""
.
stripMargin
)
.repartition(100)
)
zixun_num_co
.
show
()
val
zixun_num_co_dis
=
sc
.
sql
(
s
"""
|select count(distinct(cl_id)) as zixun_num_co_dis
|from online.tl_hdfs_maidian_view
|select count(distinct(ov.cl_id)) as zixun_num_all
|from online.tl_hdfs_maidian_view ov left join all_id
|on ov.cl_id = coincidence_id.device_id
|where partition_date >= '20180501'
|and coincidence_id.device_id is not null
|and action = 'welfare_detail_click_message'
|and cl_id in (select distinct(device_id) from device_id_coincidence)
"""
.
stripMargin
)
.repartition(100)
)
zixun_num_co_dis
.
show
()
*/
...
...
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