Commit 25c95f53 authored by 王志伟's avatar 王志伟

将百科id与tag关联

parent 81bd21ce
...@@ -718,28 +718,23 @@ object copy_database { ...@@ -718,28 +718,23 @@ object copy_database {
val stat_date = GmeiConfig.getMinusNDate(1) val stat_date = GmeiConfig.getMinusNDate(1)
// val stat_date=param.date // val stat_date=param.date
val partition_date = stat_date.replace("-","") 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(copy_data, "tl_hdfs_wiki_item_tag_view", SaveMode.Overwrite)
val new_data = sc.sql( val new_data = sc.sql(
s""" s"""
|select a.item_id,a.tag_id,b.id,b.name,b.treatment_method,b.price_min,b.price_max,b.treatment_time,b.maintain_time,b.recover_time |select d.level2_id,d.level2_name,c.item_id,c.tag_id,c.id,c.name,c.treatment_method,c.price_min,c.price_max,c.treatment_time,c.maintain_time,c.recover_time
|from tl_hdfs_wiki_item_tag_view a |from online.bl_tag_hierarchy_detail d
|inner join
|(select a.item_id,a.tag_id,b.id,b.name,b.treatment_method,b.price_min,b.price_max,b.treatment_time,b.maintain_time,b.recover_time
|from online.tl_hdfs_wiki_item_tag_view a
|inner join Knowledge_network b |inner join Knowledge_network b
|on a.item_id=b.id |on a.item_id=b.id
|where a.partition_date='${partition_date}' |where a.partition_date='${partition_date}') c
|on d.id=c.tag_id
|where d.partition_date='${partition_date}'
""".stripMargin """.stripMargin
) )
GmeiConfig.writeToJDBCTable(new_data, "Knowledge_network_data", SaveMode.Overwrite) GmeiConfig.writeToJDBCTable(new_data, "train_Knowledge_network_data", 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