Skip to content

Commit e892afd

Browse files
committed
add fix for bug when ed data in same dir
1 parent 46e9f9e commit e892afd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

mimic-iv/buildmimic/duckdb/import_duckdb.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,13 @@ make_table_name () {
9797
# load data into database
9898
find "$MIMIC_DIR" -type f -name '*.csv???' | sort | while IFS= read -r FILE; do
9999
make_table_name "$FILE"
100+
101+
# skip directories which we do not expect in mimic-iv
102+
# avoids syntax errors if mimic-iv-ed in the same dir
103+
case $DIRNAME in
104+
(hosp|icu) ;; # OK
105+
(*) continue;
106+
esac
100107
echo "Loading $FILE .. \c"
101108
try duckdb "$OUTFILE" <<-EOSQL
102109
COPY $TABLE_NAME FROM '$FILE' (HEADER);

0 commit comments

Comments
 (0)