Skip to content

Text Sink

vnnv01 edited this page Mar 6, 2018 · 1 revision

The Text Sink is a specific subset of the File Sink. As such, file sink options may also be configured on a Text Sink. As always, the path option of the File Sink must be configured. Please review the File Sink if you are not already familiar with it.

The Text sink is relatively primitive, as it only supports a single string column. The name of the underlying column does not matter. You can find a few examples below to help you understand this constraint.

TableA:

foo bar
abc def
SAVE STREAM TableA
TO TEXT
OPTIONS();

The above streaming query will fail, as TableA contains two columns, foo and bar. The Text Sink only supports tables with a single string column.

TableB:

col0
0
SAVE STREAM TableB
TO TEXT
OPTIONS();

The above streaming query will fail, as TableB contains a single int column. The Text Sink only supports table with a single string column.

TableC:

value
abc
SAVE STREAM TableC
TO TEXT
OPTIONS();

The above streaming query will work as expected, as TableC contains a single string column.

Options

compression

The compression codec to use when generating text files. Valid values include:

  • none
  • uncompressed
  • bzip2
  • deflate
  • gzip
  • lz4
  • snappy

Defaults to none.

SAVE STREAM foo
TO TEXT
OPTIONS(
  'compression'='bzip2'
);