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
ebfd7765
Commit
ebfd7765
authored
Feb 13, 2019
by
张彦钊
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of git.wanmeizhensuo.com:ML/ffm-baseline
change sql
parents
60bc2bf8
eb0339ca
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
7 deletions
+47
-7
testt.scala
eda/feededa/src/main/scala/com/gmei/testt.scala
+47
-7
No files found.
eda/feededa/src/main/scala/com/gmei/testt.scala
View file @
ebfd7765
...
@@ -545,6 +545,19 @@ object diary_clk_card {
...
@@ -545,6 +545,19 @@ object diary_clk_card {
"""
.
stripMargin
"""
.
stripMargin
)
)
val
imp_count_oldUser_Contrast_precise
=
sc
.
sql
(
s
"""
|select '${stat_date}' as stat_date, count(cid_id) as imp_count_oldUser_Contrast_precise
|from data_feed_exposure_precise je inner join device_id_old
|on je.device_id = device_id_old.device_id
|where je.cid_type = 'diary'
|and je.device_id regexp'1$$'
|and je.device_id not in (select device_id from blacklist)
|and je.stat_date ='${stat_date}'
"""
.
stripMargin
)
val
clk_count_oldUser_all_a
=
sc
.
sql
(
val
clk_count_oldUser_all_a
=
sc
.
sql
(
s
"""
s
"""
|select '${stat_date}' as stat_date, count(ot.cl_id) as clk_count_oldUser_all_a
|select '${stat_date}' as stat_date, count(ot.cl_id) as clk_count_oldUser_all_a
...
@@ -581,6 +594,17 @@ object diary_clk_card {
...
@@ -581,6 +594,17 @@ object diary_clk_card {
"""
.
stripMargin
"""
.
stripMargin
)
)
val
imp_count_oldUser_all_precise
=
sc
.
sql
(
s
"""
|select '${stat_date}' as stat_date, count(cid_id) as imp_count_oldUser_all_precise
|from data_feed_exposure_precise je inner join device_id_old
|on je.device_id = device_id_old.device_id
|where je.cid_type = 'diary'
|and je.device_id not in (select device_id from blacklist)
|and je.stat_date ='${stat_date}'
"""
.
stripMargin
)
//统计新用户ctr
//统计新用户ctr
val
device_id_newUser
=
sc
.
sql
(
val
device_id_newUser
=
sc
.
sql
(
s
"""
s
"""
...
@@ -640,6 +664,18 @@ object diary_clk_card {
...
@@ -640,6 +664,18 @@ object diary_clk_card {
"""
.
stripMargin
"""
.
stripMargin
)
)
val
imp_count_newUser_Contrast_precise
=
sc
.
sql
(
s
"""
|select '${stat_date}' as stat_date, count(cid_id) as imp_count_newUser_Contrast_precise
|from data_feed_exposure_precise je inner join device_id_new
|on je.device_id = device_id_new.device_id
|where je.cid_type = 'diary'
|and je.device_id regexp'1$$'
|and je.device_id not in (select device_id from blacklist)
|and je.stat_date ='${stat_date}'
"""
.
stripMargin
)
val
clk_count_newUser_all_a
=
sc
.
sql
(
val
clk_count_newUser_all_a
=
sc
.
sql
(
s
"""
s
"""
...
@@ -677,6 +713,17 @@ object diary_clk_card {
...
@@ -677,6 +713,17 @@ object diary_clk_card {
"""
.
stripMargin
"""
.
stripMargin
)
)
val
imp_count_newUser_all_precise
=
sc
.
sql
(
s
"""
|select '${stat_date}' as stat_date, count(cid_id) as imp_count_newUser_all_precise
|from data_feed_exposure_precise je inner join device_id_new
|on je.device_id = device_id_new.device_id
|where je.cid_type = 'diary'
|and je.device_id not in (select device_id from blacklist)
|and je.stat_date ='${stat_date}'
"""
.
stripMargin
)
val
result1
=
clk_count_oldUser_Contrast_a
.
join
(
clk_count_oldUser_Contrast_b
,
"stat_date"
)
val
result1
=
clk_count_oldUser_Contrast_a
.
join
(
clk_count_oldUser_Contrast_b
,
"stat_date"
)
.
join
(
imp_count_oldUser_Contrast
,
"stat_date"
)
.
join
(
imp_count_oldUser_Contrast
,
"stat_date"
)
...
@@ -700,10 +747,3 @@ object diary_clk_card {
...
@@ -700,10 +747,3 @@ object diary_clk_card {
}
}
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