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

add video count

parent 63818ee5
......@@ -119,9 +119,18 @@ object WeafareStat {
)
txt_clk_count.show()
val video_count = sc.sql(
s"""
|select '${stat_date}' as stat_date,count(distinc(cid)) as video_count
|from diary_video where stat_date='${stat_date}'
""".stripMargin
)
video_count.show()
val result = video_clk_count.join(video_meigou_count,"stat_date")
.join(txt_clk_count,"stat_date")
.join(txt_meigou_count,"stat_date")
.join(video_count,"stat_date")
val result1 = result.withColumn("video_rate",result.col("video_meigou_count")/result.col("video_clk_count"))
val result2 = result1.withColumn("txt_rate",result.col("txt_meigou_count")/result.col("txt_clk_count"))
......
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