amazon-redshift-utils
amazon-redshift-utils copied to clipboard
Error if 'destinationTableForceDropCreate' is TRUE but table not present
When running with params set to force drop and recreate on a first-time run with a fresh target DB, this fails since it finds no table to drop.
https://github.com/awslabs/amazon-redshift-utils/blob/d2aa42a6ff872164613af027543efdfe5d517dbe/src/UnloadCopyUtility/util/tasks.py#L185-L189
Combining the conditional statements worked:
if config_parameters['destinationTableForceDropCreate'] and self.target_resource.is_present():
I guess the other option is to not set params to force the drop/create, but there are situations where this could result in the opposite problem: some tables in the schema that should be recreated are not.