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
d6967541
Commit
d6967541
authored
6 years ago
by
高雅喆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rm db name in sql
parent
8aafd80f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
WeafareStat.scala
eda/feededa/src/main/scala/com/gmei/WeafareStat.scala
+6
-6
No files found.
eda/feededa/src/main/scala/com/gmei/WeafareStat.scala
View file @
d6967541
...
@@ -48,9 +48,9 @@ object WeafareStat {
...
@@ -48,9 +48,9 @@ object WeafareStat {
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
jerry_prod.
data_feed_click
|from data_feed_click
|where cid_type = 'diary'
|where cid_type = 'diary'
|and cid_id in (select cid from
jerry_prod.
diary_video where stat_date='2018-10-17')
|and cid_id in (select cid from diary_video where stat_date='2018-10-17')
|and stat_date ='2018-10-17'
|and stat_date ='2018-10-17'
"""
.
stripMargin
"""
.
stripMargin
)
)
...
@@ -60,9 +60,9 @@ object WeafareStat {
...
@@ -60,9 +60,9 @@ object WeafareStat {
val
txt_cids
=
sc
.
sql
(
val
txt_cids
=
sc
.
sql
(
s
"""
s
"""
|select distinct(cid_id) as cid_id
|select distinct(cid_id) as cid_id
|from
jerry_prod.
data_feed_click
|from data_feed_click
|where cid_type = 'diary'
|where cid_type = 'diary'
|and cid_id not in (select cid from
jerry_prod.
diary_video where stat_date='2018-10-17')
|and cid_id not in (select cid from diary_video where stat_date='2018-10-17')
|and stat_date ='2018-10-17'
|and stat_date ='2018-10-17'
"""
.
stripMargin
"""
.
stripMargin
)
)
...
@@ -80,7 +80,7 @@ object WeafareStat {
...
@@ -80,7 +80,7 @@ object WeafareStat {
"""
.
stripMargin
"""
.
stripMargin
)
)
video_count
.
show
()
video_count
.
show
()
val
output1
=
"
/home/gaoyazhe
/test_vd_cids.csv"
val
output1
=
"
.
/test_vd_cids.csv"
video_count
.
repartition
(
1
).
write
.
format
(
"com.databricks.spark.csv"
).
option
(
"header"
,
"true"
).
save
(
output1
)
video_count
.
repartition
(
1
).
write
.
format
(
"com.databricks.spark.csv"
).
option
(
"header"
,
"true"
).
save
(
output1
)
val
txt_count
=
sc
.
sql
(
val
txt_count
=
sc
.
sql
(
...
@@ -94,7 +94,7 @@ object WeafareStat {
...
@@ -94,7 +94,7 @@ object WeafareStat {
"""
.
stripMargin
"""
.
stripMargin
)
)
txt_count
.
show
()
txt_count
.
show
()
val
output2
=
"
/home/gaoyazhe
/test_txt_cids.csv"
val
output2
=
"
.
/test_txt_cids.csv"
txt_count
.
repartition
(
1
).
write
.
format
(
"com.databricks.spark.csv"
).
option
(
"header"
,
"true"
).
save
(
output2
)
txt_count
.
repartition
(
1
).
write
.
format
(
"com.databricks.spark.csv"
).
option
(
"header"
,
"true"
).
save
(
output2
)
...
...
This diff is collapsed.
Click to expand it.
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