Book Image

Apache Spark 2 for Beginners

By : Rajanarayanan Thottuvaikkatumana
Book Image

Apache Spark 2 for Beginners

By: Rajanarayanan Thottuvaikkatumana

Overview of this book

<p>Spark is one of the most widely-used large-scale data processing engines and runs extremely fast. It is a framework that has tools that are equally useful for application developers as well as data scientists.</p> <p>This book starts with the fundamentals of Spark 2 and covers the core data processing framework and API, installation, and application development setup. Then the Spark programming model is introduced through real-world examples followed by Spark SQL programming with DataFrames. An introduction to SparkR is covered next. Later, we cover the charting and plotting features of Python in conjunction with Spark data processing. After that, we take a look at Spark's stream processing, machine learning, and graph processing libraries. The last chapter combines all the skills you learned from the preceding chapters to develop a real-world Spark application.</p> <p>By the end of this book, you will have all the knowledge you need to develop efficient large-scale applications using Apache Spark.</p>
Table of Contents (15 chapters)
Apache Spark 2 for Beginners
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface

DataFrame programming


The use cases selected for elucidating the Spark SQL way of programming with DataFrame are given as follows:

  • The transaction records come as comma-separated values.

  • Filter out only the good transaction records from the list. The account number should start with SB and the transaction amount should be greater than zero.

  • Find all the high-value transaction records with a transaction amount greater than 1000.

  • Find all the transaction records where the account number is bad.

  • Find all the transaction records where the transaction amount is less than or equal to zero.

  • Find a combined list of all the bad transaction records.

  • Find the total of all the transaction amounts.

  • Find the maximum of all the transaction amounts.

  • Find the minimum of all the transaction amounts.

  • Find all the good account numbers.

This is exactly the same set of use cases that were used in the previous chapter as well, but here the programming model is totally different. Using this set of use cases, two types of...