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
cd4b1acb
Commit
cd4b1acb
authored
Oct 26, 2018
by
张彦钊
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of git.wanmeizhensuo.com:ML/ffm-baseline
修改选取数据表
parents
7759df17
930f74e8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
WeafareStat.scala
eda/feededa/src/main/scala/com/gmei/WeafareStat.scala
+9
-0
No files found.
eda/feededa/src/main/scala/com/gmei/WeafareStat.scala
View file @
cd4b1acb
...
...
@@ -119,9 +119,18 @@ object WeafareStat {
)
txt_clk_count
.
show
()
val
video_count
=
sc
.
sql
(
s
"""
|select '${stat_date}' as stat_date,count(distinct(cid)) as video_count
|from diary_video where stat_date='${stat_date}'
"""
.
stripMargin
)
video_count
.
show
()
val
result
=
video_clk_count
.
join
(
video_meigou_count
,
"stat_date"
)
.
join
(
txt_clk_count
,
"stat_date"
)
.
join
(
txt_meigou_count
,
"stat_date"
)
.
join
(
video_count
,
"stat_date"
)
val
result1
=
result
.
withColumn
(
"video_rate"
,
result
.
col
(
"video_meigou_count"
)/
result
.
col
(
"video_clk_count"
))
val
result2
=
result1
.
withColumn
(
"txt_rate"
,
result
.
col
(
"txt_meigou_count"
)/
result
.
col
(
"txt_clk_count"
))
...
...
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