|
@@ -11,6 +11,7 @@ import org.apache.spark.sql.types.StringType
|
|
import org.apache.spark.sql.{Row, SparkSession}
|
|
import org.apache.spark.sql.{Row, SparkSession}
|
|
|
|
|
|
import scala.annotation.meta.getter
|
|
import scala.annotation.meta.getter
|
|
|
|
+import scala.collection.immutable.ListMap
|
|
import scala.collection.mutable
|
|
import scala.collection.mutable
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -71,13 +72,13 @@ object CompanyDynamic {
|
|
val cid = r.getAs[String]("cid")
|
|
val cid = r.getAs[String]("cid")
|
|
val new_data = r.getAs[Map[String, String]]("data")
|
|
val new_data = r.getAs[Map[String, String]]("data")
|
|
val old_data = r.getAs[Map[String, String]]("old_data")
|
|
val old_data = r.getAs[Map[String, String]]("old_data")
|
|
- val biz_time = r.getAs[String]("biz_time")
|
|
|
|
|
|
+ val biz_date = r.getAs[String]("biz_date")
|
|
val fields = r.getAs[String]("fields")
|
|
val fields = r.getAs[String]("fields")
|
|
- val res = handle.handle(rowkey, biz_time, cid, fields.split(","), old_data, new_data)
|
|
|
|
|
|
+ val res = handle.handle(rowkey, biz_date, cid, if(fields==null) null else fields.split(","), old_data, new_data)
|
|
Row(cid, res._1, res._2, res._3, res._4, res._5, res._6, res._7, res._8, DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss"))
|
|
Row(cid, res._1, res._2, res._3, res._4, res._5, res._6, res._7, res._8, DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss"))
|
|
})
|
|
})
|
|
|
|
|
|
- val schema = getSchema(Map(
|
|
|
|
|
|
+ val schema = getSchema(ListMap(
|
|
"cid" -> StringType
|
|
"cid" -> StringType
|
|
, "info_type" -> StringType
|
|
, "info_type" -> StringType
|
|
, "rta_desc" -> StringType
|
|
, "rta_desc" -> StringType
|