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

More processing options


Apart from the count operation in a window, there are more operations that can be done on DStreams in conjunction with windowing. The following table captures the important transformations. All these transformations are acting on the selected window and return a DStream.

Transformation

Description

window(windowLength, slideInterval)

Returns DStreams computed in the window

countByWindow(windowLength, slideInterval)

Returns the count of elements

reduceByWindow(func, windowLength, slideInterval)

Returns one element by applying the aggregation function

reduceByKeyAndWindow(func, windowLength, slideInterval, [numTasks])

Returns one key/value pair per key after applying the aggregation function over  multiple values per key

countByValueAndWindow(windowLength, slideInterval, [numTasks])

Returns one key/count pair per key after applying the count of multiple values per key

One of the most important steps of stream processing is the persisting of the...