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
16a0593b
Commit
16a0593b
authored
Jun 12, 2019
by
王志伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
统计icon数据
parent
61840c1f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
5 deletions
+18
-5
data_feed_exposure_precise.scala
.../src/main/scala/com/gmei/data_feed_exposure_precise.scala
+18
-5
No files found.
eda/feededa/src/main/scala/com/gmei/data_feed_exposure_precise.scala
View file @
16a0593b
...
...
@@ -1083,7 +1083,7 @@ object icon_data {
//总体点击
val
icon_click_all
=
sc
.
sql
(
s
"""
|select count(*) as icon_click_num
|select
'${stat_date}' as stat_date,
count(*) as icon_click_num
|from online.tl_hdfs_maidian_view
|where partition_date='${partition_date}'
|and action='home_click_section'
...
...
@@ -1095,7 +1095,7 @@ object icon_data {
//总体曝光
val
icon_expoure_all
=
sc
.
sql
(
s
"""
|select count(*) as icon_expoure_num
|select
'${stat_date}' as stat_date,
count(*) as icon_expoure_num
|from online.ml_community_exposure_detail_new
|where partition_date='${partition_date}'
|and business_type='icon'
...
...
@@ -1108,7 +1108,7 @@ object icon_data {
//指定用户的点击
val
icon_click_device
=
sc
.
sql
(
s
"""
|select count(*) as icon_click_num_device
|select
'${stat_date}' as stat_date,
count(*) as icon_click_num_device
|from online.tl_hdfs_maidian_view a
|inner join device_id b
|on a.cl_id=b.device_id
...
...
@@ -1121,7 +1121,7 @@ object icon_data {
//指定用户的曝光
val
icon_expoure_device
=
sc
.
sql
(
s
"""
|select count(*) as icon_expoure_num_device
|select
'${stat_date}' as stat_date,
count(*) as icon_expoure_num_device
|from online.ml_community_exposure_detail_new a
|inner join device_id b
|on a.cl_id=b.device_id
...
...
@@ -1129,9 +1129,22 @@ object icon_data {
|and a.business_type='icon'
"""
.
stripMargin
)
icon_expoure_
all
.
createOrReplaceTempView
(
"icon_expoure_all
"
)
icon_expoure_
device
.
createOrReplaceTempView
(
"icon_expoure_device
"
)
icon_expoure_device
.
show
()
val
result
=
icon_click_all
.
join
(
icon_expoure_all
,
"stat_date"
)
.
join
(
icon_click_device
,
"stat_date"
)
.
join
(
icon_expoure_device
,
"stat_date"
)
println
(
"开始写入"
)
GmeiConfig
.
writeToJDBCTable
(
"jdbc:mysql://172.16.40.158:4000/jerry_prod?user=root&password=3SYz54LS9#^9sBvC&rewriteBatchedStatements=true"
,
result
,
table
=
"icon_data"
,
SaveMode
.
Append
)
println
(
"写入完成"
)
}
...
...
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