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
3e1a1860
Commit
3e1a1860
authored
Apr 19, 2019
by
张彦钊
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of git.wanmeizhensuo.com:ML/ffm-baseline
修改sql
parents
37bd4e5e
802f65c4
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
44 additions
and
36 deletions
+44
-36
Data2FFM.scala
eda/feededa/src/main/scala/com/gmei/Data2FFM.scala
+6
-4
Recommendation_strategy_all.scala
...src/main/scala/com/gmei/Recommendation_strategy_all.scala
+15
-13
Search_keywords_count.scala
...ededa/src/main/scala/com/gmei/Search_keywords_count.scala
+1
-1
WeafareStat.scala
eda/feededa/src/main/scala/com/gmei/WeafareStat.scala
+1
-1
app_list.scala
eda/feededa/src/main/scala/com/gmei/app_list.scala
+16
-12
data_feed_exposure_precise.scala
.../src/main/scala/com/gmei/data_feed_exposure_precise.scala
+4
-4
strategy_clk_imp_oldUser.scala
...da/src/main/scala/com/gmei/strategy_clk_imp_oldUser.scala
+1
-1
No files found.
eda/feededa/src/main/scala/com/gmei/Data2FFM.scala
View file @
3e1a1860
...
@@ -3,7 +3,7 @@ import java.io.{File, PrintWriter, Serializable}
...
@@ -3,7 +3,7 @@ import java.io.{File, PrintWriter, Serializable}
import
com.gmei.lib.AbstractParams
import
com.gmei.lib.AbstractParams
import
org.apache.log4j.
{
Level
,
Logger
}
import
org.apache.log4j.
{
Level
,
Logger
}
import
org.apache.spark.sql.
{
DataFrame
,
SaveMode
,
TiContext
}
import
org.apache.spark.sql.
{
DataFrame
,
SaveMode
}
import
scopt.OptionParser
import
scopt.OptionParser
...
@@ -47,9 +47,11 @@ object Data2FFM {
...
@@ -47,9 +47,11 @@ object Data2FFM {
val
spark_env
=
GmeiConfig
.
getSparkSession
()
val
spark_env
=
GmeiConfig
.
getSparkSession
()
val
sc
=
spark_env
.
_2
val
sc
=
spark_env
.
_2
val
ti
=
new
TiContext
(
sc
)
sc
.
sql
(
"use jerry_test"
)
ti
.
tidbMapTable
(
dbName
=
"jerry_test"
,
tableName
=
"esmm_train_data"
)
ti
.
tidbMapTable
(
dbName
=
"jerry_test"
,
tableName
=
"esmm_pre_data"
)
// val ti = new TiContext(sc)
// ti.tidbMapTable(dbName = "jerry_test", tableName = "esmm_train_data")
// ti.tidbMapTable(dbName = "jerry_test", tableName = "esmm_pre_data")
val
train_sep_date
=
GmeiConfig
.
getMinusNDate
(
10
)
val
train_sep_date
=
GmeiConfig
.
getMinusNDate
(
10
)
...
...
eda/feededa/src/main/scala/com/gmei/Recommendation_strategy_all.scala
View file @
3e1a1860
...
@@ -3,7 +3,7 @@ package com.gmei
...
@@ -3,7 +3,7 @@ package com.gmei
import
java.io.Serializable
import
java.io.Serializable
import
com.gmei.WeafareStat.
{
defaultParams
,
parser
}
import
com.gmei.WeafareStat.
{
defaultParams
,
parser
}
import
org.apache.spark.sql.
{
SaveMode
,
TiContext
}
import
org.apache.spark.sql.
{
SaveMode
}
import
org.apache.log4j.
{
Level
,
Logger
}
import
org.apache.log4j.
{
Level
,
Logger
}
import
scopt.OptionParser
import
scopt.OptionParser
import
com.gmei.lib.AbstractParams
import
com.gmei.lib.AbstractParams
...
@@ -43,12 +43,14 @@ object Recommendation_strategy_all {
...
@@ -43,12 +43,14 @@ object Recommendation_strategy_all {
val
spark_env
=
GmeiConfig
.
getSparkSession
()
val
spark_env
=
GmeiConfig
.
getSparkSession
()
val
sc
=
spark_env
.
_2
val
sc
=
spark_env
.
_2
val
ti
=
new
TiContext
(
sc
)
sc
.
sql
(
"use jerry_prod"
)
ti
.
tidbMapTable
(
dbName
=
"jerry_prod"
,
tableName
=
"diary_video"
)
ti
.
tidbMapTable
(
dbName
=
"jerry_prod"
,
tableName
=
"data_feed_click"
)
// val ti = new TiContext(sc)
ti
.
tidbMapTable
(
dbName
=
"jerry_prod"
,
tableName
=
"blacklist"
)
// ti.tidbMapTable(dbName = "jerry_prod", tableName = "diary_video")
ti
.
tidbMapTable
(
dbName
=
"jerry_prod"
,
tableName
=
"data_feed_exposure"
)
// ti.tidbMapTable(dbName = "jerry_prod", tableName = "data_feed_click")
ti
.
tidbMapTable
(
dbName
=
"jerry_prod"
,
tableName
=
"merge_queue_table"
)
// ti.tidbMapTable(dbName = "jerry_prod", tableName = "blacklist")
// ti.tidbMapTable(dbName = "jerry_prod", tableName = "data_feed_exposure")
// ti.tidbMapTable(dbName = "jerry_prod", tableName = "merge_queue_table")
val
stat_date
=
GmeiConfig
.
getMinusNDate
(
1
)
val
stat_date
=
GmeiConfig
.
getMinusNDate
(
1
)
...
@@ -403,11 +405,11 @@ object Gini_coefficient {
...
@@ -403,11 +405,11 @@ object Gini_coefficient {
val
spark_env
=
GmeiConfig
.
getSparkSession
()
val
spark_env
=
GmeiConfig
.
getSparkSession
()
val
sc
=
spark_env
.
_2
val
sc
=
spark_env
.
_2
val
ti
=
new
TiContext
(
sc
)
//
val ti = new TiContext(sc)
ti
.
tidbMapTable
(
dbName
=
"eagle"
,
tableName
=
"src_mimas_prod_api_diary"
)
//
ti.tidbMapTable(dbName = "eagle", tableName = "src_mimas_prod_api_diary")
ti
.
tidbMapTable
(
dbName
=
"jerry_prod"
,
tableName
=
"data_feed_click"
)
//
ti.tidbMapTable(dbName = "jerry_prod", tableName = "data_feed_click")
ti
.
tidbMapTable
(
dbName
=
"jerry_prod"
,
tableName
=
"blacklist"
)
//
ti.tidbMapTable(dbName = "jerry_prod", tableName = "blacklist")
ti
.
tidbMapTable
(
dbName
=
"jerry_prod"
,
tableName
=
"data_feed_exposure"
)
//
ti.tidbMapTable(dbName = "jerry_prod", tableName = "data_feed_exposure")
import
sc.implicits._
import
sc.implicits._
...
@@ -419,7 +421,7 @@ object Gini_coefficient {
...
@@ -419,7 +421,7 @@ object Gini_coefficient {
val
diary_id
=
sc
.
sql
(
val
diary_id
=
sc
.
sql
(
s
"""
s
"""
|select id as diary_id
|select id as diary_id
|from src_mimas_prod_api_diary
|from
eagle.
src_mimas_prod_api_diary
|where content_level >=3.5
|where content_level >=3.5
|and doctor_id is not null
|and doctor_id is not null
"""
.
stripMargin
"""
.
stripMargin
...
...
eda/feededa/src/main/scala/com/gmei/Search_keywords_count.scala
View file @
3e1a1860
...
@@ -3,7 +3,7 @@ package com.gmei
...
@@ -3,7 +3,7 @@ package com.gmei
import
java.io.Serializable
import
java.io.Serializable
import
com.gmei.WeafareStat.
{
defaultParams
,
parser
}
import
com.gmei.WeafareStat.
{
defaultParams
,
parser
}
import
org.apache.spark.sql.
{
SaveMode
,
TiContext
}
import
org.apache.spark.sql.
{
SaveMode
}
import
org.apache.log4j.
{
Level
,
Logger
}
import
org.apache.log4j.
{
Level
,
Logger
}
import
scopt.OptionParser
import
scopt.OptionParser
import
com.gmei.lib.AbstractParams
import
com.gmei.lib.AbstractParams
...
...
eda/feededa/src/main/scala/com/gmei/WeafareStat.scala
View file @
3e1a1860
...
@@ -2,7 +2,7 @@ package com.gmei
...
@@ -2,7 +2,7 @@ package com.gmei
import
java.io.Serializable
import
java.io.Serializable
import
org.apache.spark.sql.
{
SaveMode
,
TiContext
}
import
org.apache.spark.sql.
{
SaveMode
}
import
org.apache.log4j.
{
Level
,
Logger
}
import
org.apache.log4j.
{
Level
,
Logger
}
import
scopt.OptionParser
import
scopt.OptionParser
import
com.gmei.lib.AbstractParams
import
com.gmei.lib.AbstractParams
...
...
eda/feededa/src/main/scala/com/gmei/app_list.scala
View file @
3e1a1860
...
@@ -4,7 +4,7 @@ import java.io.Serializable
...
@@ -4,7 +4,7 @@ import java.io.Serializable
import
org.apache.spark.sql.functions.udf
import
org.apache.spark.sql.functions.udf
import
com.gmei.WeafareStat.
{
defaultParams
,
parser
}
import
com.gmei.WeafareStat.
{
defaultParams
,
parser
}
import
org.apache.spark.sql.
{
SaveMode
,
TiContext
}
import
org.apache.spark.sql.
{
SaveMode
}
import
org.apache.log4j.
{
Level
,
Logger
}
import
org.apache.log4j.
{
Level
,
Logger
}
import
scopt.OptionParser
import
scopt.OptionParser
import
com.gmei.lib.AbstractParams
import
com.gmei.lib.AbstractParams
...
@@ -49,13 +49,15 @@ object app_list {
...
@@ -49,13 +49,15 @@ object app_list {
val
spark_env
=
GmeiConfig
.
getSparkSession
()
val
spark_env
=
GmeiConfig
.
getSparkSession
()
val
sc
=
spark_env
.
_2
val
sc
=
spark_env
.
_2
val
ti
=
new
TiContext
(
sc
)
sc
.
sql
(
"use jerry_prod"
)
ti
.
tidbMapTable
(
dbName
=
"jerry_prod"
,
tableName
=
"diary_video"
)
ti
.
tidbMapTable
(
dbName
=
"jerry_prod"
,
tableName
=
"data_feed_click"
)
// val ti = new TiContext(sc)
ti
.
tidbMapTable
(
dbName
=
"jerry_prod"
,
tableName
=
"blacklist"
)
// ti.tidbMapTable(dbName = "jerry_prod", tableName = "diary_video")
ti
.
tidbMapTable
(
dbName
=
"jerry_test"
,
tableName
=
"bl_device_list"
)
// ti.tidbMapTable(dbName = "jerry_prod", tableName = "data_feed_click")
ti
.
tidbMapTable
(
dbName
=
"jerry_prod"
,
tableName
=
"data_feed_exposure"
)
// ti.tidbMapTable(dbName = "jerry_prod", tableName = "blacklist")
ti
.
tidbMapTable
(
dbName
=
"jerry_prod"
,
tableName
=
"merge_queue_table"
)
// 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._
import
sc.implicits._
...
@@ -218,10 +220,12 @@ object coincidence_xinyang {
...
@@ -218,10 +220,12 @@ object coincidence_xinyang {
val
spark_env
=
GmeiConfig
.
getSparkSession
()
val
spark_env
=
GmeiConfig
.
getSparkSession
()
val
sc
=
spark_env
.
_2
val
sc
=
spark_env
.
_2
val
ti
=
new
TiContext
(
sc
)
sc
.
sql
(
"use jerry_prod"
)
ti
.
tidbMapTable
(
dbName
=
"jerry_prod"
,
tableName
=
"blacklist"
)
ti
.
tidbMapTable
(
dbName
=
"jerry_prod"
,
tableName
=
"device_id_applist"
)
// val ti = new TiContext(sc)
ti
.
tidbMapTable
(
dbName
=
"jerry_prod"
,
tableName
=
"device_id_coincidence"
)
// ti.tidbMapTable(dbName = "jerry_prod", tableName = "blacklist")
// ti.tidbMapTable(dbName = "jerry_prod", tableName = "device_id_applist")
// ti.tidbMapTable(dbName = "jerry_prod", tableName = "device_id_coincidence")
//println(param.date)
//println(param.date)
...
...
eda/feededa/src/main/scala/com/gmei/data_feed_exposure_precise.scala
View file @
3e1a1860
...
@@ -411,11 +411,11 @@ object data_feed_exposure_precise {
...
@@ -411,11 +411,11 @@ object data_feed_exposure_precise {
)
)
// GmeiConfig.writeToJDBCTable(result, table = "data_feed_exposure_precise", SaveMode.Append)
// GmeiConfig.writeToJDBCTable(result, table = "data_feed_exposure_precise", SaveMode.Append)
//
GmeiConfig.writeToJDBCTable("jdbc:mysql://152.136.44.138:4000/jerry_prod?user=root&password=3SYz54LS9#^9sBvC&rewriteBatchedStatements=true",result, table="data_feed_exposure_precise",SaveMode.Append)
GmeiConfig
.
writeToJDBCTable
(
"jdbc:mysql://152.136.44.138:4000/jerry_prod?user=root&password=3SYz54LS9#^9sBvC&rewriteBatchedStatements=true"
,
result
,
table
=
"data_feed_exposure_precise"
,
SaveMode
.
Append
)
println
(
"开始写入"
)
//
println("开始写入")
GmeiConfig
.
writeToJDBCTable
(
"jerry.jdbcuri"
,
result
,
table
=
"data_feed_exposure_precise"
,
SaveMode
.
Append
)
//
GmeiConfig.writeToJDBCTable("jerry.jdbcuri",result, table="data_feed_exposure_precise",SaveMode.Append)
println
(
"写入完成"
)
//
println("写入完成")
}
}
...
...
eda/feededa/src/main/scala/com/gmei/strategy_clk_imp_oldUser.scala
View file @
3e1a1860
...
@@ -3,7 +3,7 @@ package com.gmei
...
@@ -3,7 +3,7 @@ package com.gmei
import
java.io.Serializable
import
java.io.Serializable
import
com.gmei.WeafareStat.
{
defaultParams
,
parser
}
import
com.gmei.WeafareStat.
{
defaultParams
,
parser
}
import
org.apache.spark.sql.
{
SaveMode
,
TiContext
}
import
org.apache.spark.sql.
{
SaveMode
}
import
org.apache.log4j.
{
Level
,
Logger
}
import
org.apache.log4j.
{
Level
,
Logger
}
import
scopt.OptionParser
import
scopt.OptionParser
import
com.gmei.lib.AbstractParams
import
com.gmei.lib.AbstractParams
...
...
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