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
53c0bf7d
Commit
53c0bf7d
authored
Dec 18, 2018
by
高雅喆
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of git.wanmeizhensuo.com:ML/ffm-baseline
git commit -m "filter imp data where count > 1"
parents
0217ad56
8428d2c0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
22 deletions
+43
-22
temp_analysis.scala
eda/feededa/src/main/scala/com/gmei/temp_analysis.scala
+42
-22
testt.scala
eda/feededa/src/main/scala/com/gmei/testt.scala
+1
-0
No files found.
eda/feededa/src/main/scala/com/gmei/temp_analysis.scala
View file @
53c0bf7d
...
...
@@ -76,23 +76,23 @@ object temp_analysis {
agency_id
.
createOrReplaceTempView
(
"agency_id"
)
//每日新用户
val
device_id_newUser
=
sc
.
sql
(
s
"""
|select distinct(device_id) as device_id
|from online.ml_device_day_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'
| ,'toufang2','toufang3','toufang4','toufang5','toufang6','TF-toufang1','TF-toufang2','TF-toufang3','TF-toufang4'
| ,'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')
|and partition_date ='${partition_date}'
"""
.
stripMargin
)
device_id_newUser
.
createOrReplaceTempView
(
"device_id_new"
)
//
//每日新用户
//
val device_id_newUser = sc.sql(
//
s"""
//
|select distinct(device_id) as device_id
//
|from online.ml_device_day_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'
//
| ,'toufang2','toufang3','toufang4','toufang5','toufang6','TF-toufang1','TF-toufang2','TF-toufang3','TF-toufang4'
//
| ,'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')
//
|and partition_date ='${partition_date}'
//
""".stripMargin
//
)
//
device_id_newUser.createOrReplaceTempView("device_id_new")
val
blacklist_id
=
sc
.
sql
(
s
"""
...
...
@@ -108,16 +108,34 @@ object temp_analysis {
|from agency_id
|UNION ALL
|select device_id
|from device_id_new
|UNION ALL
|select device_id
|from blacklist_id
"""
.
stripMargin
)
final_id
.
createOrReplaceTempView
(
"final_id"
)
val
diary_clk_all
=
sc
.
sql
(
s
"""
|select ov.partition_date,count(ov.cl_id) as clk_num,count(distinct(ov.cl_id)),count(ov.cl_id)/count(distinct(ov.cl_id))
|from online.tl_hdfs_maidian_view ov left join final_id
|on ov.cl_id = final_id.device_id
|where ov.action = "page_view"
|and params['page_name']="diary_detail"
|and ov.cl_id != "NULL"
|and ov.partition_date >='20181201'
|and final_id.device_id is null
|group by ov.partition_date
|order by ov.partition_date
"""
.
stripMargin
)
diary_clk_all
.
show
(
80
)
//日记本点击
val
referrer
=
List
(
"all_case_service_comment"
,
"all_cases"
,
"diary_detail"
,
"diary_list"
,
"diary_listof_related_service"
,
val
referrer
=
List
(
"about_me_message_list"
,
"all_case_service_comment"
,
"all_cases"
,
"diary_detail"
,
"diary_list"
,
"diary_listof_related_service"
,
"answer_detail"
,
"community_home"
,
"conversation_detail"
,
"create_diary_title"
,
"diary_listof_related_service"
,
"doctor_all_cases"
,
"hospital_all_cases"
,
"my_favor"
,
"my_order"
,
"order_detail"
,
"personal_store_diary_list"
,
"received_votes"
,
"topic_detail"
,
"welfare_detail"
,
"welfare_list"
,
"welfare_special"
,
"wiki_detail"
,
"zone_detail"
,
"expert_detail"
,
"free_activity_detail"
,
"home"
,
"message_home"
,
"my_diary"
,
"organization_detail"
,
"other_homepage"
,
"question_detail"
,
"search_result_diary"
,
"search_result_more"
,
"welfare_detail"
,
"zone_v3"
)
for
(
a
<-
referrer
){
...
...
@@ -130,7 +148,7 @@ object temp_analysis {
|and params['page_name']="diary_detail"
|and params['referrer']='${a}'
|and ov.cl_id != "NULL"
|and ov.partition_date >='20181
1
01'
|and ov.partition_date >='20181
2
01'
|and final_id.device_id is null
|group by ov.partition_date
|order by ov.partition_date
...
...
@@ -141,6 +159,8 @@ object temp_analysis {
}
//5.登录人数
val
log_device_temp
=
sc
.
sql
(
s
"""
...
...
eda/feededa/src/main/scala/com/gmei/testt.scala
View file @
53c0bf7d
...
...
@@ -399,3 +399,4 @@ object testt {
}
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