union of n number of tables that starts with same prefix on a particular database and schema in DBT
I am trying to make macro in dbt that reads files from a specific database,schema and unions them.
So as first step I am storing all the table names from information schema in snowflake which has all tables that starts with GENERAL%.After this reading this in for loop and using source function to create relation which can be fed to dbt_utils.union_relations. Looks like this-