Commit 8b35aba5 authored by 王志伟's avatar 王志伟

更改时间

parent cca83b5f
......@@ -502,24 +502,21 @@ object icon_train_data {
)
diary_tags.createOrReplaceTempView("diary_tags")
val tag_hierarchy_detail = sc.sql(
s"""
|select * from online.bl_tag_hierarchy_detail
|where partition_date = '${partition_date}'
""".stripMargin
)
tag_hierarchy_detail.createOrReplaceTempView("tag_hierarchy_detail")
// val tag_hierarchy_detail = sc.sql(
// s"""
// |select * from online.bl_tag_hierarchy_detail
// |where partition_date = '${partition_date}'
// """.stripMargin
// )
//
// tag_hierarchy_detail.createOrReplaceTempView("tag_hierarchy_detail")
val diary_tag_detail = sc.sql(
s"""
|select a.*,b.tag_id,c.level1_id,c.level2_id,c.level3_id
|select a.*,b.tag_id
|from diary_click a
|left join diary_tags b
|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
)
......@@ -528,13 +525,7 @@ object icon_train_data {
val temp_diary = sc.sql(
s"""
|select '${stat_date}' as stat_date,device_id,tag_id,level1_id as level_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
|select '${stat_date}' as stat_date,device_id,tag_id
|from diary_tag_detail
""".stripMargin
)
......@@ -567,13 +558,10 @@ object icon_train_data {
val meigou_tag_detail = sc.sql(
s"""
|select a.*,b.tag_id,c.level1_id,c.level2_id,c.level3_id
|select a.*,b.tag_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
)
......@@ -582,13 +570,7 @@ object icon_train_data {
val temp_meigou = sc.sql(
s"""
|select '${stat_date}' as stat_date,device_id,tag_id,level1_id as level_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
|select '${stat_date}' as stat_date,device_id,tag_id
|from diary_tag_detail
""".stripMargin
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment