dbt-labs / dbt-athena

The athena adapter plugin for dbt (https://getdbt.com)
https://dbt-athena.github.io
Apache License 2.0
228 stars 100 forks source link

[Feature] Would it be possible to not specify the location so it inherits whatever is configured in the glue database location? #712

Open maduxi opened 2 months ago

maduxi commented 2 months ago

Is this your first time submitting a feature request?

Describe the feature

Currently there is a way to configure the table location based on several variables and strategies, but I couldn't find a way of not specifying it, so the Glue catalog would end up using the database location.

Describe alternatives you've considered

I'm using a workgroup without enforced output to control the location on dbt, but I couldn't find a way to not specify it.

Who will this benefit?

This would be interesting to decouple the location configuration from my dbt project. A benefit would be to point different schemas to different buckets.

Are you interested in contributing this feature?

It would be interesting, yes.

Anything else?

No response

nicor88 commented 2 months ago

@maduxi At the moment there is a possibility to not specify the s3 location, and it's using an athena workgroup with enforced parameters. Did you try that?

maduxi commented 2 months ago

Thank you for the reply, but that would require me to use different workgroups if I want schemas to go to different locations, right?

nicor88 commented 2 months ago

@maduxi yes correct. also, the feature that you requested might lead to substantial change, because for each model we need to pass the glue database where the table is going to be written, if the database has a not empty location, then we return the s3 location from the db, ideally we can control this behavior via a flag.

Long story short, databases must be a parameter of generate_s3_location, and there is definitely some code to touch - overall your feature could make sense, but if you want to do it, I suggest to add another flag to configure such behavior: s3_data_dir_from_glue_db: true.