Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
ffm-baseline
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ML
ffm-baseline
Commits
59ed61b9
Commit
59ed61b9
authored
Dec 28, 2018
by
王志伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
smart_rank 相关的统计指标
parent
b05d3de5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
19 deletions
+30
-19
temp_analysis.scala
eda/feededa/src/main/scala/com/gmei/temp_analysis.scala
+30
-19
No files found.
eda/feededa/src/main/scala/com/gmei/temp_analysis.scala
View file @
59ed61b9
...
...
@@ -663,26 +663,37 @@ object smart_rank_count {
//开始计算咨询
// val zixun_meigou_view = sc.sql(
// s"""
// |select cl_id as device_id,city_id as device_city,params['service_id'] as meigou_id
// |from online.tl_hdfs_maidian_view
// |where partition_date >= '20181201'
// |and action = 'welfare_detail_click_message'
// """.stripMargin
// )
// zixun_meigou_view.show(80)
// zixun_meigou_view.createOrReplaceTempView("zixun_meigou_view")
val
zixun_meigou_view
=
sc
.
sql
(
s
"""
|select cl_id as device_id,city_id as device_city,params['service_id'] as meigou_id
|from online.tl_hdfs_maidian_view
|where partition_date >= '20181201'
|and action = 'welfare_detail_click_message'
"""
.
stripMargin
)
zixun_meigou_view
.
createOrReplaceTempView
(
"zixun_meigou_view"
)
// val zixun_meigou_tongcheng = sc.sql(
// s"""
// |select a.device_id,a.device_city,a.meigou_id,b.meigou_city
// |from zixun_meigou_view a
// |left join meigou_city b
// |on a.meigou_id=b.meigou_id
// """.stripMargin
// )
// zixun_meigou_tongcheng.show(80)
val
zixun_meigou_tongcheng
=
sc
.
sql
(
s
"""
|select a.device_id,a.device_city,a.meigou_id,b.meigou_city
|from zixun_meigou_view a
|left join meigou_city b
|on a.meigou_id=b.meigou_id
"""
.
stripMargin
)
zixun_meigou_tongcheng
.
createOrReplaceTempView
(
"zixun_meigou_tongcheng"
)
val
zixun_pv_count
=
sc
.
sql
(
s
"""
|select meigou_city,count(device_id) as meigou_pv,count(distinct(device_id)) as meigou_device_num
|from zixun_meigou_tongcheng
|where device_city=meigou_city
|group by meigou_city
"""
.
stripMargin
)
meigou_pv_count
.
show
()
//
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment