From the course: Complete Guide to Databricks for Data Engineering

Unlock this course with a free trial

Join today to access over 24,700 courses taught by industry experts.

Create Delta tables

Create Delta tables

- [Instructor] To create a delta lake, let's add one new notebook. I call this notebook as Delta-lake. Now again, to create a delta table, we need to have one data frame available. So let's again go back to our catalog, get the path of our customer file, and let's create the data frame using this customer CSV. So I copy the path and let's go back to our notebook. So I would say data frame is equal to spark.read.csv, I give the path, and then I will say inferSchema equal to true and header also equal to true. And that's it. Let's quickly see if this data frame got created successfully or not. There's a small typo on this header. Let me just add this, header instead of hyphen, equal, and let's execute. And here it comes. So we're going to use this data frame to create our delta table. Now, we can also create that database as well. So this time, rather than using the default database, let's create our database as well. So I call it like spark.sql and I will say create database and I give…

Contents