Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Optimizing Databricks Workloads

You're reading from  Optimizing Databricks Workloads

Product type Book
Published in Dec 2021
Publisher Packt
ISBN-13 9781801819077
Pages 230 pages
Edition 1st Edition
Languages
Authors (3):
Anirudh Kala Anirudh Kala
Profile icon Anirudh Kala
Anshul Bhatnagar Anshul Bhatnagar
Profile icon Anshul Bhatnagar
Sarthak Sarbahi Sarthak Sarbahi
Profile icon Sarthak Sarbahi
View More author details

Table of Contents (13) Chapters

Preface 1. Section 1: Introduction to Azure Databricks
2. Chapter 1: Discovering Databricks 3. Chapter 2: Batch and Real-Time Processing in Databricks 4. Chapter 3: Learning about Machine Learning and Graph Processing in Databricks 5. Section 2: Optimization Techniques
6. Chapter 4: Managing Spark Clusters 7. Chapter 5: Big Data Analytics 8. Chapter 6: Databricks Delta Lake 9. Chapter 7: Spark Core 10. Section 3: Real-World Scenarios
11. Chapter 8: Case Studies 12. Other Books You May Enjoy

Using Auto Optimize

Auto Optimize is a feature that helps us automatically compact small files while an individual writes to a delta table. Unlike bin-packing, we do not need to run a command every time Auto Optimize is executed. It consists of two components:

  • Optimized Writes: Databricks dynamically optimizes Spark partition sizes to write 128 MB chunks of table partitions.
  • Auto Compaction: Here, Databricks runs an optimized job when the data writing process has been completed and compacts small files. It tries to coalesce small files into 128 MB files. This works on data that has the greatest number of small files.

Next, we will learn about the Spark configurations for Auto Optimize and go through a worked-out example to understand how it works:

  1. To enable Auto Optimize for all new tables, we need to run the following Spark configuration code:
    %sql
    set spark.databricks.delta.properties.defaults.autoOptimize.optimizeWrite = true;
    set spark.databricks.delta...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}