|
@@ -47,12 +47,29 @@ case class CreditPunishmentEntityAgg(s: SparkSession
|
|
} else {
|
|
} else {
|
|
rs.split(",").filter(r => r.split("@@")(0).equals(prefix))
|
|
rs.split(",").filter(r => r.split("@@")(0).equals(prefix))
|
|
.map(_.split("@@")(2))
|
|
.map(_.split("@@")(2))
|
|
- .toSeq.mkStringOrNull()
|
|
|
|
|
|
+ .distinct
|
|
|
|
+ .toSeq
|
|
|
|
+ .mkStringOrNull()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
spark.udf.register("get_rowkey_by_prefix", get_rowkey_by_prefix _)
|
|
spark.udf.register("get_rowkey_by_prefix", get_rowkey_by_prefix _)
|
|
|
|
|
|
|
|
+
|
|
|
|
+ def get_rowkey_by_prefix_by_count(rs: String, prefix: String, flag: String): Int = {
|
|
|
|
+ if (StringUtils.isEmpty(rs)) {
|
|
|
|
+ 0
|
|
|
|
+ } else {
|
|
|
|
+ rs.split(",").filter(r => r.split("@@")(0).equals(prefix) && r.split("@@")(1).equals(flag))
|
|
|
|
+ .map(_.split("@@")(2))
|
|
|
|
+ .distinct
|
|
|
|
+ .size
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ spark.udf.register("get_rowkey_by_prefix_count", get_rowkey_by_prefix_by_count _)
|
|
|
|
+
|
|
|
|
+
|
|
def get_gender(card_num: String): Int = {
|
|
def get_gender(card_num: String): Int = {
|
|
if (StringUtils.isEmpty(card_num)) {
|
|
if (StringUtils.isEmpty(card_num)) {
|
|
return -1
|
|
return -1
|
|
@@ -234,15 +251,15 @@ case class CreditPunishmentEntityAgg(s: SparkSession
|
|
| ,final_case_exec_amount
|
|
| ,final_case_exec_amount
|
|
| ,final_case_no_exec_amount
|
|
| ,final_case_no_exec_amount
|
|
|
|
|
|
|
|
- | ,company_dishonest_info_num_0
|
|
|
|
- | ,company_zxr_num_0
|
|
|
|
- | ,company_zxr_final_case_num_0
|
|
|
|
- | ,company_zxr_restrict_num_0
|
|
|
|
|
|
+ | ,get_rowkey_by_prefix_count(all_rowkey,'company_dishonest_info','0') as company_dishonest_info_num_0
|
|
|
|
+ | ,get_rowkey_by_prefix_count(all_rowkey,'company_zxr','0') as company_zxr_num_0
|
|
|
|
+ | ,get_rowkey_by_prefix_count(all_rowkey,'company_zxr_final_case','0') as company_zxr_final_case_num_0
|
|
|
|
+ | ,get_rowkey_by_prefix_count(all_rowkey,'company_zxr_restrict','0') as company_zxr_restrict_num_0
|
|
|
|
|
|
|
|
- | ,company_dishonest_info_num_1
|
|
|
|
- | ,company_zxr_num_1
|
|
|
|
- | ,company_zxr_final_case_num_1
|
|
|
|
- | ,company_zxr_restrict_num_1
|
|
|
|
|
|
+ | ,get_rowkey_by_prefix_count(all_rowkey,'company_dishonest_info','1') as company_dishonest_info_num_1
|
|
|
|
+ | ,get_rowkey_by_prefix_count(all_rowkey,'company_zxr','1') as company_zxr_num_1
|
|
|
|
+ | ,get_rowkey_by_prefix_count(all_rowkey,'company_zxr_final_case','1') as company_zxr_final_case_num_1
|
|
|
|
+ | ,get_rowkey_by_prefix_count(all_rowkey,'company_zxr_restrict','1') as company_zxr_restrict_num_1
|
|
|
|
|
|
|
|
| ,deleted
|
|
| ,deleted
|
|
| ,get_rowkey_by_prefix(all_rowkey,'company_dishonest_info') as company_dishonest_info_rowkey
|
|
| ,get_rowkey_by_prefix(all_rowkey,'company_dishonest_info') as company_dishonest_info_rowkey
|