June 2017
Beginner to intermediate
296 pages
7h 4m
English
To actually make all that happen, we have to call an action:
print("Processing " + str(mapped.count()) + " values.")
So remember, we have lazy evaluation in Spark-just calling flatMap doesn't actually make anything happen. A very key thing happened in the BFS map function-If we actually encountered the character that we were looking for, we incremented our hitCounter, our accumulator:
if (targetCharacterID == connection):
hitCounter.add(1)
This is a very important point. The moment that we encounter Adam 3031, this hitCounter is going to get incremented, signaling back to our driver script that we have found the person we're looking for. The problem is, map functions are transforms. They don't actually cause to actually ...
Read now
Unlock full access