GraphX distributed graph processing engine

Along with Spark MLlib for machine learning, which we have already encountered a few times in this book, and others like Spark Streaming, which we will cover in Chapter 8, Lending Club Loan Prediction, Spark GraphX is one of the core components of the Spark ecosphere. GraphX is tailored for processing large graphs in an efficient way by building on top of RDDs.

Using the nomenclature developed in the last section, a graph in GraphX is a finite multigraph with loops, where by graph, we actually mean the property graph extension discussed earlier. Next, we will see how graphs are built internally in GraphX.

For the examples used, we recommend firing up spark-shell locally, which will automatically provide dependencies for GraphX. To test whether this works properly in your setup, try importing the full GraphX core module using Scala's wildcard operator, as follows:

import org.apache.spark.graphx._

On your screen, you should see the following prompt:

If you would rather follow the examples by building a package using sbt, you should include the following libraryDependencies in your build.sbt:

"org.apache.spark" %% "spark-graphx" % "2.1.1"

Doing so should allow you to import GraphX, as shown previously, to create an app of your choice that you can call with spark-submit instead.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.35.99