Skip to content

update_view_via_alter checks for ownership #1654

Description

@karasda

Describe the feature

In order to change the view via alter view as query you have to be owner of the table, which is more strict than create or replace as query. If your user/service principal is not owner it will fail (and stops the execution)

I would like dbt to have some fallback scenario (CVAS) in this case.

For us it is ok in production, where we have fixed service principal, but it is creating some troubles in dev as developers are reusing each others' objects. And if would want to change the prod service principal, all runs would start failing

Describe alternatives you've considered

Drop the view and recreate it if you do not have rights.

Additional context

I thought about these possibilities:

  1. somehow check the owner of view and compare with principal and in case of mismatch fallback to "CREATE or REPLACE" (and probably raise some warning)
  2. Try the usual ALTER VIEW as query and in case of raised error try fallback above.

Who will this benefit?

The developers during developement stage.

Are you interested in contributing this feature?

No.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions