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
3afd476d
Commit
3afd476d
authored
Jun 03, 2019
by
王志伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
统计运维想要数据
parent
f69059e1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
19 deletions
+7
-19
data_feed_exposure_precise.scala
.../src/main/scala/com/gmei/data_feed_exposure_precise.scala
+7
-19
No files found.
eda/feededa/src/main/scala/com/gmei/data_feed_exposure_precise.scala
View file @
3afd476d
...
@@ -846,6 +846,7 @@ object tag_value {
...
@@ -846,6 +846,7 @@ object tag_value {
object
app_list_yunying
{
object
app_list_yunying
{
Logger
.
getLogger
(
"org.apache.spark"
).
setLevel
(
Level
.
WARN
)
Logger
.
getLogger
(
"org.apache.spark"
).
setLevel
(
Level
.
WARN
)
...
@@ -882,24 +883,14 @@ object app_list_yunying {
...
@@ -882,24 +883,14 @@ object app_list_yunying {
val
sc
=
spark_env
.
_2
val
sc
=
spark_env
.
_2
sc
.
sql
(
"use jerry_prod"
)
sc
.
sql
(
"use jerry_prod"
)
import
sc.implicits._
// 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")
// ti.tidbMapTable(dbName = "jerry_prod", tableName = "merge_queue_table")
import
sc.implicits._
val
stat_date
=
GmeiConfig
.
getMinusNDate
(
1
)
val
stat_date
=
GmeiConfig
.
getMinusNDate
(
1
)
println
(
stat_date
)
// val stat_date = param.date
//println(param.date)
val
partition_date
=
stat_date
.
replace
(
"-"
,
""
)
val
partition_date
=
stat_date
.
replace
(
"-"
,
""
)
println
(
partition_date
)
//每日新用户
val
device_id_newUser
=
sc
.
sql
(
val
device_id_newUser
=
sc
.
sql
(
s
"""
s
"""
|select distinct(device_id) as device_id
|select distinct(device_id) as device_id
...
@@ -930,20 +921,18 @@ object app_list_yunying {
...
@@ -930,20 +921,18 @@ object app_list_yunying {
app_list
.
show
()
app_list
.
show
()
val
result1
=
app_list
val
result1
=
app_list
result1
.
show
()
result1
.
show
()
println
(
"开始写入"
)
println
(
"开始写入"
)
GmeiConfig
.
writeToJDBCTable
(
"jdbc:mysql://172.16.40.158:4000/jerry_prod?user=root&password=3SYz54LS9#^9sBvC&rewriteBatchedStatements=true"
,
result1
,
table
=
"app_list_yunying"
,
SaveMode
.
Overwrite
)
println
(
"写入完成"
)
println
(
"开始写入"
)
GmeiConfig
.
writeToJDBCTable
(
"jdbc:mysql://172.16.40.158:4000/jerry_prod?user=root&password=3SYz54LS9#^9sBvC&rewriteBatchedStatements=true"
,
result1
,
table
=
"app_list_yunying"
,
SaveMode
.
Overwrite
)
println
(
"写入完成"
)
}
}
...
@@ -962,7 +951,6 @@ object app_list_yunying {
...
@@ -962,7 +951,6 @@ object app_list_yunying {
object
test_data
{
object
test_data
{
Logger
.
getLogger
(
"org.apache.spark"
).
setLevel
(
Level
.
WARN
)
Logger
.
getLogger
(
"org.apache.spark"
).
setLevel
(
Level
.
WARN
)
...
...
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