17. [Activity] Counting Word Occurences using Flatmap()
MAP VS. FLATMAP
Map() Transform Each Element Of An RDD Into One New Element
val lines = sc.textFile("redfox.txt")
->
The quick red
fox jumped
over the lazy
brown dogs
val rageCaps = lines.map(x => x.toUpperCase)
THE QUICK R RED
FOX JUMPED
OVER THE LAZY
BROWN DOGSFlatMap() Can Create Many New Elements From Each One
Code Sample: Count The Words In A Book
Activity
Previous16. [Activity] Running the Minimum Temperature Example, and Modifying it for MaximumNext18. [Activity] Improving the Word Count Script with Regular Expressions
Last updated