Hope you are doing well.


Here data storage means saving a processed data it could be either stored in hdfs or local file system.

 

saveAsTextFile(path)   

Write the elements of the dataset as a text file (or set of text files) in a given directory in the local filesystem, HDFS or any other Hadoop-supported file system. Spark will call toString on each element to convert it to a line of text in the file.

saveAsSequenceFile(path)
(Java and Scala)   


Write the elements of the dataset as a Hadoop SequenceFile in a given path in the local filesystem, HDFS or any other Hadoop-supported file system. This is available on RDDs of key-value pairs that implement Hadoop's Writable interface. In Scala, it is also available on types that are implicitly convertible to Writable (Spark includes conversions for basic types like Int, Double, String, etc).

saveAsObjectFile(path)
(Java and Scala)   


Write the elements of the dataset in a simple format using Java serialization, which can then be loaded using SparkContext.objectFile().

 

I hope this resolves your query.

 

If you face any further issue kindly let us know.

 

We will be glad assisting you.