Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions mimic-iv/concepts/validate_concepts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ fail=0
missing=0
while read -r tbl; do
[ -z "${tbl}" ] && continue
if ! grep -q "^${tbl}," <<< "${ACTUAL}"; then
# exact field match (regex grep can false-hit prefixes)
if ! awk -F, -v t="${tbl}" '$1 == t { found=1 } END { exit !found }' <<< "${ACTUAL}"; then
echo "MISSING: expected table ${DATASET}.${tbl} was not built"
missing=1
fail=1
Expand All @@ -47,7 +48,7 @@ empty=0
while IFS=, read -r tbl rows; do
[ -z "${tbl}" ] && continue
# only validate the tables we actually build (ignore _metadata and any strays)
if grep -qx "${tbl}" <<< "${EXPECTED}" && [ "${rows}" -eq 0 ]; then
if grep -Fxq "${tbl}" <<< "${EXPECTED}" && [ "${rows:-}" -eq 0 ]; then
echo "EMPTY: table ${DATASET}.${tbl} has 0 rows"
empty=1
fail=1
Expand Down
Loading