forked from dstreev/hdp3_upgrade_utils
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Overlapping Table check and 'Inverted' search to find bad files…
… that interfere with ACID conversion.
- Loading branch information
Showing
3 changed files
with
72 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
USE ${DB}; | ||
|
||
WITH D_TBL_LOCATIONS AS ( | ||
SELECT DISTINCT | ||
db_name | ||
, tbl_name | ||
, tbl_type | ||
, part_name | ||
, CASE | ||
WHEN PART_NAME IS NULL | ||
THEN regexp_extract(tbl_location, 'hdfs://([^/]+)(.*)', 2) | ||
WHEN PART_NAME IS NOT NULL | ||
THEN regexp_extract(part_location, 'hdfs://([^/]+)(.*)', 2) | ||
END AS tbl_location | ||
FROM | ||
hms_dump_${ENV} | ||
WHERE | ||
db_name != 'sys' | ||
AND db_name != 'information_schema' | ||
) | ||
SELECT | ||
tbl_location | ||
, SIZE(COLLECT_SET( | ||
CONCAT(db_name, ".", tbl_name, "[Partition:", NVL(part_name, "DEFAULT"), "]"))) AS TBL_PARTS_SHARING_LOCATION | ||
, COLLECT_SET(CONCAT(db_name, ".", tbl_name, "[Partition:", NVL(part_name, "DEFAULT"), "]", ":(", tbl_type, | ||
")")) AS DB_TBLS | ||
FROM | ||
D_TBL_LOCATIONS | ||
WHERE | ||
db_name != 'sys' | ||
AND db_name != 'information_schema' | ||
GROUP BY tbl_location | ||
HAVING | ||
SIZE(COLLECT_SET( | ||
CONCAT(db_name, ".", tbl_name, "[Partition:", NVL(part_name, "DEFAULT"), "]", ":(", tbl_type, ")"))) > | ||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,6 +57,6 @@ WITH sub AS ( | |
SELECT | ||
hdfs_path AS hcli_check | ||
FROM | ||
sub | ||
sub; | ||
WHERE | ||
conversion != "NO"; |