Skip to content

Latest commit

History

151 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

The LearningSpark Project

This project contains snippets of Scala code for illustrating various Apache Spark concepts. It is intended to help you get started with learning Apache Spark (as a Scala programmer) by providing a super easy on-ramp that doesn't involve Unix, cluster configuration, building from sources or installing Hadoop. Many of these activities will be necessary later in your learning experience, after you've used these examples to achieve basic familiarity.

It is intended to accompany a number of posts on the blog A River of Bytes.

Dependencies

The project was created with IntelliJ Idea 14 Community Edition, JDK 1.7, Scala 2.11.2 and Spark 1.3.0 on Windows 8.

Versions of these examples for other configurations (older versions of Scala and Spark) can be found in various branches.

Examples

The examples can be found under src/main/scala. The best way to use them is to start by reading the code and its comments. Then, since each file contains an object definition with a main method, run it and consider the output. Relevant blog posts and StackOverflow answers are listed below.

PackageFileWhat's Illustrated
Ex1_SimpleRDDHow to execute your first, very simple, Spark Job. See also An easy way to start learning Spark.
Ex2_ComputationsHow RDDs work in more complex computations. See also Spark computations.
Ex3_CombiningRDDsOperations on multiple RDDs
Ex4_MoreOperationsOnRDDsMore complex operations on individual RDDs
Ex5_PartitionsExplicit control of partitioning for performance and scalability.
Ex6_AccumulatorsHow to use Spark accumulators to efficiently gather the results of distributed computations.
hiveqlUsing HiveQL features in a HiveContext. See the local README.md in that directory for details.
specialCustomPartitionerHow to take control of the partitioning of an RDD.
specialHashJoinHow to use the well known Hash Join algorithm to join two RDDs where one is small enough to entirely fit in the memory of each partition. See also this question on StackOverflow
specialPairRDDHow to operate on RDDs in which the underlying elements are pairs.
dataframeA range of DataFrame examples -- see the local README.md in that directory for details.
experimentsExperimental examples that may or may not lead to anything interesting.
sqlA range of SQL examples -- see the local README.md in that directory for details.
streamingStreaming examples -- see the local README.md in that directory for details.
graphxA range of GraphX examples -- see the local README.md in that directory for details.

Additional Scala code is "work in progress".

About

Scala examples for learning to use Spark

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages