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
a0e73dd2
Commit
a0e73dd2
authored
Oct 18, 2018
by
高雅喆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add date param
parent
fccb3d72
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
WeafareStat.scala
eda/feededa/src/main/scala/com/gmei/WeafareStat.scala
+10
-7
No files found.
eda/feededa/src/main/scala/com/gmei/WeafareStat.scala
View file @
a0e73dd2
...
@@ -43,15 +43,16 @@ object WeafareStat {
...
@@ -43,15 +43,16 @@ object WeafareStat {
ti
.
tidbMapTable
(
dbName
=
"jerry_prod"
,
tableName
=
"diary_video"
)
ti
.
tidbMapTable
(
dbName
=
"jerry_prod"
,
tableName
=
"diary_video"
)
ti
.
tidbMapTable
(
dbName
=
"jerry_prod"
,
tableName
=
"data_feed_click"
)
ti
.
tidbMapTable
(
dbName
=
"jerry_prod"
,
tableName
=
"data_feed_click"
)
import
sc.implicits._
val
stat_date
=
GmeiConfig
.
getMinusNDate
(
1
)
println
(
stat_date
)
val
video_cids
=
sc
.
sql
(
val
video_cids
=
sc
.
sql
(
s
"""
s
"""
|select distinct(cid_id) as cid_id
|select distinct(cid_id) as cid_id
|from data_feed_click
|from data_feed_click
|where cid_type = 'diary'
|where cid_type = 'diary'
|and cid_id in (select cid from diary_video where stat_date='
2018-10-17
')
|and cid_id in (select cid from diary_video where stat_date='
${stat_date}
')
|and stat_date ='
2018-10-17
'
|and stat_date ='
${stat_date}
'
"""
.
stripMargin
"""
.
stripMargin
)
)
video_cids
.
show
()
video_cids
.
show
()
...
@@ -62,19 +63,21 @@ object WeafareStat {
...
@@ -62,19 +63,21 @@ object WeafareStat {
|select distinct(cid_id) as cid_id
|select distinct(cid_id) as cid_id
|from data_feed_click
|from data_feed_click
|where cid_type = 'diary'
|where cid_type = 'diary'
|and cid_id not in (select cid from diary_video where stat_date='
2018-10-17
')
|and cid_id not in (select cid from diary_video where stat_date='
${stat_date}
')
|and stat_date ='
2018-10-17
'
|and stat_date ='
${stat_date}
'
"""
.
stripMargin
"""
.
stripMargin
)
)
txt_cids
.
show
()
txt_cids
.
show
()
txt_cids
.
createOrReplaceTempView
(
"tmp2"
)
txt_cids
.
createOrReplaceTempView
(
"tmp2"
)
val
partition_date
=
stat_date
.
replace
(
"-"
,
""
)
println
(
partition_date
)
val
video_count
=
sc
.
sql
(
val
video_count
=
sc
.
sql
(
s
"""
s
"""
|select count(page_name) as vd_count
|select count(page_name) as vd_count
|from online.bl_hdfs_page_view_updates pv inner join tmp1
|from online.bl_hdfs_page_view_updates pv inner join tmp1
|on pv.referrer_id = tmp1.cid_id
|on pv.referrer_id = tmp1.cid_id
|where pv.partition_date = '
20181017
'
|where pv.partition_date = '
${partition_date}
'
|and pv.page_name='welfare_detail'
|and pv.page_name='welfare_detail'
|and pv.referrer='diary_detail'
|and pv.referrer='diary_detail'
"""
.
stripMargin
"""
.
stripMargin
...
@@ -90,7 +93,7 @@ object WeafareStat {
...
@@ -90,7 +93,7 @@ object WeafareStat {
|select count(page_name) as txt_count
|select count(page_name) as txt_count
|from online.bl_hdfs_page_view_updates pv inner join tmp2
|from online.bl_hdfs_page_view_updates pv inner join tmp2
|on pv.referrer_id = tmp2.cid_id
|on pv.referrer_id = tmp2.cid_id
|where pv.partition_date = '
20181017
'
|where pv.partition_date = '
${partition_date}
'
|and pv.page_name='welfare_detail'
|and pv.page_name='welfare_detail'
|and pv.referrer='diary_detail'
|and pv.referrer='diary_detail'
"""
.
stripMargin
"""
.
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