From the course: Complete Guide to Databricks for Data Engineering
Unlock this course with a free trial
Join today to access over 24,600 courses taught by industry experts.
Read a Parquet file in Databricks - Databricks Tutorial
From the course: Complete Guide to Databricks for Data Engineering
Read a Parquet file in Databricks
- [Instructor] Now it's time to read the parquet file. To read this parquet file, let's create a new notebook. Click on Plus and click on Notebook. Let's give the Notebook name. I call it like transaction analysis. Now we need the path of this parquet file. So for that, let's just go back to the catalog. Click on Browse DBFS, and here is my parquet file. I will just right click on this, copy path, and I will copy the path. And let's just go back to our notebook. You can click on recent tabs and there you'll see recent files. So this is our transaction analysis file. Let's open that notebook. And to read the parquet file, the code would be spark dot read dot parquet. And in fact, you give the file path. And this is a file path. I don't need to give slash DBFS so I just remove that. And that's it. I'm ready to read the file. And I'm just using a display function to see it. Let's execute this. Again, a cluster get automatically attached to it. That will execute this notebook. And we can…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.