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

更改时间

parent cca83b5f
...@@ -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
) )
......
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