Unable to read file from dbfs location in databricks.

Data_Engineer3
Contributor III

When i tried to read file from dbfs, it throws error - Caused by: FileReadException: Error while reading file dbfs:/.......................parquet is not a Parquet file. Expected magic number at tail [80, 65, 82, 49] but found [105, 108, 101, 115].

But I checked the file location and types and alll it shows Parquet format and data present inside. I couldn't get idea of it.

Hi @Kaniz Fatma (Databricks)​ ,

Command, I used spark.sql command to read table data, where data is getting stored as parquet format.

I am trying to read data from dbfs location, its a parquet file only. I have cross checked with by doing ls command file is present.

Are you able to list all the files in this folder location by using dbutils? You might need to read the Parquet file using the following examples https://docs.databricks.com/data/data-sources/read-parquet.html

View solution in original post

No, I am not able to read file by dbutils command itself. It throwing same error.