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
31e1f13c
Commit
31e1f13c
authored
Oct 30, 2018
by
王志伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fix
parent
1515ac81
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
18 deletions
+22
-18
strategy_clk_imp_oldUser.scala
...da/src/main/scala/com/gmei/strategy_clk_imp_oldUser.scala
+22
-18
No files found.
eda/feededa/src/main/scala/com/gmei/strategy_clk_imp_oldUser.scala
View file @
31e1f13c
...
@@ -41,23 +41,7 @@ object strategy_clk_imp_oldUser {
...
@@ -41,23 +41,7 @@ object strategy_clk_imp_oldUser {
)
)
}
}
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
parser
.
parse
(
args
,
defaultParams
).
map
{
param
=>
GmeiConfig
.
setup
(
param
.
env
)
val
spark_env
=
GmeiConfig
.
getSparkSession
()
val
sc
=
spark_env
.
_2
val
ti
=
new
TiContext
(
sc
)
ti
.
tidbMapTable
(
dbName
=
"jerry_prod"
,
tableName
=
"diary_video"
)
ti
.
tidbMapTable
(
dbName
=
"jerry_prod"
,
tableName
=
"data_feed_click"
)
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"
)
import
sc.implicits._
// val stat_date = GmeiConfig.getMinusNDate(1)
//println(param.date)
//获得时间array
//获得时间array
def
get_date
()
:
ArrayBuffer
[
String
]
={
def
get_date
()
:
ArrayBuffer
[
String
]
={
val
startTime
=
"2018-10-07"
val
startTime
=
"2018-10-07"
...
@@ -74,13 +58,32 @@ object strategy_clk_imp_oldUser {
...
@@ -74,13 +58,32 @@ object strategy_clk_imp_oldUser {
calendar
.
add
(
dateFiled
,
1
)
calendar
.
add
(
dateFiled
,
1
)
beginDate
=
calendar
.
getTime
beginDate
=
calendar
.
getTime
}
}
//
println(dateArray)
//
println(dateArray)
dateArray
dateArray
}
}
def
main
(
args
:
Array
[
String
])
:
Unit
=
{
parser
.
parse
(
args
,
defaultParams
).
map
{
param
=>
GmeiConfig
.
setup
(
param
.
env
)
val
spark_env
=
GmeiConfig
.
getSparkSession
()
val
sc
=
spark_env
.
_2
val
ti
=
new
TiContext
(
sc
)
ti
.
tidbMapTable
(
dbName
=
"jerry_prod"
,
tableName
=
"diary_video"
)
ti
.
tidbMapTable
(
dbName
=
"jerry_prod"
,
tableName
=
"data_feed_click"
)
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"
)
import
sc.implicits._
// val stat_date = GmeiConfig.getMinusNDate(1)
//println(param.date)
val
date_array
=
get_date
()
val
date_array
=
get_date
()
for
(
elem
<-
date_array
)
{
for
(
elem
<-
date_array
)
{
val
partition_date
=
elem
.
replace
(
"-"
,
""
)
val
partition_date
=
elem
.
replace
(
"-"
,
""
)
println
(
partition_date
)
val
decive_id_oldUser
=
sc
.
sql
(
val
decive_id_oldUser
=
sc
.
sql
(
s
"""
s
"""
|select distinct(device_id) as decive_id
|select distinct(device_id) as decive_id
...
@@ -105,6 +108,7 @@ object strategy_clk_imp_oldUser {
...
@@ -105,6 +108,7 @@ object strategy_clk_imp_oldUser {
val
strategies
=
Seq
(
"[1|2]$"
,
"[3|4]$"
,
"[5|6]$"
,
"[7|8]$"
)
val
strategies
=
Seq
(
"[1|2]$"
,
"[3|4]$"
,
"[5|6]$"
,
"[7|8]$"
)
for
(
strategy
<-
strategies
){
for
(
strategy
<-
strategies
){
println
(
strategy
)
val
clk_count_oldUser
=
sc
.
sql
(
val
clk_count_oldUser
=
sc
.
sql
(
s
"""
s
"""
|select '${elem}' as stat_date, count(cid_id) as get_clk_count_old
|select '${elem}' as stat_date, count(cid_id) as get_clk_count_old
...
...
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