Shankar
Shankar

Reputation: 8957

rdd.saveAsTextFile() no exception handled

I am trying to use rdd.saveAsTextFile("file path") to write the rdd content as text file.

There is no exception handled on this method.

Basically i need to catch the exception, if something happens at the time of saving the rdd as text file..

Upvotes: 0

Views: 165

Answers (1)

MitsakosGR
MitsakosGR

Reputation: 531

You can use a try/catch block to catch the exception, even if it is not mentioned on method prototype.

The same thing can be used for all Spark exceptions!

Upvotes: 1

Related Questions