user3705662
user3705662

Reputation: 2167

How to store JavaRDD as a sequence file using spark java API?

I want to store JavaRDD as a sequence file instead of textfile. But i don't see any Java API for that. Is there a way for this? Please let me know. Thanks!

Upvotes: 2

Views: 3920

Answers (1)

samthebest
samthebest

Reputation: 31515

Maybe JavaPairRDD has a method .saveAsSequenceFile if not I think you can use .saveAsHadoopFile and have SequenceFileOutputFormat.class as the format param. It seems to be explained a bit here: http://apache-spark-user-list.1001560.n3.nabble.com/Spark-SequenceFile-Java-API-Repeat-Key-Values-td353.html

Upvotes: 4

Related Questions