|
@@ -113,6 +113,8 @@ case class CreditPunishmentCaseAgg(s: SparkSession
|
|
| )
|
|
| )
|
|
| )
|
|
| )
|
|
|WHERE num = 1
|
|
|WHERE num = 1
|
|
|
|
+ |AND court_name is not null
|
|
|
|
+ |AND trim(court_name) <> ''
|
|
|""".stripMargin)
|
|
|""".stripMargin)
|
|
.createTempView(tmp_view)
|
|
.createTempView(tmp_view)
|
|
} else {
|
|
} else {
|
|
@@ -144,6 +146,8 @@ case class CreditPunishmentCaseAgg(s: SparkSession
|
|
| )
|
|
| )
|
|
| )
|
|
| )
|
|
|WHERE num = 1
|
|
|WHERE num = 1
|
|
|
|
+ |AND court_name is not null
|
|
|
|
+ |AND trim(court_name) <> ''
|
|
|""".stripMargin)
|
|
|""".stripMargin)
|
|
.createTempView(tmp_view)
|
|
.createTempView(tmp_view)
|
|
}
|
|
}
|
|
@@ -264,14 +268,12 @@ case class CreditPunishmentCaseAgg(s: SparkSession
|
|
| ,cast(mm['deleted'] as bigint) AS deleted
|
|
| ,cast(mm['deleted'] as bigint) AS deleted
|
|
| ,mm['all_rowkey'] AS all_rowkey
|
|
| ,mm['all_rowkey'] AS all_rowkey
|
|
|FROM (
|
|
|FROM (
|
|
- | SELECT name
|
|
|
|
- | ,court_name
|
|
|
|
- | ,case_no
|
|
|
|
|
|
+ | SELECT collect_set(name)[0] as name
|
|
|
|
+ | ,collect_set(court_name)[0] as court_name
|
|
|
|
+ | ,collect_set(case_no)[0] as case_no
|
|
| ,credit_punishment_case_agg(rowkey,tn,keyno,card_num,case_create_time,deleted,detail_data) AS mm
|
|
| ,credit_punishment_case_agg(rowkey,tn,keyno,card_num,case_create_time,deleted,detail_data) AS mm
|
|
| FROM $org_tab
|
|
| FROM $org_tab
|
|
- | GROUP BY name
|
|
|
|
- | ,court_name
|
|
|
|
- | ,case_no
|
|
|
|
|
|
+ | GROUP BY cleanup(concat_ws('',name,court_name,case_no))
|
|
| )
|
|
| )
|
|
|WHERE name IS NOT NULL and trim(name) <> ''
|
|
|WHERE name IS NOT NULL and trim(name) <> ''
|
|
|""".stripMargin
|
|
|""".stripMargin
|