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
Apache Spark Quick Start Guide

You're reading from  Apache Spark Quick Start Guide

Product type Book
Published in Jan 2019
Publisher Packt
ISBN-13 9781789349108
Pages 154 pages
Edition 1st Edition
Languages
Authors (2):
Shrey Mehrotra Shrey Mehrotra
Profile icon Shrey Mehrotra
Akash Grade Akash Grade
Profile icon Akash Grade
View More author details

Caching and checkpointing

Caching and checkpointing are some of the important features of Spark. These operations can improve the performance of your Spark jobs significantly.

Caching

Caching data into memory is one of the main features of Spark. You can cache large datasets in-memory or on-disk depending upon your cluster hardware. You can choose to cache your data in two scenarios:

  • Use the same RDD multiple times
  • Avoid reoccupation of an RDD that involves heavy computation, such as join() and groupByKey()

If you want to run multiple actions of an RDD, then it will be a good idea to cache it into the memory so that recompilation of this RDD can be avoided. For example, the following code first takes out a few elements...

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}