|
@@ -1,11 +1,7 @@
|
|
|
package com.winhc.bigdata.spark.ng.utils
|
|
|
|
|
|
-import com.winhc.bigdata.spark.utils.{BaseUtil, LoggingUtils, SparkUtils}
|
|
|
-import org.apache.commons.lang3.StringUtils
|
|
|
-import org.apache.spark.sql.SparkSession
|
|
|
-import org.apache.spark.sql.functions.{col, struct, to_json}
|
|
|
+import com.winhc.bigdata.spark.utils.SparkUtils
|
|
|
|
|
|
-import scala.annotation.meta.getter
|
|
|
import scala.collection.mutable
|
|
|
|
|
|
/**
|
|
@@ -13,249 +9,10 @@ import scala.collection.mutable
|
|
|
* @Date: 2020/10/10 10:23
|
|
|
* @Description: winhc_ng空间下摘要增强版
|
|
|
*/
|
|
|
-case class GroupByInfoNg(field: String, value_alias: Seq[(String, String)])
|
|
|
-
|
|
|
-case class company_summary_args(table_name: String
|
|
|
- , companyIdField: String
|
|
|
- , field_prefix: String = null //如果没有 groupByInfo的话可使用此别名,默认为table_name
|
|
|
- , distinctField: String = "rowkey"
|
|
|
- , groupByInfo: GroupByInfoNg = null
|
|
|
- , where: String = ""
|
|
|
- , sortField: String = "ds"
|
|
|
- ) {
|
|
|
- def winhc_hash(): String = {
|
|
|
- BaseUtil.cleanup(s"${table_name}_${companyIdField}").replaceAll("[\\(\\)() ]", "")
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-case class CompanySummaryNg_new(s: SparkSession,
|
|
|
- project: String //表所在工程名
|
|
|
- , args: Seq[company_summary_args]
|
|
|
- ) extends LoggingUtils {
|
|
|
- @(transient@getter) val spark: SparkSession = s
|
|
|
- private val target_tab = "winhc_ng.out_es_summary"
|
|
|
- init()
|
|
|
-
|
|
|
- private def init() {
|
|
|
- sql(
|
|
|
- s"""
|
|
|
- |CREATE TABLE IF NOT EXISTS $target_tab
|
|
|
- |(
|
|
|
- | company_id STRING COMMENT '公司id'
|
|
|
- | ,summary STRING COMMENT '格子中的摘要信息,json格式'
|
|
|
- | ,detail STRING COMMENT '个别维度详细的摘要信息'
|
|
|
- |)
|
|
|
- |COMMENT 'out es summary,create by ${BaseUtil.nowDate(pattern = "yyyy-MM-dd HH:mm:ss")}'
|
|
|
- |PARTITIONED BY (ds STRING COMMENT '分区')
|
|
|
- |LIFECYCLE 15
|
|
|
- |""".stripMargin)
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- private def get_table_data(arg: company_summary_args): String = {
|
|
|
- val ds = getLastPartitionsOrElse(target_tab, null)
|
|
|
-
|
|
|
- val tab = arg.table_name
|
|
|
- val companyIdField = arg.companyIdField
|
|
|
- val distinctField = arg.distinctField
|
|
|
-
|
|
|
- val sortField = arg.sortField
|
|
|
- val where = if (StringUtils.isEmpty(arg.where)) {
|
|
|
- s""
|
|
|
- } else {
|
|
|
- s"AND ${arg.where}"
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- val ads_table = s"${project}.ads_$tab" //存量ads表
|
|
|
- val inc_ads_table = s"${project}.inc_ads_$tab"
|
|
|
-
|
|
|
- val inc_ads_last_ds = getLastPartitionsOrElse(inc_ads_table, "0")
|
|
|
-
|
|
|
- val new_cols = getColumns(ads_table).intersect(getColumns(inc_ads_table))
|
|
|
-
|
|
|
- val ads_last_ds = getLastPartitionsOrElse(ads_table, "0")
|
|
|
- val tab_tmp_view = s"${arg.winhc_hash()}_data"
|
|
|
-
|
|
|
- if (ds == null) {
|
|
|
- sql(
|
|
|
- s"""
|
|
|
- |SELECT ${new_cols.map(getCastCols(_, "")).mkString(",")}
|
|
|
- |FROM $ads_table
|
|
|
- |WHERE ds = '$ads_last_ds'
|
|
|
- |UNION ALL
|
|
|
- |SELECT ${new_cols.map(getCastCols(_, "")).mkString(",")}
|
|
|
- |FROM $inc_ads_table
|
|
|
- |WHERE ds > $ads_last_ds
|
|
|
- |""".stripMargin)
|
|
|
- .createOrReplaceTempView(tab_tmp_view)
|
|
|
- } else {
|
|
|
- sql(
|
|
|
- s"""
|
|
|
- |SELECT ${new_cols.map(getCastCols(_, "org_tab.")).mkString(",")}
|
|
|
- |FROM (
|
|
|
- | SELECT DISTINCT $companyIdField as xjk_cid
|
|
|
- | FROM $inc_ads_table
|
|
|
- | WHERE ds = $inc_ads_last_ds
|
|
|
- | ) id_table
|
|
|
- |JOIN (
|
|
|
- | SELECT ${new_cols.map(getCastCols(_, "")).mkString(",")}
|
|
|
- | ,$companyIdField as xjk_cid
|
|
|
- | FROM $inc_ads_table
|
|
|
- | WHERE ds > '$ads_last_ds'
|
|
|
- | AND ds < '$inc_ads_last_ds'
|
|
|
- | UNION ALL
|
|
|
- | SELECT ${new_cols.map(getCastCols(_, "")).mkString(",")}
|
|
|
- | ,$companyIdField as xjk_cid
|
|
|
- | FROM $ads_table
|
|
|
- | WHERE ds = '$ads_last_ds'
|
|
|
- | ) org_tab
|
|
|
- |ON id_table.xjk_cid = org_tab.xjk_cid
|
|
|
- |UNION ALL
|
|
|
- |SELECT ${new_cols.map(getCastCols(_, "")).mkString(",")}
|
|
|
- |FROM $inc_ads_table
|
|
|
- |WHERE ds = $inc_ads_last_ds
|
|
|
- |""".stripMargin)
|
|
|
- .createOrReplaceTempView(tab_tmp_view)
|
|
|
- }
|
|
|
-
|
|
|
- val distinct_tab = s"${tab_tmp_view}_distinct"
|
|
|
- sql(
|
|
|
- s"""
|
|
|
- |SELECT ${new_cols.map(getCastCols(_, "")).mkString(",")}
|
|
|
- |FROM (
|
|
|
- | SELECT tmp.*
|
|
|
- | ,ROW_NUMBER() OVER(PARTITION BY $distinctField ORDER BY $sortField DESC ) c
|
|
|
- | FROM $tab_tmp_view AS tmp
|
|
|
- | ) tmp2
|
|
|
- |WHERE tmp2.c = 1
|
|
|
- |$where
|
|
|
- |""".stripMargin)
|
|
|
- .createOrReplaceTempView(distinct_tab)
|
|
|
- distinct_tab
|
|
|
- }
|
|
|
-
|
|
|
- private def get_tab_summary(arg: company_summary_args): String = {
|
|
|
- val tab_hash = arg.winhc_hash()
|
|
|
-
|
|
|
- val tab = arg.table_name
|
|
|
- val companyIdField = arg.companyIdField
|
|
|
-
|
|
|
- val result_tab = s"${tab_hash}_summary_tab"
|
|
|
-
|
|
|
- val all_tab = get_table_data(arg)
|
|
|
-
|
|
|
- val func_name = s"xjk_func_${tab_hash}"
|
|
|
-
|
|
|
- val view = if (arg.groupByInfo == null) {
|
|
|
- if (arg.field_prefix != null) {
|
|
|
- s"arr[0] as ${arg.field_prefix}"
|
|
|
- } else {
|
|
|
- s"arr[0] as $tab"
|
|
|
- }
|
|
|
-
|
|
|
- } else {
|
|
|
- arg.groupByInfo.value_alias.indices.map(i => {
|
|
|
- s"arr[$i] as ${arg.groupByInfo.value_alias(i)._2}"
|
|
|
- }).mkString(",")
|
|
|
- }
|
|
|
-
|
|
|
- //注册函数
|
|
|
- if (arg.groupByInfo != null) {
|
|
|
- val fieldSeq = arg.groupByInfo.value_alias.map(r => {
|
|
|
- (s"${r._1}", r._2)
|
|
|
- })
|
|
|
-
|
|
|
- def getResArr(group_val: String, num: Long): Seq[Long] = {
|
|
|
- val res = scala.collection.mutable.ArrayBuffer[Long]()
|
|
|
- for (i <- fieldSeq) {
|
|
|
- if (i._1.equals(group_val)) {
|
|
|
- res += num
|
|
|
- } else {
|
|
|
- res += 0
|
|
|
- }
|
|
|
- }
|
|
|
- res
|
|
|
- }
|
|
|
-
|
|
|
- spark.udf.register(func_name, getResArr _)
|
|
|
- }
|
|
|
-
|
|
|
- val groupKey_show = if (arg.groupByInfo == null) {
|
|
|
- s",array(count(1)) as arr"
|
|
|
- } else {
|
|
|
- s",$func_name(cast(${arg.groupByInfo.field} as STRING),count(1)) as arr"
|
|
|
- }
|
|
|
-
|
|
|
- val groupKey = if (arg.groupByInfo == null) {
|
|
|
- s""
|
|
|
- } else {
|
|
|
- s",${arg.groupByInfo.field}"
|
|
|
- }
|
|
|
-
|
|
|
- sql(
|
|
|
- s"""
|
|
|
- |SELECT company_id
|
|
|
- | ,${view}
|
|
|
- |FROM (
|
|
|
- | SELECT $companyIdField as company_id
|
|
|
- | $groupKey_show
|
|
|
- | FROM $all_tab
|
|
|
- | GROUP BY $companyIdField ${groupKey}
|
|
|
- |)
|
|
|
- |""".stripMargin)
|
|
|
- .createOrReplaceTempView(result_tab)
|
|
|
-
|
|
|
- if (arg.groupByInfo != null) {
|
|
|
- sql(
|
|
|
- s"""
|
|
|
- |SELECT company_id
|
|
|
- | ,${arg.groupByInfo.value_alias.map(_._2).map(f => s"sum($f) as $f").mkString(",")}
|
|
|
- |FROM $result_tab
|
|
|
- |GROUP BY company_id
|
|
|
- |""".stripMargin)
|
|
|
- .createOrReplaceTempView(result_tab)
|
|
|
- }
|
|
|
- result_tab
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- def calc(): Unit = {
|
|
|
- val summary_tab = "summary_tab_xjk"
|
|
|
- val summary_tabs = args.map(get_tab_summary).seq
|
|
|
- val merge = merge_table(spark, summary_tabs, "company_id")
|
|
|
- merge.calc(summary_tab)
|
|
|
- val cols = getColumns(summary_tab).diff(Seq("company_id"))
|
|
|
-
|
|
|
- sql(
|
|
|
- s"""
|
|
|
- |select * from $summary_tab
|
|
|
- |""".stripMargin)
|
|
|
- .withColumn("summary", to_json(struct(cols.map(col): _*))).createTempView("xjk_tmp_summary_tab")
|
|
|
-
|
|
|
- sql(
|
|
|
- s"""
|
|
|
- |INSERT OVERWRITE TABLE $target_tab PARTITION(ds='${BaseUtil.getYesterday()}')
|
|
|
- |SELECT company_id,summary,null as detail
|
|
|
- |FROM
|
|
|
- | xjk_tmp_summary_tab
|
|
|
- |""".stripMargin)
|
|
|
- merge.drop()
|
|
|
- }
|
|
|
-
|
|
|
- private def getCastCols(name: String, pre: String): String = {
|
|
|
- val list = List("cid", "new_cid", "ncid")
|
|
|
- if (list.contains(name)) {
|
|
|
- return s"CAST(${pre}${name} as BIGINT) $name"
|
|
|
- }
|
|
|
- pre + name
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
object CompanySummaryNg_new {
|
|
|
|
|
|
- private def get_default_summary_args(tableName: String): company_summary_args = {
|
|
|
- company_summary_args(
|
|
|
+ private def get_default_summary_args(tableName: String): SummaryArgs = {
|
|
|
+ SummaryArgs(
|
|
|
table_name = tableName
|
|
|
, companyIdField = "split(rowkey,'_')[0]"
|
|
|
, where = "instr(rowkey,'_') != 0"
|
|
@@ -266,8 +23,8 @@ object CompanySummaryNg_new {
|
|
|
)
|
|
|
}
|
|
|
|
|
|
- private def get_default_summary_args(tableName: String, company_id: String): company_summary_args = {
|
|
|
- company_summary_args(
|
|
|
+ private def get_default_summary_args(tableName: String, company_id: String): SummaryArgs = {
|
|
|
+ SummaryArgs(
|
|
|
table_name = tableName
|
|
|
, companyIdField = company_id
|
|
|
, where = s"$company_id is not null and length($company_id) = 32 "
|
|
@@ -285,7 +42,7 @@ object CompanySummaryNg_new {
|
|
|
, get_default_summary_args("company_tm")
|
|
|
, get_default_summary_args("company_app_info")
|
|
|
|
|
|
- , company_summary_args(table_name = "company_court_open_announcement_explode"
|
|
|
+ , SummaryArgs(table_name = "company_court_open_announcement_explode"
|
|
|
, companyIdField = "plaintiff_info_id_explode"
|
|
|
, distinctField = "rowkey,plaintiff_info_id_explode"
|
|
|
, where = "plaintiff_info_id_explode is not null and length(plaintiff_info_id_explode) = 32 "
|
|
@@ -294,7 +51,7 @@ object CompanySummaryNg_new {
|
|
|
, ("1", s"company_court_open_announcement_del_1_plaintiff")
|
|
|
))
|
|
|
)
|
|
|
- , company_summary_args(table_name = "company_court_open_announcement_explode"
|
|
|
+ , SummaryArgs(table_name = "company_court_open_announcement_explode"
|
|
|
, companyIdField = "defendant_info_id_explode"
|
|
|
, distinctField = "rowkey,defendant_info_id_explode"
|
|
|
, where = "defendant_info_id_explode is not null and length(defendant_info_id_explode) = 32 "
|
|
@@ -304,7 +61,7 @@ object CompanySummaryNg_new {
|
|
|
))
|
|
|
)
|
|
|
|
|
|
- , company_summary_args(table_name = "company_dishonest_info"
|
|
|
+ , SummaryArgs(table_name = "company_dishonest_info"
|
|
|
, companyIdField = "keyno"
|
|
|
, where = "keyno is not null and length(keyno) = 32 "
|
|
|
, groupByInfo = GroupByInfoNg(field = "deleted", value_alias = Seq(
|
|
@@ -312,7 +69,7 @@ object CompanySummaryNg_new {
|
|
|
, ("1", s"company_dishonest_info_del_1")
|
|
|
))
|
|
|
)
|
|
|
- , company_summary_args(table_name = "company_zxr_restrict"
|
|
|
+ , SummaryArgs(table_name = "company_zxr_restrict"
|
|
|
, companyIdField = "company_id"
|
|
|
, where = "company_id is not null and length(company_id) = 32 "
|
|
|
, groupByInfo = GroupByInfoNg(field = "deleted", value_alias = Seq(
|
|
@@ -321,7 +78,7 @@ object CompanySummaryNg_new {
|
|
|
))
|
|
|
)
|
|
|
|
|
|
- , company_summary_args(table_name = "company_abnormal_info"
|
|
|
+ , SummaryArgs(table_name = "company_abnormal_info"
|
|
|
, companyIdField = "company_id"
|
|
|
, where = "company_id is not null and length(company_id) = 32 "
|
|
|
, groupByInfo = GroupByInfoNg(field = "deleted", value_alias = Seq(
|
|
@@ -331,7 +88,7 @@ object CompanySummaryNg_new {
|
|
|
)
|
|
|
|
|
|
//todo
|
|
|
- , company_summary_args(table_name = "company_public_announcement"
|
|
|
+ , SummaryArgs(table_name = "company_public_announcement"
|
|
|
, companyIdField = "company_id"
|
|
|
, where = "company_id is not null and length(company_id) = 32 "
|
|
|
, groupByInfo = GroupByInfoNg(field = "deleted", value_alias = Seq(
|
|
@@ -339,7 +96,7 @@ object CompanySummaryNg_new {
|
|
|
, ("1", s"company_public_announcement_del_1")
|
|
|
))
|
|
|
)
|
|
|
- , company_summary_args(table_name = "company_illegal_info"
|
|
|
+ , SummaryArgs(table_name = "company_illegal_info"
|
|
|
, companyIdField = "company_id"
|
|
|
, where = "company_id is not null and length(company_id) = 32 "
|
|
|
, groupByInfo = GroupByInfoNg(field = "deleted", value_alias = Seq(
|
|
@@ -349,7 +106,7 @@ object CompanySummaryNg_new {
|
|
|
)
|
|
|
|
|
|
|
|
|
- , company_summary_args(table_name = "company_land_mortgage"
|
|
|
+ , SummaryArgs(table_name = "company_land_mortgage"
|
|
|
, companyIdField = "mortgagor_company_id"
|
|
|
, where = "mortgagor_company_id is not null and length(mortgagor_company_id) = 32 "
|
|
|
, groupByInfo = GroupByInfoNg(field = "deleted", value_alias = Seq(
|
|
@@ -359,7 +116,7 @@ object CompanySummaryNg_new {
|
|
|
)
|
|
|
|
|
|
|
|
|
- , company_summary_args(table_name = "company_land_mortgage"
|
|
|
+ , SummaryArgs(table_name = "company_land_mortgage"
|
|
|
, companyIdField = "mortgagee_company_id"
|
|
|
, where = "mortgagee_company_id is not null and length(mortgagee_company_id) = 32 "
|
|
|
, groupByInfo = GroupByInfoNg(field = "deleted", value_alias = Seq(
|
|
@@ -369,7 +126,7 @@ object CompanySummaryNg_new {
|
|
|
)
|
|
|
|
|
|
|
|
|
- , company_summary_args(table_name = "company_judicial_assistance"
|
|
|
+ , SummaryArgs(table_name = "company_judicial_assistance"
|
|
|
, companyIdField = "company_id"
|
|
|
, where = "company_id is not null and length(company_id) = 32 "
|
|
|
, groupByInfo = GroupByInfoNg(field = "deleted", value_alias = Seq(
|
|
@@ -378,7 +135,7 @@ object CompanySummaryNg_new {
|
|
|
))
|
|
|
)
|
|
|
|
|
|
- , company_summary_args(table_name = "company_judicial_assistance"
|
|
|
+ , SummaryArgs(table_name = "company_judicial_assistance"
|
|
|
, companyIdField = "executed_person_id"
|
|
|
, where = "executed_person_id is not null and length(executed_person_id) = 32 "
|
|
|
, groupByInfo = GroupByInfoNg(field = "deleted", value_alias = Seq(
|
|
@@ -388,7 +145,7 @@ object CompanySummaryNg_new {
|
|
|
)
|
|
|
|
|
|
|
|
|
- , company_summary_args(table_name = "company_equity_info"
|
|
|
+ , SummaryArgs(table_name = "company_equity_info"
|
|
|
, companyIdField = "related_company_id"
|
|
|
, where = "related_company_id is not null and length(related_company_id) = 32 "
|
|
|
, groupByInfo = GroupByInfoNg(field = "deleted", value_alias = Seq(
|
|
@@ -396,7 +153,7 @@ object CompanySummaryNg_new {
|
|
|
, ("1", s"company_equity_info_del_1_related")
|
|
|
))
|
|
|
)
|
|
|
- , company_summary_args(table_name = "company_equity_info_explode"
|
|
|
+ , SummaryArgs(table_name = "company_equity_info_explode"
|
|
|
, companyIdField = "pledgor_keyno_explode"
|
|
|
, distinctField = "rowkey,pledgor_keyno_explode"
|
|
|
, where = "pledgor_keyno_explode is not null and length(pledgor_keyno_explode) = 32 "
|
|
@@ -405,7 +162,7 @@ object CompanySummaryNg_new {
|
|
|
, ("1", s"company_equity_info_del_1_pledgor")
|
|
|
))
|
|
|
)
|
|
|
- , company_summary_args(table_name = "company_equity_info_explode"
|
|
|
+ , SummaryArgs(table_name = "company_equity_info_explode"
|
|
|
, companyIdField = "pledgee_keyno_explode"
|
|
|
, distinctField = "rowkey,pledgee_keyno_explode"
|
|
|
, where = "pledgee_keyno_explode is not null and length(pledgee_keyno_explode) = 32 "
|
|
@@ -416,7 +173,7 @@ object CompanySummaryNg_new {
|
|
|
)
|
|
|
|
|
|
|
|
|
- , company_summary_args(table_name = "company_lawsuit_explode"
|
|
|
+ , SummaryArgs(table_name = "company_lawsuit_explode"
|
|
|
, companyIdField = "plaintiff_info_id_explode"
|
|
|
, distinctField = "rowkey,plaintiff_info_id_explode"
|
|
|
, where = "plaintiff_info_id_explode is not null and length(plaintiff_info_id_explode) = 32 "
|
|
@@ -425,7 +182,7 @@ object CompanySummaryNg_new {
|
|
|
, ("1", s"company_lawsuit_del_1_plaintiff")
|
|
|
))
|
|
|
)
|
|
|
- , company_summary_args(table_name = "company_lawsuit_explode"
|
|
|
+ , SummaryArgs(table_name = "company_lawsuit_explode"
|
|
|
, companyIdField = "defendant_info_id_explode"
|
|
|
, distinctField = "rowkey,defendant_info_id_explode"
|
|
|
, where = "defendant_info_id_explode is not null and length(defendant_info_id_explode) = 32 "
|
|
@@ -436,8 +193,7 @@ object CompanySummaryNg_new {
|
|
|
)
|
|
|
|
|
|
|
|
|
-
|
|
|
- , company_summary_args(table_name = "company_court_announcement_explode"
|
|
|
+ , SummaryArgs(table_name = "company_court_announcement_explode"
|
|
|
, companyIdField = "plaintiff_info_id_explode"
|
|
|
, distinctField = "rowkey,plaintiff_info_id_explode"
|
|
|
, where = "plaintiff_info_id_explode is not null and length(plaintiff_info_id_explode) = 32 "
|
|
@@ -446,7 +202,7 @@ object CompanySummaryNg_new {
|
|
|
, ("1", s"company_court_announcement_del_1_plaintiff")
|
|
|
))
|
|
|
)
|
|
|
- , company_summary_args(table_name = "company_court_announcement_explode"
|
|
|
+ , SummaryArgs(table_name = "company_court_announcement_explode"
|
|
|
, companyIdField = "litigant_info_id_explode"
|
|
|
, distinctField = "rowkey,litigant_info_id_explode"
|
|
|
, where = "litigant_info_id_explode is not null and length(litigant_info_id_explode) = 32 "
|
|
@@ -455,7 +211,7 @@ object CompanySummaryNg_new {
|
|
|
, ("1", s"company_court_announcement_del_1_litigant")
|
|
|
))
|
|
|
)
|
|
|
- , company_summary_args(table_name = "company_send_announcement_explode"
|
|
|
+ , SummaryArgs(table_name = "company_send_announcement_explode"
|
|
|
, companyIdField = "plaintiff_info_id_explode"
|
|
|
, distinctField = "rowkey,plaintiff_info_id_explode"
|
|
|
, where = "plaintiff_info_id_explode is not null and length(plaintiff_info_id_explode) = 32 "
|
|
@@ -464,7 +220,7 @@ object CompanySummaryNg_new {
|
|
|
, ("1", s"company_send_announcement_del_1_plaintiff")
|
|
|
))
|
|
|
)
|
|
|
- , company_summary_args(table_name = "company_send_announcement_explode"
|
|
|
+ , SummaryArgs(table_name = "company_send_announcement_explode"
|
|
|
, companyIdField = "defendant_info_id_explode"
|
|
|
, distinctField = "rowkey,defendant_info_id_explode"
|
|
|
, where = "defendant_info_id_explode is not null and length(defendant_info_id_explode) = 32 "
|
|
@@ -472,7 +228,7 @@ object CompanySummaryNg_new {
|
|
|
("0", s"company_send_announcement_del_0_defendant")
|
|
|
, ("1", s"company_send_announcement_del_1_defendant")
|
|
|
))
|
|
|
- ), company_summary_args(table_name = "company_zxr_final_case"
|
|
|
+ ), SummaryArgs(table_name = "company_zxr_final_case"
|
|
|
, companyIdField = "keyno"
|
|
|
, where = "keyno is not null and length(keyno) = 32 "
|
|
|
, groupByInfo = GroupByInfoNg(field = "deleted", value_alias = Seq(
|
|
@@ -481,7 +237,7 @@ object CompanySummaryNg_new {
|
|
|
))
|
|
|
)
|
|
|
|
|
|
- , company_summary_args(table_name = "company_court_register_explode"
|
|
|
+ , SummaryArgs(table_name = "company_court_register_explode"
|
|
|
, companyIdField = "plaintiff_info_id_explode"
|
|
|
, distinctField = "rowkey,plaintiff_info_id_explode"
|
|
|
, where = "plaintiff_info_id_explode is not null and length(plaintiff_info_id_explode) = 32 "
|
|
@@ -491,7 +247,7 @@ object CompanySummaryNg_new {
|
|
|
))
|
|
|
)
|
|
|
|
|
|
- , company_summary_args(table_name = "company_court_register_explode"
|
|
|
+ , SummaryArgs(table_name = "company_court_register_explode"
|
|
|
, companyIdField = "defendant_info_id_explode"
|
|
|
, distinctField = "rowkey,defendant_info_id_explode"
|
|
|
, where = "defendant_info_id_explode is not null and length(defendant_info_id_explode) = 32 "
|
|
@@ -503,7 +259,7 @@ object CompanySummaryNg_new {
|
|
|
|
|
|
// ====================================================
|
|
|
|
|
|
- , company_summary_args(table_name = "bankruptcy_open_case_explode"
|
|
|
+ , SummaryArgs(table_name = "bankruptcy_open_case_explode"
|
|
|
, companyIdField = "applicant_info_id_explode"
|
|
|
, distinctField = "rowkey,applicant_info_id_explode"
|
|
|
, where = "applicant_info_id_explode is not null and length(applicant_info_id_explode) = 32 "
|
|
@@ -513,7 +269,7 @@ object CompanySummaryNg_new {
|
|
|
))
|
|
|
)
|
|
|
|
|
|
- , company_summary_args(table_name = "bankruptcy_open_case_explode"
|
|
|
+ , SummaryArgs(table_name = "bankruptcy_open_case_explode"
|
|
|
, companyIdField = "respondent_info_id_explode"
|
|
|
, distinctField = "rowkey,respondent_info_id_explode"
|
|
|
, where = "respondent_info_id_explode is not null and length(respondent_info_id_explode) = 32 "
|
|
@@ -541,7 +297,7 @@ object CompanySummaryNg_new {
|
|
|
, get_default_summary_args("company_brief_cancel_announcement", "company_id")
|
|
|
, get_default_summary_args("company_double_random_check_info", "company_id")
|
|
|
|
|
|
- , company_summary_args(table_name = "auction_tracking_explode"
|
|
|
+ , SummaryArgs(table_name = "auction_tracking_explode"
|
|
|
, companyIdField = "company_info_id_explode"
|
|
|
, distinctField = "rowkey,company_info_id_explode"
|
|
|
, where = "company_info_id_explode is not null and length(company_info_id_explode) = 32 "
|
|
@@ -564,7 +320,7 @@ object CompanySummaryNg_new {
|
|
|
)
|
|
|
|
|
|
val spark = SparkUtils.InitEnv(getClass.getSimpleName, config)
|
|
|
- CompanySummaryNg_new(s = spark, project = "winhc_ng", args = start_args).calc()
|
|
|
+ WinhcNgSummary_new(s = spark, project = "winhc_ng", target_tab = "winhc_ng.out_es_summary", args = start_args).calc()
|
|
|
spark.stop()
|
|
|
}
|
|
|
}
|