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
2d7d0e3d
Commit
2d7d0e3d
authored
May 28, 2019
by
王志伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
测试埋点数据
parent
d7c3ca12
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
17 deletions
+36
-17
data_feed_exposure_precise.scala
.../src/main/scala/com/gmei/data_feed_exposure_precise.scala
+36
-17
No files found.
eda/feededa/src/main/scala/com/gmei/data_feed_exposure_precise.scala
View file @
2d7d0e3d
...
@@ -622,20 +622,7 @@ object icon_train_data {
...
@@ -622,20 +622,7 @@ object icon_train_data {
temp_meigou
.
createOrReplaceTempView
(
"temp_meigou"
)
temp_meigou
.
createOrReplaceTempView
(
"temp_meigou"
)
val
final_train
=
sc
.
sql
(
s
"""
|select *
|from temp_diary
|union all
|select *
|from temp_meigou
"""
.
stripMargin
)
final_train
.
show
()
// 百科点击数据
// 百科点击数据
val
wiki_click
=
sc
.
sql
(
val
wiki_click
=
sc
.
sql
(
s
"""
s
"""
|SELECT cl_id as device_id,params['business_id'] as wiki_id
|SELECT cl_id as device_id,params['business_id'] as wiki_id
...
@@ -644,12 +631,46 @@ object icon_train_data {
...
@@ -644,12 +631,46 @@ object icon_train_data {
|and (action='Search_result_wiki_click_item' or action='search_result_click_infomation_item' or action='search_result_wiki_click_recommend_wiki')
|and (action='Search_result_wiki_click_item' or action='search_result_click_infomation_item' or action='search_result_wiki_click_recommend_wiki')
"""
.
stripMargin
"""
.
stripMargin
)
)
wiki_click
.
createOrReplaceTempView
(
"wiki_click"
)
val
wiki_tag
=
sc
.
sql
(
s
"""
|SELECT item_id,tag_id
|from online.tl_hdfs_wiki_item_tag_view
|where partition_date='${partition_date}'
"""
.
stripMargin
)
wiki_tag
.
createOrReplaceTempView
(
"wiki_tag"
)
val
wiki_device_tag
=
sc
.
sql
(
s
"""
|SELECT a.device_id,b.tag_id
|from wiki_click a
|left join wiki_tag b
|on a.wiki_id=b.item_id
|where b.tag_id is not null
"""
.
stripMargin
)
wiki_device_tag
.
createOrReplaceTempView
(
"wiki_device_tag"
)
val
final_train
=
sc
.
sql
(
s
"""
|select *
|from temp_diary
|union all
|select *
|from temp_meigou
|union all
|select *
|from wiki_device_tag
"""
.
stripMargin
)
final_train
.
show
()
println
(
"开始写入"
)
println
(
"开始写入"
)
GmeiConfig
.
writeToJDBCTable
(
"jdbc:mysql://172.16.40.158:4000/jerry_prod?user=root&password=3SYz54LS9#^9sBvC&rewriteBatchedStatements=true"
,
final_train
,
table
=
"icon_train_data
_test
"
,
SaveMode
.
Append
)
GmeiConfig
.
writeToJDBCTable
(
"jdbc:mysql://172.16.40.158:4000/jerry_prod?user=root&password=3SYz54LS9#^9sBvC&rewriteBatchedStatements=true"
,
final_train
,
table
=
"icon_train_data"
,
SaveMode
.
Append
)
println
(
"写入完成"
)
println
(
"写入完成"
)
...
@@ -898,9 +919,7 @@ object test_data {
...
@@ -898,9 +919,7 @@ object test_data {
|where b.tag_id is not null
|where b.tag_id is not null
"""
.
stripMargin
"""
.
stripMargin
)
)
wiki_device_tag
.
show
()
wiki_device_tag
.
createOrReplaceTempView
(
"wiki_device_tag"
)
}
}
...
...
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