File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#! /bin/bash
22# This script copies the concepts in the BigQuery table mimiciv_derived to mimiciv_${VERSION}_derived.
3- if [ -z " $$ 1" ]; then
3+ if [ -z " $1 " ]; then
44 echo " Usage: $0 <version>"
55 exit 1
66fi
77export SOURCE_DATASET=mimiciv_derived
8- export TARGET_DATASET=mimiciv_$1 _derived
8+ export TARGET_DATASET=" mimiciv_${1} _derived "
99export PROJECT_ID=physionet-data
1010
1111# check if the target dataset exists
@@ -19,11 +19,11 @@ if bq ls --datasets --project_id ${PROJECT_ID} | grep -q ${TARGET_DATASET}; then
1919 if [[ " ${TABLE: 0: 2} " == ' --' ]]; then
2020 continue
2121 fi
22- bq rm -f -q ${PROJECT_ID} :${TARGET_DATASET} .${TABLE}
22+ bq rm -f -q " ${PROJECT_ID} :${TARGET_DATASET} .${TABLE} "
2323 done
2424else
2525 echo " Creating dataset ${PROJECT_ID} :${TARGET_DATASET} "
26- bq mk --dataset ${PROJECT_ID} :${TARGET_DATASET}
26+ bq mk --dataset " ${PROJECT_ID} :${TARGET_DATASET} "
2727fi
2828
2929echo " Copying tables from ${SOURCE_DATASET} to ${TARGET_DATASET} ."
3333 if [[ " ${TABLE: 0: 2} " == ' --' ]]; then
3434 continue
3535 fi
36- bq cp -f -q ${PROJECT_ID} :${SOURCE_DATASET} .${TABLE} ${PROJECT_ID} :${TARGET_DATASET} .${TABLE}
36+ bq cp -f -q " ${PROJECT_ID} :${SOURCE_DATASET} .${TABLE} " " ${PROJECT_ID} :${TARGET_DATASET} .${TABLE} "
3737done
You can’t perform that action at this time.
0 commit comments