July 2017
Beginner to intermediate
420 pages
10h 56m
English
We'll start off with our boilerplate Spark stuff that creates a local SparkConfiguration and a SparkContext, from which we can then create our initial RDD.
conf = SparkConf().setMaster("local").setAppName("SparkTFIDF")
sc = SparkContext(conf = conf)
Next, we're going to use our SparkContext to create an RDD from subset-small.tsv.
rawData = sc.textFile("e:/sundog-consult/Udemy/DataScience/subset-small.tsv")
This is a file containing tab-separated values, and it represents a small sample of Wikipedia articles. Again, you'll need to change your path as shown in the preceding code as necessary for wherever you installed the course materials for this book.
That gives me back an RDD where every document is in each line ...
Read now
Unlock full access