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.
Handle DML operations in Delta tables - Databricks Tutorial
From the course: Complete Guide to Databricks for Data Engineering
Handle DML operations in Delta tables
- [Instructor] Delta table provides lots of functionality which is not provided by a normal Spark table. We cannot do the DML operations on our normal Spark tables. However, we can do this onto the Delta tables. How we can do that? Let's just go back to our Delta Lake notebook and see how we can apply all these DML operations. Go to the Recent tab, and let me open this notebook. If you just see this, our retaildb.customer_delta table, I just use display(spark.sql), and under that, I will say, "Select * from retaildb.customer_delta." There's one extra inverted comma, let me remove that and execute. We get the our table data. Now you can see that right now there are 1,000 rows inside it. Or you can do here as well if you are not very sure, let me just copy this. You can also do here count(*) to just see the exact count of the number of rows. So you can see that we got 1,000 rows. Now what I'm trying to do now is I'm trying to add a one new row inside it. And how I can do it? I can do it…
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.