left-join tables¶
from Left-joining a datasource > prevent column collisions by prepending the table name to each column name
- add subdir:
make inputs/$datasrc/'taxon_observation.**'/add "cp" -f inputs/VegBank/'taxon_observation.**'/{run,postprocess.sql} inputs/$dest/'taxon_observation.**'/ # add new-style import files echo 'taxon_observation.**' >>inputs/$datasrc/import_order.txt
- edit
postprocess.sql
:- change the table names to those of the datasource
- set the
sort_col
(the first column in the view) to be a joined table's pkey
- install the view:
inputs/$datasrc/'taxon_observation.**'/run # fix bugs and repeat until it has a successful exit status
- prevent joined tables from also being imported (after the left-join above is successful)
# create a blank file named _no_import in each table subdir for table in $(grep -vF -e Source -e 'taxon_observation.**' inputs/$datasrc/import_order.txt); do "cp" -f inputs/FIA/COND/_no_import inputs/$datasrc/$table/ done