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

将应用列表添加到table

parent 37c7f1e8
......@@ -93,7 +93,7 @@ object app_list {
//获取与新氧用户重合的用户device_id
val app_list = sc.sql(
/* val app_list = sc.sql(
s"""
|select distinct(cl_id) as device_id, user_id as user_id, params['installed_app_info'] as app_list,channel
|from online.tl_hdfs_maidian_view ov left join agency_id
......@@ -139,7 +139,37 @@ object app_list {
)
val tempp_list=app_list_all.withColumn("stat_date",addCol(app_list_all("device_id")))
GmeiConfig.writeToJDBCTable(tempp_list, "device_id_applist", SaveMode.Append)
GmeiConfig.writeToJDBCTable(tempp_list, "device_id_applist", SaveMode.Append) */
//在更美有消费的用户列表
val device_id_meigou = sc.sql(
s"""
|select DISTINCT(od.device_id) as device_id
|from online.ml_meigou_order_detail od left join agency_id
|on od.device_id = agency_id.device_id
|where od.partition_date = '20181118'
|and od.pay_time is not null
|and od.pay_time >= '2017-11-18'
|and agency_id.device_id is null
|and od.device_id not in (select distinct(device_id) from blacklist)
""".stripMargin
)
device_id_meigou.createOrReplaceTempView("device_id_meigou")
val app_list_meigou = sc.sql(
s"""
|select distinct(ov.cl_id) as device_id, user_id as user_id,params['installed_app_info'] as app_list,channel
|from online.tl_hdfs_maidian_view ov left join device_id_meigou
|on ov.cl_id = device_id_meigou.device_id
|where ov.action="user_installed_all_app_info"
|and agency_id.device_id is not null
|and ov.partition_date = '${partition_date}'
""".stripMargin
)
val applist_meigou=app_list_meigou.withColumn("stat_date",addCol(app_list_meigou("device_id")))
GmeiConfig.writeToJDBCTable(applist_meigou, "device_id_meigou", SaveMode.Append)
}
......
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