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
b69a40a8
Commit
b69a40a8
authored
Nov 22, 2018
by
王志伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
将应用列表添加到table
parent
37c7f1e8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
2 deletions
+32
-2
app_list.scala
eda/feededa/src/main/scala/com/gmei/app_list.scala
+32
-2
No files found.
eda/feededa/src/main/scala/com/gmei/app_list.scala
View file @
b69a40a8
...
...
@@ -93,7 +93,7 @@ object app_list {
//获取与新氧用户重合的用户device_id
val
app_list
=
sc
.
sql
(
/*
val app_list = sc.sql(
s"""
|select distinct(cl_id) as device_id, user_id as user_id, params['installed_app_info'] as app_list,channel
|from online.tl_hdfs_maidian_view ov left join agency_id
...
...
@@ -139,7 +139,37 @@ object app_list {
)
val tempp_list=app_list_all.withColumn("stat_date",addCol(app_list_all("device_id")))
GmeiConfig
.
writeToJDBCTable
(
tempp_list
,
"device_id_applist"
,
SaveMode
.
Append
)
GmeiConfig.writeToJDBCTable(tempp_list, "device_id_applist", SaveMode.Append) */
//在更美有消费的用户列表
val
device_id_meigou
=
sc
.
sql
(
s
"""
|select DISTINCT(od.device_id) as device_id
|from online.ml_meigou_order_detail od left join agency_id
|on od.device_id = agency_id.device_id
|where od.partition_date = '20181118'
|and od.pay_time is not null
|and od.pay_time >= '2017-11-18'
|and agency_id.device_id is null
|and od.device_id not in (select distinct(device_id) from blacklist)
"""
.
stripMargin
)
device_id_meigou
.
createOrReplaceTempView
(
"device_id_meigou"
)
val
app_list_meigou
=
sc
.
sql
(
s
"""
|select distinct(ov.cl_id) as device_id, user_id as user_id,params['installed_app_info'] as app_list,channel
|from online.tl_hdfs_maidian_view ov left join device_id_meigou
|on ov.cl_id = device_id_meigou.device_id
|where ov.action="user_installed_all_app_info"
|and agency_id.device_id is not null
|and ov.partition_date = '${partition_date}'
"""
.
stripMargin
)
val
applist_meigou
=
app_list_meigou
.
withColumn
(
"stat_date"
,
addCol
(
app_list_meigou
(
"device_id"
)))
GmeiConfig
.
writeToJDBCTable
(
applist_meigou
,
"device_id_meigou"
,
SaveMode
.
Append
)
}
...
...
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