Commit 80dcc88d authored by 王志伟's avatar 王志伟

测试埋点数据

parent 4e31d7ff
......@@ -484,7 +484,7 @@ object icon_train_data {
//日记本点击数据
val diary_click=sc.sql(
s"""
|select partition_date,cl_id as device_id, params['diary_id'] as diary_id
|select cl_id as device_id, params['diary_id'] as diary_id
|from online.tl_hdfs_maidian_view
|where action = 'on_click_diary_card'
|and partition_date='${partition_date}'
......@@ -502,15 +502,6 @@ 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 diary_tag_detail = sc.sql(
s"""
|select a.*,b.tag_id
......@@ -525,7 +516,7 @@ object icon_train_data {
val temp_diary = sc.sql(
s"""
|select '${stat_date}' as stat_date,device_id,tag_id
|select device_id,tag_id
|from diary_tag_detail
""".stripMargin
)
......@@ -538,7 +529,7 @@ object icon_train_data {
val meigou_click=sc.sql(
s"""
|select partition_date,cl_id as device_id, params['service_id'] as service_id
|select 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}'
......@@ -550,7 +541,7 @@ object icon_train_data {
val megou_order=sc.sql(
s"""
|SELECT partition_date,device_id,service_id
|SELECT device_id,service_id
|from online.ml_meigou_order_detail
|where partition_date='${partition_date}'
|and device_id is not null
......@@ -560,10 +551,9 @@ object icon_train_data {
val meigou_jiache=sc.sql(
s"""
|SELECT T.partition_date
| T5_2.device_id AS device_id,
|SELECT T5_2.device_id AS device_id,
| T5_1.service_id AS service_id
| FROM (SELECT DISTINCT T.partition_date,T.person_id,
| FROM (SELECT DISTINCT T.person_id,
| T.service_id AS service_id
| FROM online.tl_meigou_shopcart_view T
| WHERE T.partition_date = '${partition_date}'
......@@ -613,7 +603,7 @@ object icon_train_data {
val temp_meigou = sc.sql(
s"""
|select '${stat_date}' as stat_date,device_id,tag_id
|select device_id,tag_id
|from meigou_tag_detail
""".stripMargin
)
......@@ -633,7 +623,7 @@ object icon_train_data {
println("开始写入")
GmeiConfig.writeToJDBCTable("jdbc:mysql://172.16.40.158:4000/jerry_prod?user=root&password=3SYz54LS9#^9sBvC&rewriteBatchedStatements=true",final_train, table="icon_train_data",SaveMode.Append)
GmeiConfig.writeToJDBCTable("jdbc:mysql://172.16.40.158:4000/jerry_prod?user=root&password=3SYz54LS9#^9sBvC&rewriteBatchedStatements=true",final_train, table="icon_train_data_test",SaveMode.Append)
println("写入完成")
......@@ -886,9 +876,9 @@ object test_data {
//咨询美购数据
val zixun_click=sc.sql(
s"""
|SELECT cl_id,params['service_id']
|SELECT partition_date,cl_id as device_id,params['service_id'] as service_id
|from online.tl_hdfs_maidian_view
|where partition_date='20190523'
|where partition_date='${partition_date}'
|and (action='welfare_detail_click_phone' or action='welfare_detail_click_consult' or action='welfare_detail_click_message' or action='welfare_detail_click_curearea_contact')
""".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