Google News
logo
Spark - Interview Questions
What is the difference between map and flatMap transformation in Spark Streaming?
map() flatMap()
A map function returns a new DStream by passing each element of the source DStream through a function func It is similar to the map function and applies to each element of RDD and it returns the result as a new RDD
Spark Map function takes one element as an input process it according to custom code (specified by the developer) and returns one element at a time FlatMap allows returning 0, 1, or more elements from the map function. In the FlatMap operation
Advertisement