|
@@ -30,7 +30,7 @@ case class CreditPunishmentEntityAgg(s: SparkSession
|
|
code2Name()
|
|
code2Name()
|
|
double_2_str()
|
|
double_2_str()
|
|
|
|
|
|
- def array_distinct(arr: Seq[String]): String = if (arr == null || arr.isEmpty) null else arr.distinct.mkString(",")
|
|
|
|
|
|
+ def array_distinct(arr: Seq[String]): String = if (arr == null || arr.isEmpty) null else arr.filter(StringUtils.isNotEmpty).distinct.mkString(",")
|
|
|
|
|
|
spark.udf.register("array_distinct", array_distinct _)
|
|
spark.udf.register("array_distinct", array_distinct _)
|
|
spark.udf.register("deleted_merge", new DeletedMergeUDF)
|
|
spark.udf.register("deleted_merge", new DeletedMergeUDF)
|
|
@@ -76,6 +76,9 @@ case class CreditPunishmentEntityAgg(s: SparkSession
|
|
| ,county STRING COMMENT '区'
|
|
| ,county STRING COMMENT '区'
|
|
| ,other_info STRING COMMENT '其他信息-公司或人的其它信息,json格式'
|
|
| ,other_info STRING COMMENT '其他信息-公司或人的其它信息,json格式'
|
|
| ,record_num bigint COMMENT '记录条数'
|
|
| ,record_num bigint COMMENT '记录条数'
|
|
|
|
+ |
|
|
|
|
+ | ,create_case_time_year string COMMENT '立案时间,年份,逗号分割'
|
|
|
|
+ |
|
|
| ,total_exec_amount STRING COMMENT '累计被执行总金额'
|
|
| ,total_exec_amount STRING COMMENT '累计被执行总金额'
|
|
| ,total_no_exec_amount STRING COMMENT '疑似当前欠款总金额'
|
|
| ,total_no_exec_amount STRING COMMENT '疑似当前欠款总金额'
|
|
| ,zxr_total_exec_amount STRING COMMENT '被执行人当前被执行总金额'
|
|
| ,zxr_total_exec_amount STRING COMMENT '被执行人当前被执行总金额'
|
|
@@ -187,6 +190,7 @@ case class CreditPunishmentEntityAgg(s: SparkSession
|
|
| ,array_distinct(split(CONCAT_WS(',',collect_set(label)),',')) AS label
|
|
| ,array_distinct(split(CONCAT_WS(',',collect_set(label)),',')) AS label
|
|
| --- ,sum(record_num) as record_num
|
|
| --- ,sum(record_num) as record_num
|
|
| ,count(1) as record_num
|
|
| ,count(1) as record_num
|
|
|
|
+ | ,array_distinct(collect_set(split(case_create_time,'-')[0])) AS case_create_time_year
|
|
| ,double_2_str(sum(CAST(total_exec_amount AS DOUBLE) )) AS total_exec_amount
|
|
| ,double_2_str(sum(CAST(total_exec_amount AS DOUBLE) )) AS total_exec_amount
|
|
| ,double_2_str(sum(CAST(total_no_exec_amount AS DOUBLE) )) AS total_no_exec_amount
|
|
| ,double_2_str(sum(CAST(total_no_exec_amount AS DOUBLE) )) AS total_no_exec_amount
|
|
| ,double_2_str(sum(CAST(zxr_total_exec_amount AS DOUBLE) )) AS zxr_total_exec_amount
|
|
| ,double_2_str(sum(CAST(zxr_total_exec_amount AS DOUBLE) )) AS zxr_total_exec_amount
|
|
@@ -225,6 +229,7 @@ case class CreditPunishmentEntityAgg(s: SparkSession
|
|
| ,get_county_name(t2.area_code) as county
|
|
| ,get_county_name(t2.area_code) as county
|
|
| ,company_other_info(legal_entity_id,legal_entity_name,legal_entity_type,reg_capital,reg_capital_amount,reg_capital_currency,to_millis_timestamp(t2.estiblish_time),logo) as other_info
|
|
| ,company_other_info(legal_entity_id,legal_entity_name,legal_entity_type,reg_capital,reg_capital_amount,reg_capital_currency,to_millis_timestamp(t2.estiblish_time),logo) as other_info
|
|
| ,record_num
|
|
| ,record_num
|
|
|
|
+ | ,case_create_time_year
|
|
| ,t1.total_exec_amount
|
|
| ,t1.total_exec_amount
|
|
| ,t1.total_no_exec_amount
|
|
| ,t1.total_no_exec_amount
|
|
| ,t1.zxr_total_exec_amount
|
|
| ,t1.zxr_total_exec_amount
|
|
@@ -262,6 +267,7 @@ case class CreditPunishmentEntityAgg(s: SparkSession
|
|
| ,get_county_name(SUBSTRING(card_num,0,6)) AS county
|
|
| ,get_county_name(SUBSTRING(card_num,0,6)) AS county
|
|
| ,person_other_info(get_birth_year(card_num),get_gender(card_num)) as other_info
|
|
| ,person_other_info(get_birth_year(card_num),get_gender(card_num)) as other_info
|
|
| ,record_num
|
|
| ,record_num
|
|
|
|
+ | ,case_create_time_year
|
|
| ,total_exec_amount
|
|
| ,total_exec_amount
|
|
| ,total_no_exec_amount
|
|
| ,total_no_exec_amount
|
|
| ,zxr_total_exec_amount
|
|
| ,zxr_total_exec_amount
|
|
@@ -295,6 +301,7 @@ case class CreditPunishmentEntityAgg(s: SparkSession
|
|
| ,null AS county
|
|
| ,null AS county
|
|
| ,null as other_info
|
|
| ,null as other_info
|
|
| ,record_num
|
|
| ,record_num
|
|
|
|
+ | ,case_create_time_year
|
|
| ,total_exec_amount
|
|
| ,total_exec_amount
|
|
| ,total_no_exec_amount
|
|
| ,total_no_exec_amount
|
|
| ,zxr_total_exec_amount
|
|
| ,zxr_total_exec_amount
|