Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
While reading csv file using spark and listing the files under a folder using data bricks utils, I am getting below error:
[INSUFFICIENT_PERMISSIONS] Insufficient privileges: User does not have permission SELECT on any file. SQLSTATE: 42501
File <command-1200317151894398>, line 21 spark_df = spark.read.csv("sample_csv.csv") ----> 2 display(spark_df)
File /databricks/python_shell/dbruntime/display.py:131, in Display.display(self, input, *args, **kwargs)129# This version is for Serverless + Spark Connect dogfooding.130elifself.spark_connect_enabled andisinstance(input, ConnectDataFrame): --> 131self.display_connect_table(input,**kwargs)132elifisinstance(input, ConnectDataFrame): ------ But able to read and write csv files using pandas in the same environment. Below is the code which I used:
import pandas as pd
df = pd.read_csv("sample_csv.csv")
sample_csv.csv is the file I created and I have "can manage" privilege on it.
Listing the files using dbutils too is giving same error. I have created the folder and I have "can manager" privilege on it.
ExecutionError: An error occurred while calling o415.ls. : org.apache.spark.SparkSecurityException: [INSUFFICIENT_PERMISSIONS] Insufficient privileges: User does not have permission SELECT on any file. SQLSTATE: 42501
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.