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

统计icon数据

parent 487838f4
package com.gmei package com.gmei
import java.io.Serializable import java.io.Serializable
import java.util.Properties
import breeze.linalg.split import breeze.linalg.split
import com.gmei.WeafareStat.{defaultParams, parser} import com.gmei.WeafareStat.{defaultParams, parser}
...@@ -1022,7 +1023,7 @@ object app_list_yunying { ...@@ -1022,7 +1023,7 @@ object app_list_yunying {
object test_data { object icon_data {
Logger.getLogger("org.apache.spark").setLevel(Level.WARN) Logger.getLogger("org.apache.spark").setLevel(Level.WARN)
Logger.getLogger("org.apache.eclipse.jetty.server").setLevel(Level.OFF) Logger.getLogger("org.apache.eclipse.jetty.server").setLevel(Level.OFF)
...@@ -1065,38 +1066,20 @@ object test_data { ...@@ -1065,38 +1066,20 @@ object test_data {
//println(param.date) //println(param.date)
val partition_date = stat_date.replace("-","") val partition_date = stat_date.replace("-","")
val properties = new Properties()
properties.put("user", "doris")
properties.put("password", "o5gbA27hXHHm")
// 百科点击数据
val wiki_click=sc.sql( val device_id=sc
s""" .read
|SELECT cl_id as device_id,params['business_id'] as wiki_id .option("driver", "com.mysql.jdbc.Driver")
|from online.tl_hdfs_maidian_view .jdbc("jdbc:mysql://172.16.30.136/doris_prod","device_icon_queue",properties)
|where partition_date='${partition_date}' .select("device_id")
|and (action='Search_result_wiki_click_item' or action='search_result_click_infomation_item' or action='search_result_wiki_click_recommend_wiki') device_id.show()
""".stripMargin
)
wiki_click.createOrReplaceTempView("wiki_click")
val wiki_tag=sc.sql( device_id.createTempView("device_id")
s"""
|SELECT item_id,tag_id
|from online.tl_hdfs_wiki_item_tag_view
|where partition_date='${partition_date}'
""".stripMargin
)
wiki_tag.createOrReplaceTempView("wiki_tag")
val wiki_device_tag=sc.sql(
s"""
|SELECT a.device_id,b.tag_id
|from wiki_click a
|left join wiki_tag b
|on a.wiki_id=b.item_id
|where b.tag_id is not null
""".stripMargin
)
wiki_device_tag.createOrReplaceTempView("wiki_device_tag")
} }
......
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