Conversation
redshift external tables are not listed in information_schema.tables but we can extract the same info from svv_external tables and union the results. also quote database name as redshift allows dashes which require quotes
|
Hey @brendan-cook-87, I've had a look at this (sorry for the delay!) and I think that this is actually functionality that should be provided by dbt Core directly. I've opened an issue and will see what they reckon! |
|
This PR has been marked as Stale because it has been open with no activity as of late. If you would like the PR to remain open, please comment on the PR or else it will be closed in 7 days. |
|
Although we are closing this PR as stale, it can still be reopened to continue development. Just add a comment to notify the maintainers. |
|
@joellabes any chance we can still merge this as there is zero traction after 10 months on the other issue raised? |
|
@brendan-cook-87 native support in core should be coming in 1.8 but yeah let's get this in for now! |
redshift external tables are not listed in information_schema.tables but we can extract the same info from svv_external tables and union the results. also quote database name as redshift allows dashes which require quotes
resolves #752
This is a:
All pull requests from community contributors should target the
mainbranch (default).Description & motivation
external tables in redshift are not listed in information_schema.tables
they are listed in svv_external_tables
so that this macro works as expected (lists all tables in the specified schema, whether external or not)
there is a new dispatch for redshift__get_tables_by_pattern_sql which calls the default macro
and unions the result with the same information (with the same pattern matching) from svv_external_tables.
redshift also allows dashes in database names, which the macro does not quote, so can generate invalid sql.
Checklist
star()source)limit_zero()macro in place of the literal string:limit 0dbt.type_*macros instead of explicit datatypes (e.g.dbt.type_timestamp()instead ofTIMESTAMP