Commit 0fd944d6 authored by 王志伟's avatar 王志伟

新统计

parent 5975c9bb
......@@ -65,40 +65,37 @@ object testt {
// )
//// agency_id.show()
// agency_id.createOrReplaceTempView("agency_id")
val a = Array("personal_store_diary_list","question_detail","received_votes","search_result","search_result_diary","search_result_more"
,"search_result_welfare","service_all_cases_service_comment","spell_special_list","topic_detail","welfare_detail","welfare_list","welfare_special","wiki_detail"
,"zone_detail","zone_v3")
// for (i <- 0 until a.length){
// val diary_pv = sc.sql(
// s"""
// |select partition_date,count(cl_id)
// |from online.tl_hdfs_maidian_view
// |where action="page_view"
// |and params["page_name"]="diary_detail"
// |and params["referrer"]='${a(i)}'
// |and partition_date >='20181120'
// |GROUP BY partition_date
// |order by partition_date
// """.stripMargin
// )
// println("该来源的数据为:"+ a(i))
// diary_pv.show()
// }
val diary_pv = sc.sql(
s"""
|select partition_date,count(cl_id)
|from online.tl_hdfs_maidian_view
|where action ='on_click_diary_card'
|and params["page_name"]="home"
|and params["tab_name"]="精选"
|and partition_date >='20181120'
|GROUP BY partition_date
|order by partition_date
val a = Array("answer_detail","article_detail","diary_detail","home_page","question_detail","search_content","search_diary")
for (i <- 0 until a.length){
val diary_pv = sc.sql(
s"""
|select partition_date,count(cl_id)
|from online.ml_community_exposure_detail
|where business_type ='diary'
|and partition_date >='20181120'
|and event='${a(i)}'
|GROUP BY partition_date
|order by partition_date
""".stripMargin
)
diary_pv.show()
)
println("该来源的数据为:"+ a(i))
diary_pv.show()
}
// val diary_pv = sc.sql(
// s"""
// |select partition_date,count(cl_id)
// |from online.tl_hdfs_maidian_view
// |where action ='on_click_diary_card'
// |and params["page_name"]="home"
// |and params["tab_name"]="精选"
// |and partition_date >='20181120'
// |GROUP BY partition_date
// |order by partition_date
// """.stripMargin
// )
// diary_pv.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