Dear All
I'm investigating missing privileges for some of our users.
When connecting to an Oracle database via JDBC and attempting to display a DataFrame, we encounter the following error:
User does not have permission SELECT on any file. SQLSTATE: 42501
This issue only occurs for regular users running on Shared Cluster Compute. However:
It works fine when the same users switch to Personal Compute.
Additionally, when an admin runs the same code on Shared Cluster Compute, there is no issue
- It also works when calling some different API and displaying data using Shared Cluster Compute.
As a workaround, I executed the following command based on the guidance from the Databricks documentation: User does not have permission SELECT on ANY File - Databricks:
GRANT SELECT ON ANY FILE TO `<user@domain-name>`
This resolved the issue and the user can now view the DataFrame. However, I'm unsure if granting access to ANY FILE is the appropriate or most secure solution. Ideally, I'd like to identify and assign the specific, minimal permissions required instead of using such a broad grant.
Could you please advise on the correct or recommended privilege to use in this case?
Code:
df = spark.read.format("jdbc") \
.option("url", jdbc_url) \
.option("user", user) \
.option("password", password) \
.option("dbtable", table_name) \
.option("driver", "oracle.jdbc.driver.OracleDriver") \
.load()
display(df)
Thanks