March 2019
Beginner to intermediate
182 pages
4h 6m
English
The graph.g file consists of a structure of vertex to vertex. In the following graph.g file, if we align 1 to 2, this means that there is an edge between vertex ID 1 and vertex ID 2. The second line means that there's an edge from vertex ID 1 to 3, then from 2 to 3, and finally 3 to 5:
1 21 32 33 5
We will take the graph.g file, load it, and see how it will provide results in Spark. First, we need to get a resource to our graph.g file. We will do this using the getClass.getResource() method to get the path to it, as follows:
package com.tomekl007.chapter_7import org.apache.spark.SparkContextimport org.apache.spark.sql.SparkSessionimport org.scalatest.FunSuiteclass CreatingGraph extends FunSuite { val spark: SparkContext ...Read now
Unlock full access