cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Permission denied on schema evolution view

Sinkrad
New Contributor II

Hey Databricks community,

We are registering views in Databricks with schema evolution, however these views fail when a user (other than the owner) is the first to query the view after the schema change.

PERMISSION_DENIED: User is not an owner of Table '<domain>.<schema>.<view>'.

I had a look in the access log and it appears that if someone queries the view after a schema change, the view definition (columns) is updated. This update action can only be performed by the owner of the view and hence if any other user queries the view, the above error is thrown.

I was wondering if someone already encountered this error and found a solution

Example code leading to the error

 

create table <catalog>.<schema>.<table> location '<external storage location>'
create view <catalog>.<schema>.<view> with schema evolution as select * from <catalog>.<schema>.<table>

# <-- Make any schema change to the delta table in the external location

Select * from <catalog>.<schema>.<view> # Perform this query with another identity than the one creating the table

 

1 ACCEPTED SOLUTION

Accepted Solutions

Alberto_Umana
Databricks Employee
Databricks Employee

Hi @Sinkrad,

There is an internal case about this: ES-1260035, and a fix is going to be out for this quarter. The behavior where only the view owner can update the view definition after a schema change is not intended. It is expected that the view should automatically handle schema evolution without requiring the view owner to perform the first query.

View solution in original post

1 REPLY 1

Alberto_Umana
Databricks Employee
Databricks Employee

Hi @Sinkrad,

There is an internal case about this: ES-1260035, and a fix is going to be out for this quarter. The behavior where only the view owner can update the view definition after a schema change is not intended. It is expected that the view should automatically handle schema evolution without requiring the view owner to perform the first query.

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group