9. Introduction to Spark
Last updated
Last updated
"A fast and general engine for large-scale data processing"
"Run programs up to 100x faster than Hadoop MapReduce in memory, or 10x faster on disk."
DAG Engine (directed acyclic graph) optimizes workflows
Amazon
Ebay: log analysis and aggregation
NASA JPL: Deep Space Network
Groupon
TripAdviser
Yahoo
Code in Python, Java, or Scala
Build around one main concept: the Resilient Distributed Dataset (RDD)
Why Scala?
Spark itself is written in Scala
Scala's functional programming model is a good fit for distributed processing
Gives you fast performance (Scala compiles to Java bytecode)
Less code & boilerplate stuff than Java
Python is slow in comparison
But...
You probably don't know Scala
So we'll have to learn the basics first.
It's not as hard you think!
Scala code in Spark looks a LOTlike Python code.
Python code to square numbers in a data set:
Scala code to square numbers in a data set:
Process Flow for Spark
Executor -Cache Tasks
Driver Program -Spark Context
Cluster Manager (Spark,YARN)
Executor -Cache Tasks
Executor -Cache Tasks
SPARK CORE
Spark Streaming
Spark SQL
MLLLib
GraphX