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
4b5d419a
Commit
4b5d419a
authored
Nov 24, 2018
by
高雅喆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add esmm data
parent
625dfcb7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
12 deletions
+43
-12
EsmmData.scala
eda/feededa/src/main/scala/com/gmei/EsmmData.scala
+43
-12
No files found.
eda/feededa/src/main/scala/com/gmei/EsmmData.scala
View file @
4b5d419a
...
...
@@ -84,10 +84,10 @@ object EsmmData {
val
imp_data_filter
=
imp_data
.
except
(
clk_data
).
withColumn
(
"y"
,
lit
(
0
)).
withColumn
(
"z"
,
lit
(
0
))
imp_data_filter
.
createOrReplaceTempView
(
"imp_data_filter"
)
imp_data_filter
.
show
()
println
(
"imp_data_filter.count()"
)
println
(
imp_data_filter
.
count
())
//
imp_data_filter.createOrReplaceTempView("imp_data_filter")
//
imp_data_filter.show()
//
println("imp_data_filter.count()")
//
println(imp_data_filter.count())
val
stat_date_not
=
GmeiConfig
.
getMinusNDate
(
14
).
replace
(
"-"
,
""
)
...
...
@@ -106,26 +106,57 @@ object EsmmData {
)
val
cvr_data_filter
=
cvr_data
.
withColumn
(
"y"
,
lit
(
1
)).
withColumn
(
"z"
,
lit
(
1
))
cvr_data_filter
.
createOrReplaceTempView
(
"cvr_data_filter"
)
cvr_data_filter
.
show
()
println
(
"cvr_data_filter.count()"
)
println
(
cvr_data_filter
.
count
())
//
cvr_data_filter.createOrReplaceTempView("cvr_data_filter")
//
cvr_data_filter.show()
//
println("cvr_data_filter.count()")
//
println(cvr_data_filter.count())
val
clk_data_filter
=
clk_data
.
except
(
cvr_data
).
withColumn
(
"y"
,
lit
(
1
)).
withColumn
(
"z"
,
lit
(
0
))
clk_data_filter
.
createOrReplaceTempView
(
"clk_data_filter"
)
clk_data_filter
.
show
()
println
(
"clk_data_filter.count()"
)
println
(
clk_data_filter
.
count
())
//
clk_data_filter.createOrReplaceTempView("clk_data_filter")
//
clk_data_filter.show()
//
println("clk_data_filter.count()")
//
println(clk_data_filter.count())
val
union_data
=
imp_data_filter
.
union
(
clk_data_filter
).
union
(
cvr_data_filter
)
union_data
.
createOrReplaceTempView
(
"union_data"
)
union_data
.
show
()
println
(
"union_data.count()"
)
println
(
union_data
.
count
())
val
yesteday
=
GmeiConfig
.
getMinusNDate
(
1
).
replace
(
"-"
,
""
)
val
union_data_clabel
=
sc
.
sql
(
s
"""
|select a.stat_date,a.device_id,a.ucity_id,a.cid_id,a.diary_service_id,a.y,a.z,
| c.level1_id as clevel1_id
|from union_data a
|left join online.tl_hdfs_diary_tags_view on a.cid_id=b.b.diary_id
|left join online.bl_tag_hierarchy_detail c on b.tag_id=c.id
|where b.partition_date='${yesteday}'
|and c.partition_date='${yesteday}'
"""
.
stripMargin
)
union_data_clabel
.
createOrReplaceTempView
(
"union_data_clabel"
)
union_data_clabel
.
show
()
val
union_data_slabel
=
sc
.
sql
(
s
"""
|select a.stat_date,a.device_id,a.ucity_id,a.cid_id,a.diary_service_id,a.y,a.z,a.clevel1_id,
| c.level1_id as slevel1_id
|from union_data_clabel a
|left join online.tl_meigou_servicetag_view b on a.diary_service_id=b.service_id
|left join online.bl_tag_hierarchy_detail c on b.tag_id=c.id
|where b.partition_date='${yesteday}'
|and c.partition_date='${yesteday}'
"""
.
stripMargin
)
union_data_slabel
.
createOrReplaceTempView
(
"union_data_slabel"
)
union_data_slabel
.
show
()
sc
.
stop
()
...
...
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