Commit dfe66020 by WangJinfeng

init id_mapping

parent c953965c
......@@ -178,10 +178,11 @@ class IDMappingGraphx extends CommonSparkJob with Serializable {
val keys = one_id.keySet().asScala
var oneIDScore: OneIDScore = OneIDScore("", "", 0)
keys.foreach(key => {
val id_type = one_id.getString("id_type")
val json = one_id.getJSONObject(key)
val id_type = json.getString("id_type")
val id_type_score = scoreMap(id_type)
val active_date = one_id.getString("active_date")
val cnt = one_id.getIntValue("cnt")
val active_date = json.getString("active_date")
val cnt = json.getIntValue("cnt")
val days = (sdf1.parse(date).getTime - sdf1.parse(active_date).getTime) / 1000 / 3600 / 24 + 1
val score = id_type_score * 30 / days + 0.1 * cnt
if (idSet.indexOf(id_type) < idSet.indexOf(oneIDScore.one_type) || idSet.indexOf(oneIDScore.one_type) == -1
......
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