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
b953c5ee
Commit
b953c5ee
authored
Nov 24, 2018
by
高雅喆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add esmm data
parent
f3954636
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
5 deletions
+37
-5
EsmmData.scala
eda/feededa/src/main/scala/com/gmei/EsmmData.scala
+37
-5
No files found.
eda/feededa/src/main/scala/com/gmei/EsmmData.scala
View file @
b953c5ee
...
...
@@ -46,6 +46,7 @@ object EsmmData {
val
ti
=
new
TiContext
(
sc
)
ti
.
tidbMapTable
(
dbName
=
"eagle"
,
tableName
=
"src_mimas_prod_api_diary_tags"
)
ti
.
tidbMapTable
(
dbName
=
"eagle"
,
tableName
=
"src_zhengxing_api_tag"
)
ti
.
tidbMapTable
(
dbName
=
"jerry_prod"
,
tableName
=
"data_feed_click"
)
ti
.
tidbMapTable
(
dbName
=
"jerry_prod"
,
tableName
=
"data_feed_exposure"
)
...
...
@@ -122,9 +123,9 @@ object EsmmData {
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
())
//
union_data.show()
//
println("union_data.count()")
//
println(union_data.count())
val
yesteday
=
GmeiConfig
.
getMinusNDate
(
1
).
replace
(
"-"
,
""
)
...
...
@@ -140,7 +141,7 @@ object EsmmData {
"""
.
stripMargin
)
union_data_clabel
.
createOrReplaceTempView
(
"union_data_clabel"
)
union_data_clabel
.
show
()
//
union_data_clabel.show()
val
union_data_slabel
=
sc
.
sql
(
s
"""
...
...
@@ -154,7 +155,38 @@ object EsmmData {
"""
.
stripMargin
)
union_data_slabel
.
createOrReplaceTempView
(
"union_data_slabel"
)
union_data_slabel
.
show
()
// union_data_slabel.show()
val
union_data_ccity_name
=
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,a.slevel1_id,
| c.name as ccity_name
|from union_data_slabel a
|left join src_mimas_prod_api_diary_tags b on a.cid_id=b.diary_id
|left join src_zhengxing_api_tag c on b.tag_id=c.id
| where c.tag_type=4
"""
.
stripMargin
)
union_data_ccity_name
.
createOrReplaceTempView
(
"union_data_ccity_name"
)
union_data_ccity_name
.
show
()
val
union_data_scity_id
=
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,a.slevel1_id,a.ccity_name
| d.city_id as scity_id
|from union_data_ccity_name a
|left join online.tl_meigou_service_view b on a.diary_service_id=b.id
|left join online.tl_hdfs_doctor_view c on b.doctor_id=c.id
|left join online.tl_hdfs_hospital_view d on c.hospital_id=d.id
|where b.partition_date='${yesteday}'
|and c.partition_date='${yesteday}'
|and d.partition_date='${yesteday}'
"""
.
stripMargin
)
union_data_scity_id
.
createOrReplaceTempView
(
"union_data_scity_id"
)
union_data_scity_id
.
show
()
...
...
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