Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Optimizing Databricks Workloads

You're reading from   Optimizing Databricks Workloads Harness the power of Apache Spark in Azure and maximize the performance of modern big data workloads

Arrow left icon
Product type Paperback
Published in Dec 2021
Publisher Packt
ISBN-13 9781801819077
Length 230 pages
Edition 1st Edition
Languages
Concepts
Arrow right icon
Authors (3):
Arrow left icon
Anshul Bhatnagar Anshul Bhatnagar
Author Profile Icon Anshul Bhatnagar
Anshul Bhatnagar
Sarthak Sarbahi Sarthak Sarbahi
Author Profile Icon Sarthak Sarbahi
Sarthak Sarbahi
Anirudh Kala Anirudh Kala
Author Profile Icon Anirudh Kala
Anirudh Kala
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. Section 1: Introduction to Azure Databricks
2. Chapter 1: Discovering Databricks FREE CHAPTER 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

Learning partitioning strategies in Spark

In this section, we will discuss some of the useful strategies for Spark partitions and Apache Hive partitions. Whenever Spark processes data in memory, it breaks that data down into partitions, and these partitions are processed in the cores of the executors. These are the Spark partitions. On the other hand, Hive partitions help to organize persisted tables into parts based on columns.

Understanding Spark partitions

Before we learn about the strategies to manage Spark partitions, we need to know the number of partitions for any given DataFrame:

  1. To check the Spark partitions of a given DataFrame, we use the following syntax: dataframe.rdd.getNumPartitions(). Also, remember that the total number of tasks doing work on a Spark DataFrame is equal to the total number of partitions of that DataFrame.
  2. Next, we will learn how to check the number of records in each Spark partition. We will begin with re-creating the airlines DataFrame...
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 $19.99/month. Cancel anytime
Banner background image