Commit 2a2c73b5 authored by 王志伟's avatar 王志伟

新统计需求

parent bfb3fbae
......@@ -76,7 +76,7 @@ object app_list {
//获取策略命中用户device_id
val app_list = sc.sql(
s"""
|select distinct(cl_id) as device_id,params['installed_app_info'] as app_list
|select distinct(cl_id) as device_id, user_id as user_id, params['installed_app_info'] as app_list
|from online.tl_hdfs_maidian_view
|where action="user_installed_all_app_info"
|and partition_date = '${partition_date}'
......@@ -84,8 +84,8 @@ object app_list {
)
//app_list.show()
import sc.implicits._
val rdd_df = app_list.rdd.map(x =>(x(0).toString,x(1).toString))
.filter(x => x._2.contains("新氧美容")).map(x => x._1).collect().toList.toDF("device_id")
val rdd_df = app_list.rdd.map(x =>(x(0).toString,x(1).toString,x(2).toString))
.filter(x => x._3.contains("新氧美容")).map(x => (x._1,x._2)).collect().toList.toDF("device_id","user_id")
rdd_df.show()
//rdd_df.withColumn("stat_date",addCol(rdd_df("device_id")))
rdd_df.createOrReplaceTempView("device_id")
......@@ -100,7 +100,7 @@ object app_list {
temp.show()
GmeiConfig.writeToJDBCTable(tempp, "device_id_contain", SaveMode.Append)
GmeiConfig.writeToJDBCTable(tempp, "device_id_coincidence", 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