Commit 4be69e48 authored by 王志伟's avatar 王志伟

测试埋点数据

parent 497359ca
...@@ -809,35 +809,46 @@ object test_data { ...@@ -809,35 +809,46 @@ object test_data {
val partition_date = stat_date.replace("-","") val partition_date = stat_date.replace("-","")
//美购加车数据 //美购加车数据
val diary_click=sc.sql( // val diary_click=sc.sql(
s""" // s"""
|SELECT T5_1.service_id AS service_id, --美购ID // |SELECT T5_1.service_id AS service_id, --美购ID
| T5_2.device_id AS device_id --设备ID // | T5_2.device_id AS device_id --设备ID
| FROM (SELECT DISTINCT T.person_id, // | FROM (SELECT DISTINCT T.person_id,
| T.service_id AS service_id // | T.service_id AS service_id
| FROM online.tl_meigou_shopcart_view T // | FROM online.tl_meigou_shopcart_view T
| WHERE T.partition_date = '${partition_date}' // | WHERE T.partition_date = '${partition_date}'
| AND from_unixtime(unix_timestamp(to_date(T.added_at), 'yyyy-MM-dd'), 'yyyyMMdd') = '${partition_date}') T5_1 --加入购物车的时间 // | AND from_unixtime(unix_timestamp(to_date(T.added_at), 'yyyy-MM-dd'), 'yyyyMMdd') = '${partition_date}') T5_1 --加入购物车的时间
| LEFT JOIN (SELECT T.person_id AS person_id, // | LEFT JOIN (SELECT T.person_id AS person_id,
| T5_3.device_id AS device_id // | T5_3.device_id AS device_id
| FROM online.ml_user_updates T // | FROM online.ml_user_updates T
| LATERAL VIEW explode(T.device_list) T5_3 AS device_id // | LATERAL VIEW explode(T.device_list) T5_3 AS device_id
| WHERE T.partition_date = '${partition_date}') T5_2 // | WHERE T.partition_date = '${partition_date}') T5_2
| ON T5_1.person_id = T5_2.person_id // | ON T5_1.person_id = T5_2.person_id
""".stripMargin // """.stripMargin
) // )
diary_click.show() // diary_click.show()
//美购订单数据
// val megou_click=sc.sql(
// s"""
// |SELECT partition_date,device_id,service_id
// |from online.ml_meigou_order_detail
// |where partition_date='${partition_date}'
// |and device_id is not null
// """.stripMargin
// )
// megou_click.show()
val megou_click=sc.sql( //咨询数据
val zixun_click=sc.sql(
s""" s"""
|SELECT partition_date,device_id,service_id |SELECT cl_id,params['service_id']
|from online.ml_meigou_order_detail |from online.tl_hdfs_maidian_view
|where partition_date='${partition_date}' |where partition_date='20190523'
|and device_id is not null |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 """.stripMargin
) )
megou_click.show() zixun_click.show()
......
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