Skip to content

Instantly share code, notes, and snippets.

View InvisibleTech's full-sized avatar

John Ferguson InvisibleTech

View GitHub Profile
@InvisibleTech
InvisibleTech / ARankedWordCountOverridingOrdering.scala
Last active August 29, 2015 14:03
Spark: Get Ranked Word Count from MacBeth Text
/**
* Using text from http://www.gutenberg.org/ebooks/1129?msg=welcome_stranger
*
* Get ranked word count from text file. Demonstrate use of implict ordering and overriding it with Spark RDD
* /
/* Change the path to where you put the text. */
val lines = sc.textFile("../data/books/MacBeth.txt")
/* Get the words but drop the empty ones */