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
a5973efc
Commit
a5973efc
authored
Mar 12, 2019
by
王志伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
统计复购用户日记本
parent
ea0b5c83
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
27 deletions
+27
-27
temp_analysis.scala
eda/feededa/src/main/scala/com/gmei/temp_analysis.scala
+27
-27
No files found.
eda/feededa/src/main/scala/com/gmei/temp_analysis.scala
View file @
a5973efc
...
...
@@ -733,7 +733,7 @@ object smart_rank_count {
//话题相关问题统计
object
questio
n_count
{
object
bug_agai
n_count
{
Logger
.
getLogger
(
"org.apache.spark"
).
setLevel
(
Level
.
WARN
)
Logger
.
getLogger
(
"org.apache.eclipse.jetty.server"
).
setLevel
(
Level
.
OFF
)
...
...
@@ -774,7 +774,7 @@ object question_count {
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
"
)
ti
.
tidbMapTable
(
dbName
=
"
eagle"
,
tableName
=
"src_mimas_prod_api_diary
"
)
import
sc.implicits._
...
...
@@ -782,39 +782,39 @@ object question_count {
//println(param.date)
val
partition_date
=
stat_date
.
replace
(
"-"
,
""
)
val
agency
_id
=
sc
.
sql
(
val
spam_order
_id
=
sc
.
sql
(
s
"""
|SELECT DISTINCT(cl_id) as device_id
|FROM online.ml_hospital_spam_pv_day
|WHERE partition_date >= '20180402'
|AND partition_date <= '20190117'
|AND pv_ratio >= 0.95
|UNION ALL
|SELECT DISTINCT(cl_id) as device_id
|FROM online.ml_hospital_spam_pv_month
|WHERE partition_date >= '20171101'
|AND partition_date <= '20190117'
|AND pv_ratio >= 0.95
|select distinct(order_id)
|from mining.ml_order_spam_recognize
|where partition_date='${partition_date}'
"""
.
stripMargin
)
agency_id
.
createOrReplaceTempView
(
"agency
_id"
)
spam_order_id
.
createOrReplaceTempView
(
"spam_order
_id"
)
val
question_count
=
sc
.
sql
(
val
meigou_id_order
=
sc
.
sql
(
s
"""
|SELECT partition_date,count(cl_id)
|FROM online.tl_hdfs_maidian_view ov left join agency_id
|on ov.cl_id = agency_id.device_id
|WHERE ov.partition_date >= '20190101'
|and ov.action='community_home_click_feed_card'
|and ov.params["card_type"]="问题"
|and ov.cl_id not in (select device_id from blacklist)
|and agency_id.device_id is null
|GROUP BY ov.partition_date
|order by ov.partition_date
|select a.user_id from (select od.user_id,count(od.order_id) as order_num
|from online.ml_meigou_order_detail od left join spam_order_id
|on od.order_id=spam_order_id.order_id
|where od.status='2'
|and od.partition_date='${partition_date}'
|and spam_order_id.order_id is null
|group by od.user_id
|order by order_num) a
|where a.order_num>=2
"""
.
stripMargin
)
meigou_id_order
.
createOrReplaceTempView
(
"meigou_id_order"
)
question_count
.
show
(
30
)
val
diary_id
=
sc
.
sql
(
s
"""
|select sd.id,sd.user_id
|from src_mimas_prod_api_diary sd inner join meigou_id_order
|on sd.user_id=meigou_id_order.user_id
|where sd.partition_date='${partition_date}'
"""
.
stripMargin
)
diary_id
.
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