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
11d8023e
Commit
11d8023e
authored
Nov 20, 2018
by
王志伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新统计需求
parent
f0834019
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
5 deletions
+30
-5
app_list.scala
eda/feededa/src/main/scala/com/gmei/app_list.scala
+30
-5
No files found.
eda/feededa/src/main/scala/com/gmei/app_list.scala
View file @
11d8023e
...
...
@@ -154,7 +154,7 @@ object coincidence_xinyang {
ti
.
tidbMapTable
(
dbName
=
"jerry_prod"
,
tableName
=
"blacklist"
)
ti
.
tidbMapTable
(
dbName
=
"jerry_test"
,
tableName
=
"bl_device_list"
)
ti
.
tidbMapTable
(
dbName
=
"jerry_prod"
,
tableName
=
"data_feed_exposure"
)
ti
.
tidbMapTable
(
dbName
=
"jerry_prod"
,
tableName
=
"device_id_co
ntain
"
)
ti
.
tidbMapTable
(
dbName
=
"jerry_prod"
,
tableName
=
"device_id_co
incidence
"
)
//println(param.date)
...
...
@@ -200,7 +200,7 @@ object coincidence_xinyang {
val
yesterday_coincidence
=
sc
.
sql
(
s
"""
|select '${data}' as stat_date,count(distinct(device_id)) as yesterday_coincidence_num
|from device_id_co
ntain
|from device_id_co
incidence
|where stat_date = '${data}'
"""
.
stripMargin
)
...
...
@@ -220,7 +220,7 @@ object coincidence_xinyang {
val
week_coincidence
=
sc
.
sql
(
s
"""
|select '${data}' as stat_date,count(distinct(device_id)) as week_coincidence_num
|from device_id_co
ntain
|from device_id_co
incidence
|where stat_date > '${week_day}'
"""
.
stripMargin
)
...
...
@@ -240,7 +240,7 @@ object coincidence_xinyang {
val
month_coincidence
=
sc
.
sql
(
s
"""
|select '${data}' as stat_date,count(distinct(device_id)) as month_coincidence_num
|from device_id_co
ntain
|from device_id_co
incidence
|where stat_date > '${month_day}'
"""
.
stripMargin
)
...
...
@@ -260,7 +260,32 @@ object coincidence_xinyang {
.
join
(
month_coincidence
,
"stat_date"
)
.
join
(
month_expoure_num
,
"stat_date"
)
GmeiConfig
.
writeToJDBCTable
(
result
,
"coincidence_xinyang"
,
SaveMode
.
Append
)
//GmeiConfig.writeToJDBCTable(result, "coincidence_xinyang", SaveMode.Append)
//截止目前获得的与新氧重合的用户数计算美购情况
val
meigou_coincidence_num
=
sc
.
sql
(
s
"""
|select count(service_id) as meigou_coincidence_num
|from online.ml_meigou_order_detail
|where partition_date = '20181118'
|and pay_time is not null
|and pay_time >= '2017-11-18'
|and device_id in (select distinct(device_id) from device_id_coincidence)
"""
.
stripMargin
)
meigou_coincidence_num
.
show
()
val
meigou_pay_device
=
sc
.
sql
(
s
"""
|select count(DISTINCT(device_id)) as meigou_pay_device
|from online.ml_meigou_order_detail
|where partition_date = '20181118'
|and pay_time is not null
|and pay_time >= '2017-11-18'
|and device_id in (select distinct(device_id) from device_id_coincidence)
"""
.
stripMargin
)
meigou_pay_device
.
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