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
8b35aba5
Commit
8b35aba5
authored
May 07, 2019
by
王志伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更改时间
parent
cca83b5f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
30 deletions
+12
-30
data_feed_exposure_precise.scala
.../src/main/scala/com/gmei/data_feed_exposure_precise.scala
+12
-30
No files found.
eda/feededa/src/main/scala/com/gmei/data_feed_exposure_precise.scala
View file @
8b35aba5
...
@@ -502,24 +502,21 @@ object icon_train_data {
...
@@ -502,24 +502,21 @@ object icon_train_data {
)
)
diary_tags
.
createOrReplaceTempView
(
"diary_tags"
)
diary_tags
.
createOrReplaceTempView
(
"diary_tags"
)
val
tag_hierarchy_detail
=
sc
.
sql
(
//
val tag_hierarchy_detail = sc.sql(
s
"""
//
s"""
|select * from online.bl_tag_hierarchy_detail
//
|select * from online.bl_tag_hierarchy_detail
|where partition_date = '${partition_date}'
//
|where partition_date = '${partition_date}'
"""
.
stripMargin
//
""".stripMargin
)
//
)
//
tag_hierarchy_detail
.
createOrReplaceTempView
(
"tag_hierarchy_detail"
)
//
tag_hierarchy_detail.createOrReplaceTempView("tag_hierarchy_detail")
val
diary_tag_detail
=
sc
.
sql
(
val
diary_tag_detail
=
sc
.
sql
(
s
"""
s
"""
|select a.*,b.tag_id
,c.level1_id,c.level2_id,c.level3_id
|select a.*,b.tag_id
|from diary_click a
|from diary_click a
|left join diary_tags b
|left join diary_tags b
|on a.diary_id=b.diary_id
|on a.diary_id=b.diary_id
|left join tag_hierarchy_detail c
|on b.tag_id=c.id
|where level1_id is not null
"""
.
stripMargin
"""
.
stripMargin
)
)
...
@@ -528,13 +525,7 @@ object icon_train_data {
...
@@ -528,13 +525,7 @@ object icon_train_data {
val
temp_diary
=
sc
.
sql
(
val
temp_diary
=
sc
.
sql
(
s
"""
s
"""
|select '${stat_date}' as stat_date,device_id,tag_id,level1_id as level_id
|select '${stat_date}' as stat_date,device_id,tag_id
|from diary_tag_detail
|union all
|select '${stat_date}' as stat_date,device_id,tag_id,level2_id as level_id
|from diary_tag_detail
|union all
|select '${stat_date}' as stat_date,device_id,tag_id,level3_id as level_id
|from diary_tag_detail
|from diary_tag_detail
"""
.
stripMargin
"""
.
stripMargin
)
)
...
@@ -567,13 +558,10 @@ object icon_train_data {
...
@@ -567,13 +558,10 @@ object icon_train_data {
val
meigou_tag_detail
=
sc
.
sql
(
val
meigou_tag_detail
=
sc
.
sql
(
s
"""
s
"""
|select a.*,b.tag_id
,c.level1_id,c.level2_id,c.level3_id
|select a.*,b.tag_id
|from meigou_click a
|from meigou_click a
|left join meigou_tags b
|left join meigou_tags b
|on a.service_id=b.service_id
|on a.service_id=b.service_id
|left join tag_hierarchy_detail c
|on b.tag_id=c.id
|where level1_id is not null
"""
.
stripMargin
"""
.
stripMargin
)
)
...
@@ -582,13 +570,7 @@ object icon_train_data {
...
@@ -582,13 +570,7 @@ object icon_train_data {
val
temp_meigou
=
sc
.
sql
(
val
temp_meigou
=
sc
.
sql
(
s
"""
s
"""
|select '${stat_date}' as stat_date,device_id,tag_id,level1_id as level_id
|select '${stat_date}' as stat_date,device_id,tag_id
|from diary_tag_detail
|union all
|select '${stat_date}' as stat_date,device_id,tag_id,level2_id as level_id
|from diary_tag_detail
|union all
|select '${stat_date}' as stat_date,device_id,tag_id,level3_id as level_id
|from diary_tag_detail
|from diary_tag_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