dbt-labs/dbt-utils

Support "unaliasing" for the `star` macro when `relation_alias` is set

bmvi-kinver opened this issue · 2 comments

Describe the feature

I want to be able to "unalias" column names when relation_alias is specified. For example, if I have some relation users that has columns id and name, the following code

select
{{
    dbt_utils.star(
        from=ref("users"),
        relation_alias="u"
    )
}}
from {{ ref("users") }} u

produces a model model having columns u.id and u.name. I'd like to specify, somehow, that I want to keep the original column names.

Describe alternatives you've considered

There IS an existing solution to this problem. If I set suffix=" " (a single space), I get the behavior I desire, but it feels really hacky and I wouldn't count on this to work for future releases.

Who will this benefit?

Anyone who wants to keep the original column names from some relation in a join.

Are you interested in contributing this feature?

Yes! This should be fairly easy to implement, but I'm not sure what the desired implementation looks like.

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.

Although we are closing this issue as stale, it's not gone forever. Issues can be reopened if there is renewed community interest. Just add a comment to notify the maintainers.