Skip to content
This repository has been archived by the owner on Aug 23, 2024. It is now read-only.

Commit

Permalink
Swap alias for table in extract script
Browse files Browse the repository at this point in the history
`table` is a reserved name / expression and can't be used as an alias
  • Loading branch information
dfsnow committed Feb 8, 2024
1 parent b4e8af6 commit b51a169
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/run-sqoop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ for TABLE in ${JOB_TABLES}; do
NUM_MAPPERS=$(($(date +%Y) - 1998))
NUM_MAPPERS=$((NUM_MAPPERS < MAX_MAPPERS ? NUM_MAPPERS : MAX_MAPPERS))
BOUNDARY_QUERY="SELECT MIN(TAXYR), MAX(TAXYR) FROM IASWORLD.${TABLE}"
QUERY="SELECT table.*, SYS_EXTRACT_UTC(CURRENT_TIMESTAMP) AS loaded_at
FROM IASWORLD.${TABLE} table
QUERY="SELECT t.*, SYS_EXTRACT_UTC(CURRENT_TIMESTAMP) AS loaded_at
FROM IASWORLD.${TABLE} t
WHERE \$CONDITIONS"
else
# Make number of mappers roughly equal to number of tax years
Expand All @@ -59,8 +59,8 @@ for TABLE in ${JOB_TABLES}; do
NUM_MAPPERS=$((NUM_MAPPERS < MAX_MAPPERS ? NUM_MAPPERS : MAX_MAPPERS))
BOUNDARY_QUERY="SELECT MIN(TAXYR), MAX(TAXYR) FROM IASWORLD.${TABLE}
WHERE TAXYR ${QUERY_COND} ${QUERY_YEAR}"
QUERY="SELECT table.*, SYS_EXTRACT_UTC(CURRENT_TIMESTAMP) AS loaded_at
FROM IASWORLD.${TABLE} table
QUERY="SELECT t.*, SYS_EXTRACT_UTC(CURRENT_TIMESTAMP) AS loaded_at
FROM IASWORLD.${TABLE} t
WHERE TAXYR ${QUERY_COND} ${QUERY_YEAR}
AND \$CONDITIONS"
fi
Expand Down

0 comments on commit b51a169

Please sign in to comment.