Sfoglia il codice sorgente

处理字段中带有逗号的数据

晏永年 3 anni fa
parent
commit
f874066301

+ 12 - 0
src/main/scala/com/winhc/bigdata/spark/jobs/chance/table/company_bid_list.scala

@@ -21,4 +21,16 @@ case class company_bid_list(equCols: Seq[String]) extends CompanyChangeHandle {
   override def getLabel(oldMap: Map[String, String], newMap: Map[String, String]): String = ChangeExtractUtils.getTags(newMap, "招投标", Array("publish_time", "title", "purchaser", "province", "abs"))
 
   override def getBizTime(newMap: Map[String, String]): String = DateUtils.getNotNullStr(newMap("publish_time"),newMap("update_time"))
+
+  override def handle(rowkey: String, oldMap: Map[String, String], newMap: Map[String, String]): (String, String, String, Map[String, String], String, String, String, String, Map[String, String]) =
+  {
+    super.handle(rowkey, oldMap, newMap.map(m=>{
+      if(m._2.contains(",")){
+        m._1->m._2.replace(",","、")
+      }
+      else {
+        m
+      }
+    }))
+  }
 }