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
08d2848d
Commit
08d2848d
authored
Feb 23, 2019
by
王志伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
统计新指标,device_clk_imp_reason
parent
27a2fc41
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
temp_count.scala
eda/feededa/src/main/scala/com/gmei/temp_count.scala
+6
-8
No files found.
eda/feededa/src/main/scala/com/gmei/temp_count.scala
View file @
08d2848d
...
@@ -773,17 +773,15 @@ object find_reason {
...
@@ -773,17 +773,15 @@ object find_reason {
//1.当天老用户中的点击用户数
//1.当天老用户中的点击用户数
val
old_clk_count
=
sc
.
sql
(
val
old_clk_count
=
sc
.
sql
(
s
"""
s
"""
|select stat_date,count(oc.device_id) as old_clk_count
|select
'${stat_date}' as
stat_date,count(oc.device_id) as old_clk_count
|from all_clk_diary_card oc
left
join device_id_old
|from all_clk_diary_card oc
innner
join device_id_old
|on oc.device_id = device_id_old.device_id
|on oc.device_id = device_id_old.device_id
|where device_id_old.device_id is not null
|group by stat_date
"""
.
stripMargin
"""
.
stripMargin
)
)
//1.1有点击的老用户
//1.1有点击的老用户
val
old_clk_device
=
sc
.
sql
(
val
old_clk_device
=
sc
.
sql
(
s
"""
s
"""
|select
oc.device_id
as device_id
|select
distinct(oc.device_id)
as device_id
|from all_clk_diary_card oc left join device_id_old
|from all_clk_diary_card oc left join device_id_old
|on oc.device_id = device_id_old.device_id
|on oc.device_id = device_id_old.device_id
|where device_id_old.device_id is not null
|where device_id_old.device_id is not null
...
@@ -806,7 +804,7 @@ object find_reason {
...
@@ -806,7 +804,7 @@ object find_reason {
//2.1 有点击的新用户
//2.1 有点击的新用户
val
new_clk_device
=
sc
.
sql
(
val
new_clk_device
=
sc
.
sql
(
s
"""
s
"""
|select
oc.device_id
as device_id
|select
distinct(oc.device_id)
as device_id
|from all_clk_diary_card oc left join device_id_new
|from all_clk_diary_card oc left join device_id_new
|on oc.device_id = device_id_new.device_id
|on oc.device_id = device_id_new.device_id
|where device_id_old.device_id is not null
|where device_id_old.device_id is not null
...
@@ -819,7 +817,7 @@ object find_reason {
...
@@ -819,7 +817,7 @@ object find_reason {
val
old_count
=
sc
.
sql
(
val
old_count
=
sc
.
sql
(
s
"""
s
"""
|select '${stat_date}' as stat_date,count(di
o.device_id
) as old_count
|select '${stat_date}' as stat_date,count(di
stinct(dio.device_id)
) as old_count
|from device_id_old dio left join agency_id
|from device_id_old dio left join agency_id
|on dio.device_id = agency_id.device_id
|on dio.device_id = agency_id.device_id
|where agency_id.device_id is null
|where agency_id.device_id is null
...
@@ -829,7 +827,7 @@ object find_reason {
...
@@ -829,7 +827,7 @@ object find_reason {
//4.当天新用户数
//4.当天新用户数
val
new_count
=
sc
.
sql
(
val
new_count
=
sc
.
sql
(
s
"""
s
"""
|select '${stat_date}' as stat_date,count(di
n.device_id
) as new_count
|select '${stat_date}' as stat_date,count(di
stinct(din.device_id)
) as new_count
|from device_id_new din left join agency_id
|from device_id_new din left join agency_id
|on din.device_id = agency_id.device_id
|on din.device_id = agency_id.device_id
|where agency_id.device_id is null
|where agency_id.device_id is null
...
...
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