forked from D-Net/dnet-hadoop
Update finalizeImpalaCluster.sh
Drop views in shadow dbs before dropping the db
This commit is contained in:
parent
e06d962a6a
commit
4c770a5e29
|
@ -10,6 +10,12 @@ function createShadowDB() {
|
|||
SOURCE=$1
|
||||
SHADOW=$2
|
||||
|
||||
# drop views from db
|
||||
for i in `impala-shell -i impala-cluster-dn1.openaire.eu -d ${SHADOW} --delimited -q "show tables"`;
|
||||
do
|
||||
`impala-shell -i impala-cluster-dn1.openaire.eu -d -d ${SHADOW} -q "drop view $i;"`;
|
||||
done
|
||||
|
||||
impala-shell -i impala-cluster-dn1.openaire.eu -q "drop database ${SHADOW} CASCADE";
|
||||
impala-shell -i impala-cluster-dn1.openaire.eu -q "create database if not exists ${SHADOW}";
|
||||
# impala-shell -i impala-cluster-dn1.openaire.eu -d ${SHADOW} -q "show tables" | sed "s/^/drop view if exists ${SHADOW}./" | sed "s/$/;/" | impala-shell -i impala-cluster-dn1.openaire.eu -f -
|
||||
|
|
Loading…
Reference in New Issue