Commit 06d3a0ba authored by Your Name's avatar Your Name

Merge branch 'master' of git.wanmeizhensuo.com:ML/ffm-baseline

parents ab8705af 06db23ba
...@@ -485,11 +485,14 @@ object icon_train_data { ...@@ -485,11 +485,14 @@ object icon_train_data {
//日记本点击数据 //日记本点击数据
val diary_click=sc.sql( val diary_click=sc.sql(
s""" s"""
|select cl_id as device_id, params['diary_id'] as diary_id |select cl_id as device_id,
|if(action='on_click_diary_card',params['diary_id'],
|if(action='on_click_card' and params['card_content_type']='diary',params['card_id']
|)) as diary_id
|from online.tl_hdfs_maidian_view |from online.tl_hdfs_maidian_view
|where action = 'on_click_diary_card' |where action in ('on_click_diary_card','on_click_card')
|and partition_date='${partition_date}' |and partition_date='${partition_date}'
|and params['diary_id'] is not null |and (params['diary_id'] is not null) or (params['card_id'] is not null)
""".stripMargin """.stripMargin
) )
diary_click.show() diary_click.show()
...@@ -530,11 +533,14 @@ object icon_train_data { ...@@ -530,11 +533,14 @@ object icon_train_data {
val meigou_click=sc.sql( val meigou_click=sc.sql(
s""" s"""
|select cl_id as device_id, params['service_id'] as service_id |select cl_id as device_id,
|if(action='goto_welfare_detail',params['service_id'],
|if(action='on_click_card' and params['card_content_type']='service',params['card_id']
|))as service_id
|from online.tl_hdfs_maidian_view |from online.tl_hdfs_maidian_view
|where action = 'goto_welfare_detail' |where action in ('goto_welfare_detail','on_click_card')
|and partition_date='${partition_date}' |and partition_date='${partition_date}'
|and params['service_id'] is not null |and (params['service_id'] is not null) or (params['card_id'] is not null)
""".stripMargin """.stripMargin
) )
meigou_click.show() meigou_click.show()
...@@ -631,7 +637,7 @@ object icon_train_data { ...@@ -631,7 +637,7 @@ object icon_train_data {
|SELECT cl_id as device_id,params['business_id'] as wiki_id |SELECT cl_id as device_id,params['business_id'] as wiki_id
|from online.tl_hdfs_maidian_view |from online.tl_hdfs_maidian_view
|where partition_date='${partition_date}' |where partition_date='${partition_date}'
|and (action='Search_result_wiki_click_item' or action='search_result_click_infomation_item' or action='search_result_wiki_click_recommend_wiki') |and action in ('Search_result_wiki_click_item','search_result_click_infomation_item', 'search_result_wiki_click_recommend_wiki')
""".stripMargin """.stripMargin
) )
wiki_click.createOrReplaceTempView("wiki_click") wiki_click.createOrReplaceTempView("wiki_click")
...@@ -902,7 +908,7 @@ object app_list_yunying { ...@@ -902,7 +908,7 @@ object app_list_yunying {
| ,'TF-toufang5','tf-toufang1','tf-toufang2','tf-toufang3','tf-toufang4','tf-toufang5','benzhan','promotion_aso100' | ,'TF-toufang5','tf-toufang1','tf-toufang2','tf-toufang3','tf-toufang4','tf-toufang5','benzhan','promotion_aso100'
| ,'promotion_qianka','promotion_xiaoyu','promotion_dianru','promotion_malioaso','promotion_malioaso-shequ' | ,'promotion_qianka','promotion_xiaoyu','promotion_dianru','promotion_malioaso','promotion_malioaso-shequ'
| ,'promotion_shike','promotion_julang_jl03','','unknown','promotion_zuimei') | ,'promotion_shike','promotion_julang_jl03','','unknown','promotion_zuimei')
|and partition_date ='20190531' |and partition_date ='20190430'
""".stripMargin """.stripMargin
) )
device_id_newUser.createOrReplaceTempView("device_id_new") device_id_newUser.createOrReplaceTempView("device_id_new")
...@@ -912,11 +918,13 @@ object app_list_yunying { ...@@ -912,11 +918,13 @@ object app_list_yunying {
|select * |select *
|from |from
|(select cl_id, |(select cl_id,
| channel,
| time_stamp, | time_stamp,
| params['installed_app_info'] as app_list, | params['installed_app_info'] as app_list,
| row_number() over (partition by cl_id order by time_stamp desc) as pk | row_number() over (partition by cl_id order by time_stamp desc) as pk
| from online.tl_hdfs_maidian_view | from online.tl_hdfs_maidian_view
|where partition_date >='20190501' |where partition_date <'20190501'
| and partition_date >='20190401'
| and action = 'user_installed_all_app_info' | and action = 'user_installed_all_app_info'
| and cl_type='android' | and cl_type='android'
| ) a | ) a
......
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