Commit 95dadcfb authored by 王志伟's avatar 王志伟

repair bug

parent 306e71ca
......@@ -55,7 +55,7 @@ object testt {
diary_id.show()
diary_id.createOrReplaceTempView("diary_id")
val clk_count = sc.sql(
val view_count = sc.sql(
s"""
|select params["business_id"] as diary_id,sum(params["out"]-params["in"]) as dur_time,count(cl_id) as num_clk
|from online.tl_hdfs_maidian_view
......@@ -65,9 +65,18 @@ object testt {
|group by diary_id
""".stripMargin
)
view_count.createOrReplaceTempView("temp")
val avg = sc.sql(
s"""
|select diary_id,dur_time,num_clk,dur_time/num_clk as avg
|from temp
|group by avg
""".stripMargin
)
val result = clk_count
val result = avg
result.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