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
25608d85
Commit
25608d85
authored
Mar 26, 2019
by
王志伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
统计like项目
parent
0323e42d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
8 deletions
+45
-8
temp_analysis.scala
eda/feededa/src/main/scala/com/gmei/temp_analysis.scala
+41
-4
temp_count.scala
eda/feededa/src/main/scala/com/gmei/temp_count.scala
+2
-2
testt.scala
eda/feededa/src/main/scala/com/gmei/testt.scala
+2
-2
No files found.
eda/feededa/src/main/scala/com/gmei/temp_analysis.scala
View file @
25608d85
...
...
@@ -8,6 +8,8 @@ import org.apache.log4j.{Level, Logger}
import
scopt.OptionParser
import
com.gmei.lib.AbstractParams
import
java.io._
import
scala.util.parsing.json._
object
temp_analysis
{
...
...
@@ -557,14 +559,49 @@ object alpha_ctr {
val
click_count_recommend
=
sc
.
sql
(
s
"""
|select mc.stat_date,mc.meigou_city,mc.meigou_pv,mc.meigou_device_num,zc.meigou_zixun,zc.meigou_zixun_device_num,dc.new_device_month
|from meigou_pv_count mc
|left join zixun_pv_count zc on mc.meigou_city = zc.meigou_city
|left join device_new_count dc on dc.first_city=mc.meigou_city
|select '${stat_date}' as stat_date,count(*)
|from bl.bl_alpha_et_mg_maidianlog_inc_d
|where params['tab_name']='recommend'
|and params['page_name']='home'
|and type='on_click_feed_topic_card'
|and partition_day='${partition_date}'
"""
.
stripMargin
)
click_count_recommend
.
show
()
val
click_count_focus
=
sc
.
sql
(
s
"""
|select '${stat_date}' as stat_date,count(*)
|from bl.bl_alpha_et_mg_maidianlog_inc_d
|where params['tab_name']='focus'
|and params['page_name']='home'
|and type='on_click_feed_topic_card'
|and partition_day='${partition_date}'
"""
.
stripMargin
)
click_count_focus
.
show
()
val
expoure_count_recommend
=
sc
.
sql
(
s
"""
|select params['exposure_cards'] as exposure_cards
|from bl.bl_alpha_et_mg_maidianlog_inc_d
|where params['tab_name'] = 'recommend'
|and params['page_name'] = 'home'
|and type = 'page_precise_exposure'
|and partition_day='${partition_date}'
"""
.
stripMargin
)
val
jsonS
=
expoure_count_recommend
.
rdd
.
map
(
row
=>{
val
s
=
row
.
getAs
[
List
[
String
]](
"exposure_cards"
)
println
(
s
.
length
)
})
GmeiConfig
.
writeToJDBCTable
(
click_count_recommend
,
"smart_rank_count"
,
SaveMode
.
Append
)
...
...
eda/feededa/src/main/scala/com/gmei/temp_count.scala
View file @
25608d85
...
...
@@ -515,8 +515,8 @@ object GetHiveSearchData {
ti
.
tidbMapTable
(
dbName
=
"jerry_prod"
,
tableName
=
"merge_queue_table"
)
val
stat_date
=
GmeiConfig
.
getMinusNDate
(
1
)
//
val stat_date = param.date
//
val stat_date = GmeiConfig.getMinusNDate(1)
val
stat_date
=
param
.
date
val
partition_date
=
stat_date
.
replace
(
"-"
,
""
)
...
...
eda/feededa/src/main/scala/com/gmei/testt.scala
View file @
25608d85
...
...
@@ -454,8 +454,8 @@ object diary_clk_card {
ti
.
tidbMapTable
(
dbName
=
"jerry_prod"
,
tableName
=
"data_feed_exposure"
)
ti
.
tidbMapTable
(
dbName
=
"jerry_prod"
,
tableName
=
"data_feed_exposure_precise"
)
//
val stat_date = GmeiConfig.getMinusNDate(1)
val
stat_date
=
param
.
date
val
stat_date
=
GmeiConfig
.
getMinusNDate
(
1
)
//
val stat_date=param.date
val
partition_date
=
stat_date
.
replace
(
"-"
,
""
)
//机构id
val
blacklist
=
sc
.
sql
(
...
...
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