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
b587323b
Commit
b587323b
authored
May 05, 2019
by
王志伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
取icon训练数据
parent
4c1ef90c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
0 deletions
+70
-0
data_feed_exposure_precise.scala
.../src/main/scala/com/gmei/data_feed_exposure_precise.scala
+70
-0
No files found.
eda/feededa/src/main/scala/com/gmei/data_feed_exposure_precise.scala
View file @
b587323b
...
...
@@ -534,6 +534,76 @@ object icon_train_data {
"""
.
stripMargin
)
temp_diary
.
show
()
temp_diary
.
createOrReplaceTempView
(
"temp_diary"
)
// 美购点击数据
val
meigou_click
=
sc
.
sql
(
s
"""
|select partition_date,cl_id as device_id, params['service_id'] as service_id
|from online.tl_hdfs_maidian_view
|where action = 'goto_welfare_detail'
|and partition_date='${partition_date}'
|and params['service_id'] is not null
"""
.
stripMargin
)
meigou_click
.
show
()
meigou_click
.
createOrReplaceTempView
(
"meigou_click"
)
val
meigou_tags
=
sc
.
sql
(
s
"""
|select * from online.tl_meigou_servicetag_view
|where partition_date = '${partition_date}'
"""
.
stripMargin
)
meigou_tags
.
createOrReplaceTempView
(
"meigou_tags"
)
val
meigou_tag_detail
=
sc
.
sql
(
s
"""
|select a.*,b.tag_id,c.level1_id,c.level2_id,c.level3_id
|from meigou_click a
|left join meigou_tags b
|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
)
meigou_tag_detail
.
createOrReplaceTempView
(
"meigou_tag_detail"
)
val
temp_meigou
=
sc
.
sql
(
s
"""
|select '${stat_date}' as stat_date,device_id,tag_id,level1_id as level
|from diary_tag_detail
|union all
|select '${stat_date}' as stat_date,device_id,tag_id,level2_id as level
|from diary_tag_detail
|union all
|select '${stat_date}' as stat_date,device_id,tag_id,level3_id as level
|from diary_tag_detail
"""
.
stripMargin
)
temp_meigou
.
createOrReplaceTempView
(
"temp_meigou"
)
val
final_train
=
sc
.
sql
(
s
"""
|select *
|from temp_diary
|union all
|select *
|from temp_meigou
"""
.
stripMargin
)
final_train
.
show
()
// val Df2 = test_diary.withColumn("tag_list",explode(split()))
...
...
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