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
77bb02d4
Commit
77bb02d4
authored
Feb 25, 2019
by
王志伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改device_clk_imp_reason
parent
15fe67a5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
temp_count.scala
eda/feededa/src/main/scala/com/gmei/temp_count.scala
+7
-7
No files found.
eda/feededa/src/main/scala/com/gmei/temp_count.scala
View file @
77bb02d4
...
...
@@ -756,7 +756,7 @@ object find_reason {
val
all_clk
=
sc
.
sql
(
s
"""
|select
'${stat_date}' as stat_date,
ov.cl_id as device_id
|select ov.cl_id as device_id
|from online.tl_hdfs_maidian_view ov left join agency_id
|on ov.cl_id = agency_id.device_id
|where ov.action = 'on_click_diary_card'
...
...
@@ -771,10 +771,9 @@ object find_reason {
//1.当天老用户中的点击用户数
val
old_clk_count
=
sc
.
sql
(
s
"""
|select '${stat_date}' as stat_date,count(
oc.device_id
) as old_clk_count
|select '${stat_date}' as stat_date,count(
distinct(oc.device_id)
) as old_clk_count
|from all_clk_diary_card oc inner join device_id_old
|on oc.device_id = device_id_old.device_id
|group by stat_date
"""
.
stripMargin
)
old_clk_count
.
show
()
...
...
@@ -793,10 +792,9 @@ object find_reason {
//2.当天新用户中的点击用户数
val
new_clk_count
=
sc
.
sql
(
s
"""
|select '${stat_date}' as stat_date,count(
oc.device_id
) as new_clk_count
|select '${stat_date}' as stat_date,count(
distinct(oc.device_id)
) as new_clk_count
|from all_clk_diary_card oc inner join device_id_new
|on oc.device_id = device_id_new.device_id
|group by stat_date
"""
.
stripMargin
)
//2.1 有点击的新用户
...
...
@@ -815,8 +813,9 @@ object find_reason {
val
old_count
=
sc
.
sql
(
s
"""
|select '${stat_date}' as stat_date,count(distinct(dio.device_id)) as old_count
|from device_id_old dio
inner
join agency_id
|from device_id_old dio
left
join agency_id
|on dio.device_id = agency_id.device_id
|where agency_id.device_id is null
"""
.
stripMargin
)
...
...
@@ -824,8 +823,9 @@ object find_reason {
val
new_count
=
sc
.
sql
(
s
"""
|select '${stat_date}' as stat_date,count(distinct(din.device_id)) as new_count
|from device_id_new din
inner
join agency_id
|from device_id_new din
left
join agency_id
|on din.device_id = agency_id.device_id
|where agency_id.device_id is null
"""
.
stripMargin
)
...
...
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