Commit ed51236d authored by 王志伟's avatar 王志伟

修改统计参数

parent 0a94f32e
......@@ -325,13 +325,13 @@ object coincidence_xinyang {
//1.重合用户的美购数
val meigou_coincidence_num = sc.sql(
s"""
|select count(service_id) as meigou_coincidence_num
|select count(ov.service_id) as meigou_coincidence_num
|from online.ml_meigou_order_detail ov left join coincidence_id
|on ov.device_id = coincidence_id.device_id
|where partition_date = '20181120'
|and coincidence_id.device_id is not null
|and pay_time is not null
|and pay_time >= '2017-11-18'
|and ov.pay_time is not null
|and ov.pay_time >= '2017-11-18'
""".stripMargin
)
meigou_coincidence_num.show()
......@@ -340,26 +340,26 @@ object coincidence_xinyang {
//2.重合用户进行美购的用户数
val meigou_pay_device = sc.sql(
s"""
|select count(distinct(service_id)) as meigou_coincidence_num
|select count(distinct(ov.service_id)) as meigou_coincidence_num
|from online.ml_meigou_order_detail ov left join coincidence_id
|on ov.device_id = coincidence_id.device_id
|where partition_date = '20181120'
|and coincidence_id.device_id is not null
|and pay_time is not null
|and pay_time >= '2017-11-18'
|and ov.pay_time is not null
|and ov.pay_time >= '2017-11-18'
""".stripMargin
)
meigou_pay_device.show()
//3.所有获得应用列表的用户的美购数
val meigou_pay_all = sc.sql(
s"""
|select count(device_id) as meigou_pay_device
|select count(od.device_id) as meigou_pay_device
|from online.ml_meigou_order_detail od inner join all_id
|on od.device_id = all_id.device_id
|where partition_date = '20181120'
|and all_id.device_id is not null
|and pay_time is not null
|and pay_time >= '2017-11-18'
|and od.pay_time is not null
|and od.pay_time >= '2017-11-18'
""".stripMargin
)
meigou_pay_all.show()
......@@ -367,62 +367,66 @@ object coincidence_xinyang {
//4.所有获得应用列表用户进行美购的用户数
val meigou_pay_device_all = sc.sql(
s"""
|select count(distinct(device_id)) as meigou_pay_device
|select count(distinct(od.device_id)) as meigou_pay_device
|from online.ml_meigou_order_detail od inner join all_id
|on od.device_id = all_id.device_id
|where partition_date = '20181120'
|and all_id.device_id is not null
|and pay_time is not null
|and pay_time >= '2017-11-18'
|and od.pay_time is not null
|and od.pay_time >= '2017-11-18'
""".stripMargin
)
meigou_pay_device_all.show()
/* //截止目前获得的与新氧重合的用户数咨询统计
//截止目前获得的与新氧重合的用户数咨询统计
val zixun_num_all = sc.sql(
s"""
|select count(cl_id) as zixun_num_all
|from online.tl_hdfs_maidian_view ov inner join all_device_id
|on ov.cl_id = all_device_id.device_id
|select count(ov.cl_id) as zixun_num_all
|from online.tl_hdfs_maidian_view ov left join coincidence_id
|on ov.cl_id = coincidence_id.device_id
|where partition_date >= '20180501'
|and coincidence_id.device_id is not null
|and action = 'welfare_detail_click_message'
""".stripMargin
).repartition(100)
)
zixun_num_all.show()
val zixun_device_all = sc.sql(
s"""
|select count(distinct(cl_id)) as zixun_num_all
|from online.tl_hdfs_maidian_view ov inner join all_device_id
|on ov.cl_id = all_device_id.device_id
|select count(distinct(ov.cl_id)) as zixun_num_all
|from online.tl_hdfs_maidian_view ov left join coincidence_id
|on ov.cl_id = coincidence_id.device_id
|where partition_date >= '20180501'
|and coincidence_id.device_id is not null
|and action = 'welfare_detail_click_message'
""".stripMargin
).repartition(100)
)
zixun_device_all.show()
val zixun_num_co = sc.sql(
s"""
|select count(cl_id) as zixun_num_co
|from online.tl_hdfs_maidian_view
|select count(distinct(ov.cl_id)) as zixun_num_all
|from online.tl_hdfs_maidian_view ov left join all_id
|on ov.cl_id = coincidence_id.device_id
|where partition_date >= '20180501'
|and coincidence_id.device_id is not null
|and action = 'welfare_detail_click_message'
|and cl_id in (select distinct(device_id) from device_id_coincidence)
""".stripMargin
).repartition(100)
)
zixun_num_co.show()
val zixun_num_co_dis = sc.sql(
s"""
|select count(distinct(cl_id)) as zixun_num_co_dis
|from online.tl_hdfs_maidian_view
|select count(distinct(ov.cl_id)) as zixun_num_all
|from online.tl_hdfs_maidian_view ov left join all_id
|on ov.cl_id = coincidence_id.device_id
|where partition_date >= '20180501'
|and coincidence_id.device_id is not null
|and action = 'welfare_detail_click_message'
|and cl_id in (select distinct(device_id) from device_id_coincidence)
""".stripMargin
).repartition(100)
)
zixun_num_co_dis.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