File tree Expand file tree Collapse file tree 4 files changed +36
-6
lines changed Expand file tree Collapse file tree 4 files changed +36
-6
lines changed Original file line number Diff line number Diff line change 4141 dest : /usr/local/hive-sre/bin
4242 mode : 0755
4343
44+ - name : Copy parts
45+ copy :
46+ src : ../src/main/bash/get_part_ids.sh
47+ dest : /usr/local/hive-sre/bin
48+ mode : 0755
49+
50+ - name : Copy missing parts
51+ copy :
52+ src : ../src/main/bash/mysql_missing_parts.sh
53+ dest : /usr/local/hive-sre/bin
54+ mode : 0755
55+
4456 - name : Copy lib
4557 copy :
4658 src : ../target/hive-sre-shaded.jar
6678 dest : /usr/local/bin/hive-sre-cli
6779 mode : 0755
6880 state : link
81+
82+ - name : Link Parts
83+ file :
84+ src : /usr/local/hive-sre/bin/get_part_ids.sh
85+ dest : /usr/local/bin/get_part_ids.sh
86+ mode : 0755
87+ state : link
88+
89+ - name : Link Missing Parts
90+ file :
91+ src : /usr/local/hive-sre/bin/mysql_missing_parts.sh
92+ dest : /usr/local/bin/mysql_missing_parts.sh
93+ mode : 0755
94+ state : link
Original file line number Diff line number Diff line change 2222
2323 <groupId >com.cloudera.utils.hive</groupId >
2424 <artifactId >hive-sre</artifactId >
25- <version >3.0.1.3 </version >
25+ <version >3.0.1.4 </version >
2626
2727 <name >hive-sre</name >
2828
Original file line number Diff line number Diff line change @@ -5,16 +5,20 @@ PARTIDS=()
55# Build a list of id's that can be added to an 'in' clause
66# in SQL to modify the need tables.
77
8- while IFS=" |" read -r one two three four five six
8+ awk ' match($0, /\| [0-9]+ \|/) {
9+ print substr($0, RSTART, RLENGTH)
10+ }' $1 > $1 .part
11+
12+ while IFS=" " read -r one two three
913do
10- nospaces=${six // } # remove leading spaces
14+ nospaces=${two // } # remove leading spaces
1115
1216 re=' ^[0-9]+$'
1317 if [[ $nospaces =~ $re ]] ; then
1418 # echo "$nospaces"
1519 PARTIDS+=(" $nospaces " )
1620 fi
17- done < <( grep ^ \| $1 )
21+ done < $1 .part
1822
1923arraylength=${# PARTIDS[@]}
2024# echo "Total Partition Ids: $arraylength"
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ echo "Temp Dir: $TMPDIR"
88
99$( dirname $0 ) /get_part_ids.sh $1 $TMPDIR /part_ids.txt
1010
11- while IFS= " | " read -r line
11+ for line in ` cat $TMPDIR /part_ids.txt `
1212do
1313 echo " Line: $line "
1414 # PART_COL_PRIVS
2323 echo " DELETE FROM PARTITION_PARAMS WHERE PART_ID IN ($line );" >> mysql_missing_parts.sql
2424 # PARTITIONS
2525 echo " DELETE FROM PARTITIONS WHERE PART_ID IN ($line );" >> mysql_missing_parts.sql
26- done < $TMPDIR /part_ids.txt
26+ done
You can’t perform that action at this time.
0 commit comments