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
292079f7
Commit
292079f7
authored
Nov 21, 2018
by
王志伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改统计参数
parent
098f5ac3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
27 deletions
+15
-27
app_list.scala
eda/feededa/src/main/scala/com/gmei/app_list.scala
+15
-18
strategy_other.scala
eda/feededa/src/main/scala/com/gmei/strategy_other.scala
+0
-9
No files found.
eda/feededa/src/main/scala/com/gmei/app_list.scala
View file @
292079f7
...
...
@@ -151,11 +151,8 @@ object coincidence_xinyang {
val
sc
=
spark_env
.
_2
val
ti
=
new
TiContext
(
sc
)
ti
.
tidbMapTable
(
dbName
=
"jerry_prod"
,
tableName
=
"diary_video"
)
ti
.
tidbMapTable
(
dbName
=
"jerry_prod"
,
tableName
=
"data_feed_click"
)
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_coincidence"
)
...
...
@@ -204,7 +201,7 @@ object coincidence_xinyang {
|and cl_id not in (select device_id from bl_device_list)
|and cl_id not in (select device_id from blacklist)
"""
.
stripMargin
)
)
.
repartition
(
100
)
all_device_id
.
createOrReplaceTempView
(
"all_device_id"
)
...
...
@@ -217,7 +214,7 @@ object coincidence_xinyang {
|from device_id_coincidence
|where stat_date = '${data}'
"""
.
stripMargin
)
)
.
repartition
(
100
)
//2.获得应用列表的每日活跃总用户数
val
yesterday_expoure_num
=
sc
.
sql
(
s
"""
...
...
@@ -228,7 +225,7 @@ object coincidence_xinyang {
|and cl_id not in (select device_id from bl_device_list)
|and cl_id not in (select device_id from blacklist)
"""
.
stripMargin
)
)
.
repartition
(
100
)
//获取每周活跃用户中与新氧重合用户占比
...
...
@@ -240,7 +237,7 @@ object coincidence_xinyang {
|from device_id_coincidence
|where stat_date >= '${week_day}'
"""
.
stripMargin
)
)
.
repartition
(
100
)
//2.获得应用列表的每周活跃总用户
val
week_expoure_num
=
sc
.
sql
(
s
"""
...
...
@@ -251,7 +248,7 @@ object coincidence_xinyang {
|and cl_id not in (select device_id from bl_device_list)
|and cl_id not in (select device_id from blacklist)
"""
.
stripMargin
)
)
.
repartition
(
100
)
//获取每月活跃用户中与新氧用户重合用户占比
//1.0 每月活跃中与新氧用户重合用户数
...
...
@@ -262,7 +259,7 @@ object coincidence_xinyang {
|from device_id_coincidence
|where stat_date > '${month_day}'
"""
.
stripMargin
)
)
.
repartition
(
100
)
//2.0 获得应用列表的每月活跃总用户
val
month_expoure_num
=
sc
.
sql
(
s
"""
...
...
@@ -273,7 +270,7 @@ object coincidence_xinyang {
|and cl_id not in (select device_id from bl_device_list)
|and cl_id not in (select device_id from blacklist)
"""
.
stripMargin
)
)
.
repartition
(
100
)
val
result
=
yesterday_coincidence
.
join
(
yesterday_expoure_num
,
"stat_date"
)
.
join
(
week_coincidence
,
"stat_date"
)
...
...
@@ -294,7 +291,7 @@ object coincidence_xinyang {
|and pay_time >= '2017-11-18'
|and device_id in (select distinct(device_id) from device_id_coincidence)
"""
.
stripMargin
)
)
.
repartition
(
100
)
meigou_coincidence_num
.
show
()
...
...
@@ -308,7 +305,7 @@ object coincidence_xinyang {
|and pay_time >= '2017-11-18'
|and device_id in (select distinct(device_id) from device_id_coincidence)
"""
.
stripMargin
)
)
.
repartition
(
100
)
meigou_pay_device
.
show
()
//3.获得应用列表的用户的美购数
val
meigou_pay_all
=
sc
.
sql
(
...
...
@@ -320,7 +317,7 @@ object coincidence_xinyang {
|and pay_time is not null
|and pay_time >= '2017-11-18'
"""
.
stripMargin
)
)
.
repartition
(
100
)
meigou_pay_all
.
show
()
//4.获得应用列表用户进行美购的用户数
...
...
@@ -333,7 +330,7 @@ object coincidence_xinyang {
|and pay_time is not null
|and pay_time >= '2017-11-18'
"""
.
stripMargin
)
)
.
repartition
(
100
)
meigou_pay_device_all
.
show
()
//截止目前获得的与新氧重合的用户数咨询统计
...
...
@@ -345,7 +342,7 @@ object coincidence_xinyang {
|where partition_date >= '20180501'
|and action = 'welfare_detail_click_message'
"""
.
stripMargin
)
)
.
repartition
(
100
)
zixun_num_all
.
show
()
val
zixun_device_all
=
sc
.
sql
(
...
...
@@ -356,7 +353,7 @@ object coincidence_xinyang {
|where partition_date >= '20180501'
|and action = 'welfare_detail_click_message'
"""
.
stripMargin
)
)
.
repartition
(
100
)
zixun_device_all
.
show
()
val
zixun_num_co
=
sc
.
sql
(
...
...
@@ -367,7 +364,7 @@ object coincidence_xinyang {
|and action = 'welfare_detail_click_message'
|and cl_id in (select distinct(device_id) from device_id_coincidence)
"""
.
stripMargin
)
)
.
repartition
(
100
)
zixun_num_co
.
show
()
val
zixun_num_co_dis
=
sc
.
sql
(
...
...
@@ -378,7 +375,7 @@ object coincidence_xinyang {
|and action = 'welfare_detail_click_message'
|and cl_id in (select distinct(device_id) from device_id_coincidence)
"""
.
stripMargin
)
)
.
repartition
(
100
)
zixun_num_co_dis
.
show
()
...
...
eda/feededa/src/main/scala/com/gmei/strategy_other.scala
View file @
292079f7
...
...
@@ -222,15 +222,6 @@ object evaluation_indicator_ {
val
spark_env
=
GmeiConfig
.
getSparkSession
()
val
sc
=
spark_env
.
_2
val
ti
=
new
TiContext
(
sc
)
ti
.
tidbMapTable
(
dbName
=
"jerry_prod"
,
tableName
=
"diary_video"
)
ti
.
tidbMapTable
(
dbName
=
"jerry_prod"
,
tableName
=
"data_feed_click"
)
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
=
"merge_queue_table"
)
import
sc.implicits._
//val stat_date = GmeiConfig.getMinusNDate(1)
//println(param.date)
...
...
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