dbt-labs / dbt-spark

dbt-spark contains all of the code enabling dbt to work with Apache Spark and Databricks
https://getdbt.com
Apache License 2.0
405 stars 227 forks source link

[ADAP-702] [Feature] Allow user to specify location directly (instead of concatenating `location_root` and `alias`) #834

Open timvw opened 1 year ago

timvw commented 1 year ago

Is this your first time submitting a feature request?

Describe the feature

Currently we have a location_clause macro in place which calculates the location where the data should be stored as {{ location_root }}/{{ identifier }}.

It would be nice to be able to specify location directly (independent of location_root and identifier). Eg: we have naming conventions where the tables are name blah_blah and locations are s3://bucket/blah-blah.

Describe alternatives you've considered

We could not implement this and push this to user-space

Who will this benefit?

Anyone that wants to specify a location that is not the result of concatenating location_root and identifier.

Are you interested in contributing this feature?

Yes

Anything else?

dbeatty10 commented 1 year ago

Thanks for raising this idea @timvw 💡 !

Would you be willing to share the code for your location_clause macro in addition to examples using it? And also an example of how you are proposing to specify the location directly instead?

That way, we can take a look at your proposal vs. the alternative you are using currently.

timvw commented 1 year ago

The existing implementation of location_clause and the difference with my proposal can be found here: https://github.com/dbt-labs/dbt-spark/pull/835/files

Usage is straightforward, simply add a location parameter to your model config:

models:
  - name: model_a
    config:
      format: delta
      location: 's3://bucket/sourcesystem/conformed/model-a'
...

Without this feature we would be forced to rename our model to model-a..

dbeatty10 commented 1 year ago

Thanks for this example and explanation @timvw !

What do you think @dataders? Do you see this as tying into https://github.com/dbt-labs/dbt-core/discussions/8617 at all?

github-actions[bot] commented 7 months ago

This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days.