cancel
Showing results for 
Search instead for 
Did you mean: 
Community Platform Discussions
Connect with fellow community members to discuss general topics related to the Databricks platform, industry trends, and best practices. Share experiences, ask questions, and foster collaboration within the community.
cancel
Showing results for 
Search instead for 
Did you mean: 

spark_partition_id() - User does not have permission SELECT on anonymous function

jes
New Contributor II

I'm trying to verify the partitions assigned to rows.

I'm running something like this:

from pyspark.sql.functions  import spark_partition_id

df = spark.read.table("some.uc.table").limit(10)
df = df.repartition(2)
df = df.withColumn("partitionid", spark_partition_id())
display(df)

The results in: 

Insufficient privileges: User does not have permission SELECT on anonymous function

This really seems like a bug that needs get fixed. 

2 REPLIES 2

Alberto_Umana
Databricks Employee
Databricks Employee

Hello @jes,

I have validate your failure internally and found that there is already an internal request to address this behavior. 

Are you using a shared access mode cluster? As this behavior does not look to be observed when using single access mode.

For now the workaround would be: GRANT SELECT ON ANONYMOUS FUNCTION TO `user`

I will keep you all posted once fix is released.

jes
New Contributor II

Thanks for looking into it.

Yes, it is a shared cluster we use as a dev cluster for creating our pipelines.  I suppose we will try to apply the workaround you shared 👍

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