|
@@ -303,7 +303,7 @@ case class JudicialCaseRelationPreNew(s: SparkSession, project: String, ds: Stri
|
|
spark.udf.register("name_aggs", new NameAggs(1000))
|
|
spark.udf.register("name_aggs", new NameAggs(1000))
|
|
spark.udf.register("case_reason", new CaseReasonAggs(1000))
|
|
spark.udf.register("case_reason", new CaseReasonAggs(1000))
|
|
//预处理数据
|
|
//预处理数据
|
|
- val cols = Seq("flag", "date", "detail_id","name")
|
|
|
|
|
|
+ val cols = Seq("flag", "date", "detail_id", "name")
|
|
val t1 = s"$project.inc_ads_company_court_announcement"
|
|
val t1 = s"$project.inc_ads_company_court_announcement"
|
|
val t2 = s"ads_judicial_case_relation_pre"
|
|
val t2 = s"ads_judicial_case_relation_pre"
|
|
var t2_ds = ds
|
|
var t2_ds = ds
|
|
@@ -508,7 +508,7 @@ case class JudicialCaseRelationPreNew(s: SparkSession, project: String, ds: Stri
|
|
s"""
|
|
s"""
|
|
|INSERT ${if (isWindows) "INTO" else "OVERWRITE"} TABLE winhc_eci.ads_judicial_case_relation_r1
|
|
|INSERT ${if (isWindows) "INTO" else "OVERWRITE"} TABLE winhc_eci.ads_judicial_case_relation_r1
|
|
|SELECT
|
|
|SELECT
|
|
- | x.judicase_id ,
|
|
|
|
|
|
+ | concat_ws('',x.judicase_id,${t1_ds.substring(2)}) judicase_id,
|
|
| title ,
|
|
| title ,
|
|
| case_type ,
|
|
| case_type ,
|
|
| case_reason ,
|
|
| case_reason ,
|
|
@@ -563,8 +563,8 @@ case class JudicialCaseRelationPreNew(s: SparkSession, project: String, ds: Stri
|
|
s"""
|
|
s"""
|
|
|INSERT ${if (isWindows) "INTO" else "OVERWRITE"} TABLE winhc_eci.ads_judicial_case_relation_r2
|
|
|INSERT ${if (isWindows) "INTO" else "OVERWRITE"} TABLE winhc_eci.ads_judicial_case_relation_r2
|
|
|SELECT
|
|
|SELECT
|
|
- | id ,
|
|
|
|
- | x.judicase_id ,
|
|
|
|
|
|
+ | id,
|
|
|
|
+ | concat_ws('',x.judicase_id,${t1_ds.substring(2)}) judicase_id,
|
|
| title ,
|
|
| title ,
|
|
| case_type ,
|
|
| case_type ,
|
|
| case_reason ,
|
|
| case_reason ,
|
|
@@ -579,7 +579,7 @@ case class JudicialCaseRelationPreNew(s: SparkSession, project: String, ds: Stri
|
|
| y.deleted
|
|
| y.deleted
|
|
|FROM
|
|
|FROM
|
|
|(
|
|
|(
|
|
- |SELECT md5(concat_ws('',judicase_id,CLEANUP(case_no))) id
|
|
|
|
|
|
+ |SELECT md5(concat_ws('',concat_ws('',judicase_id,${t1_ds.substring(2)}),CLEANUP(case_no))) id
|
|
| ,judicase_id
|
|
| ,judicase_id
|
|
| ,max(first_title) title
|
|
| ,max(first_title) title
|
|
| ,case_type(max(case_no)) as case_type
|
|
| ,case_type(max(case_no)) as case_type
|