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
3437e476
Commit
3437e476
authored
Jun 05, 2019
by
王志伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
统计app
parent
2bf4c078
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
11 deletions
+27
-11
app_list.scala
eda/feededa/src/main/scala/com/gmei/app_list.scala
+2
-1
data_feed_exposure_precise.scala
.../src/main/scala/com/gmei/data_feed_exposure_precise.scala
+25
-10
No files found.
eda/feededa/src/main/scala/com/gmei/app_list.scala
View file @
3437e476
...
...
@@ -80,7 +80,8 @@ object app_list {
| ,'TF-toufang5','tf-toufang1','tf-toufang2','tf-toufang3','tf-toufang4','tf-toufang5','benzhan','promotion_aso100'
| ,'promotion_qianka','promotion_xiaoyu','promotion_dianru','promotion_malioaso','promotion_malioaso-shequ'
| ,'promotion_shike','promotion_julang_jl03','','unknown','promotion_zuimei')
|and partition_date ='${partition_date}'
|and partition_date >'20190430'
|and partition_date <'20190601'
"""
.
stripMargin
)
device_id_newUser
.
createOrReplaceTempView
(
"device_id_new"
)
...
...
eda/feededa/src/main/scala/com/gmei/data_feed_exposure_precise.scala
View file @
3437e476
...
...
@@ -893,8 +893,8 @@ object app_list_yunying {
val
device_id_newUser
=
sc
.
sql
(
s
"""
|select distinct(device_id) as device_id
|from online.ml_device_
day
_active_status
|where
(active_type = '1' or active_type='2')
|from online.ml_device_
month
_active_status
|where
active_type != '4'
|and first_channel_source_type not in ('yqxiu1','yqxiu2','yqxiu3','yqxiu4','yqxiu5','mxyc1','mxyc2','mxyc3'
| ,'wanpu','jinshan','jx','maimai','zhuoyi','huatian','suopingjingling','mocha','mizhe','meika','lamabang'
| ,'js-az1','js-az2','js-az3','js-az4','js-az5','jfq-az1','jfq-az2','jfq-az3','jfq-az4','jfq-az5','toufang1'
...
...
@@ -902,26 +902,41 @@ object app_list_yunying {
| ,'TF-toufang5','tf-toufang1','tf-toufang2','tf-toufang3','tf-toufang4','tf-toufang5','benzhan','promotion_aso100'
| ,'promotion_qianka','promotion_xiaoyu','promotion_dianru','promotion_malioaso','promotion_malioaso-shequ'
| ,'promotion_shike','promotion_julang_jl03','','unknown','promotion_zuimei')
|and partition_date ='
${partition_date}
'
|and partition_date ='
20190531
'
"""
.
stripMargin
)
device_id_newUser
.
createOrReplaceTempView
(
"device_id_new"
)
val
app_list
=
sc
.
sql
(
s
"""
|select '${stat_date}' as stat_date,channel,a.params['installed_app_info'] as app_list
|from online.tl_hdfs_maidian_view a
|select *
|from
|(select cl_id,
| time_stamp,
| params['installed_app_info'] as app_list,
| row_number() over (partition by cl_id order by time_stamp desc) as pk
| from online.tl_hdfs_maidian_view
|where partition_date ='20190522'
| and action = 'user_installed_all_app_info'
| and cl_type='android'
| ) a
|where a.pk = 1
"""
.
stripMargin
)
app_list
.
createOrReplaceTempView
(
"app_list"
)
val
final_app_list
=
sc
.
sql
(
s
"""
|select *
|from
|app_list a
|inner join device_id_new b
|on a.cl_id=b.device_id
|where a.partition_date ='${partition_date}'
|and a.action='user_installed_all_app_info'
|and a.cl_type='android'
"""
.
stripMargin
)
app_list
.
show
()
val
result1
=
app_list
val
result1
=
final_
app_list
result1
.
show
()
println
(
"开始写入"
)
...
...
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