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
caee6740
Commit
caee6740
authored
Dec 28, 2018
by
王志伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
smart_rank 相关的统计指标
parent
90482418
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
temp_analysis.scala
eda/feededa/src/main/scala/com/gmei/temp_analysis.scala
+13
-13
No files found.
eda/feededa/src/main/scala/com/gmei/temp_analysis.scala
View file @
caee6740
...
@@ -648,7 +648,7 @@ object smart_rank_count {
...
@@ -648,7 +648,7 @@ object smart_rank_count {
|select a.device_id,a.device_city,a.meigou_id,b.meigou_city
|select a.device_id,a.device_city,a.meigou_id,b.meigou_city
|from user_city_meigou_view a
|from user_city_meigou_view a
|left join meigou_city b
|left join meigou_city b
|on a.meigou_id
=
b.meigou_id
|on a.meigou_id
=
b.meigou_id
"""
.
stripMargin
"""
.
stripMargin
)
)
meigou_pv_tongcheng
.
createOrReplaceTempView
(
"meigou_pv_tongcheng"
)
meigou_pv_tongcheng
.
createOrReplaceTempView
(
"meigou_pv_tongcheng"
)
...
@@ -657,7 +657,7 @@ object smart_rank_count {
...
@@ -657,7 +657,7 @@ object smart_rank_count {
s
"""
s
"""
|select meigou_city,count(device_id) as meigou_pv,count(distinct(device_id)) as meigou_device_num
|select meigou_city,count(device_id) as meigou_pv,count(distinct(device_id)) as meigou_device_num
|from meigou_pv_tongcheng
|from meigou_pv_tongcheng
|where device_city
=
meigou_city
|where device_city
=
meigou_city
|group by meigou_city
|group by meigou_city
"""
.
stripMargin
"""
.
stripMargin
)
)
...
@@ -701,17 +701,17 @@ object smart_rank_count {
...
@@ -701,17 +701,17 @@ object smart_rank_count {
//开始计算每个地区每月新增设备
//开始计算每个地区每月新增设备
val
device_new_count
=
sc
.
sql
(
//
val device_new_count = sc.sql(
s
"""
//
s"""
|select first_city,count(distinct(device_id))
//
|select first_city,count(distinct(device_id))
|from online.ml_device_day_active_status
//
|from online.ml_device_day_active_status
|where active_type != '4'
//
|where active_type != '4'
|and partition_date >='20181201'
//
|and partition_date >='20181201'
|group by first_city
//
|group by first_city
|order by first_city
//
|order by first_city
"""
.
stripMargin
//
""".stripMargin
)
//
)
device_new_count
.
show
()
//
device_new_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