Class SequenceWriter

java.lang.Object
org.rumbledb.api.SequenceWriter

public class SequenceWriter extends Object
Helper class to configure and materialize the output of a SequenceOfItems. This class is effectively immutable: all configuration methods such as mode(), format(), option(), etc. return a new SequenceWriter instance instead of mutating the current one. There are two mutually exclusive internal modes:
  • DataFrame mode: dataFrameWriter != null and mode == null. In this case, the sequence can be represented as a Spark Dataset / DataFrameWriter and is written using Spark's native writers (json/csv/parquet/...).
  • RDD mode: dataFrameWriter == null and mode != null. In this case, the sequence is serialized item-by-item via Serializer and saved as text files.
Output formats (json/csv/parquet/...) select a file writer, independently of the W3C serialization method. The special output format serialize writes the entire sequence as one string using its serialization parameters. serialize-each-item serializes each item independently and separates the resulting strings with newlines.