Commit fe05e120 authored by 王志伟's avatar 王志伟

拷贝hive数据到jerry_test

parent 719501ff
......@@ -670,7 +670,7 @@ object alpha_ctr {
//话题相关问题统计
object add_knowledge_network {
object copy_database {
Logger.getLogger("org.apache.spark").setLevel(Level.WARN)
Logger.getLogger("org.apache.eclipse.jetty.server").setLevel(Level.OFF)
......@@ -715,11 +715,19 @@ object add_knowledge_network {
import sc.implicits._
val input = sc.sparkContext.textFile("file:///home/wangzhiwei/mouse_knowledge.csv").map(row =>row.split(",")).toDF()
input.show()
val stat_date = GmeiConfig.getMinusNDate(1)
// val stat_date=param.date
val partition_date = stat_date.replace("-","")
val copy_data = sc.sql(
s"""
|select *
|from online.tl_hdfs_wiki_item_tag_view
|where partition_date='${partition_date}'
""".stripMargin
)
// GmeiConfig.writeToJDBCTable(input, "Knowledge_network", SaveMode.Append)
GmeiConfig.writeToJDBCTable(copy_data, "tl_hdfs_wiki_item_tag_view", SaveMode.Overwrite)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment