Closed AaronCoquet-Easypark closed 9 months ago
Hi there @AaronCoquet-Easypark, thanks for taking the time to open this feature request!
You mentioned that you're renaming tables in order to union -- if/when the package will union them for you, would you still need to rename any singular tables? If so, this will be a little tricky...if not, https://github.com/fivetran/dbt_apple_search_ads_source/issues/46 should be merged in 2-3 weeks
Another alternative for the time being could be adjusting how you rename the unioned tables. If you were to keep the table names and store them in a separate apple_search_ads_unioned
schema, you could provide that schema to the package's apple_search_ads_schema
var
My current process is this: Setup:
dbt-fivetran
), one not (dbt
)Process:
dbt-fivetran
project
"SELECT * FROM ASA_one.table_name UNION ALL SELECT * FROM ASA_two.table_name" > ASA.table_name_unioned
(_unioned suffix because dbt doesn't like having multiple tables with the same name in the project)dbt-fivetran
(unioned tables) is placed in the apple_search_ads
schemadbt
project, the fivetran/apple_search_ads
package is pointed at the unioned tablesNotes:
@AaronCoquet-Easypark Ah I see. Then I think that the package will do this for you pending the merge of https://github.com/fivetran/dbt_apple_search_ads_source/pull/45
If you'd like to try it out beforehand here's the branch info!
# packages.yml
packages:
- git: https://github.com/fivetran/dbt_apple_search_ads_source.git
revision: MagicBot/add-union-schema
warn-unpinned: false
A branch of the same name also exists in the transform package if you'd like to try it out with the downstream end models. The transform branch points to the working branch of the source package, so you'd just need this
# packages.yml
packages:
- git: https://github.com/fivetran/dbt_apple_search_ads.git
revision: MagicBot/add-union-schema
warn-unpinned: false
the above feature has been added and merged (to all the Ad Reporting packages as well), so i will close out this issue for now, but please feel free to reopen if the current solution doesn't work for your use case!
Is there an existing feature request for this?
Describe the Feature
Currently (v.0.2.2), if one wants to override the default source table name for a Fivetran-synced ASA table, one needs to set a variable in their
dbt_proect.yml
like so:(Taken from the Readme). However, if one is changing ONE table's name, it's likely because they are changing ALL of the table names (IE, to match a naming convention). To this end, it would be much easier (and more resilient to change) if there were an option to set a prefix and/or suffix variable for these overrides. Something like:
This would allow for the following logic to be used when finding tables:
Describe alternatives you've considered
The same can be achieved by setting every source override individually, which is what I've currently done.
Are you interested in contributing this feature?
Anything else?
Scope of this feature will probably change if/when #46 is sorted, since the renaming (in my case, at least) is due to unioning multiple models.