Write CSV Stream

Writes a Spark dataframe stream into a tabular (typically, comma-separated) stream.

stream_write_csv(x, path, mode = c("append", "complete", "update"),
  trigger = stream_trigger_interval(), checkpoint = file.path(path,
  "checkpoint"), header = TRUE, delimiter = ",", quote = "\"",
  escape = "\\", charset = "UTF-8", null_value = NULL,
  options = list(), ...)

Arguments

x

A Spark DataFrame or dplyr operation

path

The path to the file. Needs to be accessible from the cluster. Supports the "hdfs://", "s3a://" and "file://" protocols.

mode

Specifies how data is written to a streaming sink. Valid values are "append", "complete" or "update".

trigger

The trigger for the stream query, defaults to micro-batches runnnig every 5 seconds. See stream_trigger_interval and stream_trigger_continuous.

checkpoint

The location where the system will write all the checkpoint information to guarantee end-to-end fault-tolerance.

header

Should the first row of data be used as a header? Defaults to TRUE.

delimiter

The character used to delimit each column, defaults to ,.

quote

The character used as a quote. Defaults to '"'.

escape

The character used to escape other characters, defaults to \.

charset

The character set, defaults to "UTF-8".

null_value

The character to use for default values, defaults to NULL.

options

A list of strings with additional options.

...

Optional arguments; currently unused.

See also