I know this is nothing about scala, but a spark related question. But I got no helps from the spark community so I ask the question here. Thank you for all the kind helps.
For this streaming client by scala, I have two questions:
- Why enclose the translation of RDD to Dataframe into the foreachRDD block? I don’t see what’s the use of foreachRDD method.
- Why use a singleton for getting a spark sesson? in my before experience I never use singleton for this purpose.
Thank you.