Commit 25608d85 authored by 王志伟's avatar 王志伟

统计like项目

parent 0323e42d
......@@ -8,6 +8,8 @@ import org.apache.log4j.{Level, Logger}
import scopt.OptionParser
import com.gmei.lib.AbstractParams
import java.io._
import scala.util.parsing.json._
object temp_analysis {
......@@ -557,14 +559,49 @@ object alpha_ctr {
val click_count_recommend = sc.sql(
s"""
|select mc.stat_date,mc.meigou_city,mc.meigou_pv,mc.meigou_device_num,zc.meigou_zixun,zc.meigou_zixun_device_num,dc.new_device_month
|from meigou_pv_count mc
|left join zixun_pv_count zc on mc.meigou_city = zc.meigou_city
|left join device_new_count dc on dc.first_city=mc.meigou_city
|select '${stat_date}' as stat_date,count(*)
|from bl.bl_alpha_et_mg_maidianlog_inc_d
|where params['tab_name']='recommend'
|and params['page_name']='home'
|and type='on_click_feed_topic_card'
|and partition_day='${partition_date}'
""".stripMargin
)
click_count_recommend.show()
val click_count_focus = sc.sql(
s"""
|select '${stat_date}' as stat_date,count(*)
|from bl.bl_alpha_et_mg_maidianlog_inc_d
|where params['tab_name']='focus'
|and params['page_name']='home'
|and type='on_click_feed_topic_card'
|and partition_day='${partition_date}'
""".stripMargin
)
click_count_focus.show()
val expoure_count_recommend = sc.sql(
s"""
|select params['exposure_cards'] as exposure_cards
|from bl.bl_alpha_et_mg_maidianlog_inc_d
|where params['tab_name'] = 'recommend'
|and params['page_name'] = 'home'
|and type = 'page_precise_exposure'
|and partition_day='${partition_date}'
""".stripMargin
)
val jsonS=expoure_count_recommend.rdd.map(row =>{
val s = row.getAs[List[String]]("exposure_cards")
println(s.length)
})
GmeiConfig.writeToJDBCTable(click_count_recommend, "smart_rank_count", SaveMode.Append)
......
......@@ -515,8 +515,8 @@ object GetHiveSearchData {
ti.tidbMapTable(dbName = "jerry_prod", tableName = "merge_queue_table")
val stat_date = GmeiConfig.getMinusNDate(1)
// val stat_date = param.date
// val stat_date = GmeiConfig.getMinusNDate(1)
val stat_date = param.date
val partition_date = stat_date.replace("-","")
......
......@@ -454,8 +454,8 @@ object diary_clk_card {
ti.tidbMapTable(dbName = "jerry_prod", tableName = "data_feed_exposure")
ti.tidbMapTable(dbName = "jerry_prod", tableName = "data_feed_exposure_precise")
// val stat_date = GmeiConfig.getMinusNDate(1)
val stat_date=param.date
val stat_date = GmeiConfig.getMinusNDate(1)
// val stat_date=param.date
val partition_date = stat_date.replace("-","")
//机构id
val blacklist = sc.sql(
......
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