JSON Sink - rambabu-chamakuri/PSTL-DOC GitHub Wiki

The JSON Sink is a specific subset of the File Sink. As such, file sink options may also be configured on a JSON 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.

If you are familiar with the JSON Source, you will note the JSON Sink has significantly fewer JSON options. Internally, both the JSON Source and the JSON Sink use Jackson for reading and writing JSON. Jackson generates JSON very well aligned with the JSON specification. The majority of the JSON parsing options exposed on the JSON Source are for parsing less than ideal JSON generated by sub-par systems.

Options

compression

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

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

Defaults to none.

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

dateFormat

Specifies how date columns should be formatted when rendered as a JSON string. Refer to the Java Date and Time Patterns as needed.

Defaults to yyyy-MM-dd.

SAVE STREAM foo
TO JSON
OPTIONS(
  'dateFormat'='MM-dd-yyyy'
);

timestampFormat

Specifies how timestamp columns should be formatted when rendered as a JSON string. Refer to the Java Date and Time Patterns as needed.

Defaults to yyyy-MM-dd'T'HH:mm:ss.SSSXXX.

SAVE STREAM foo
TO JSON
OPTIONS(
  'timestampFormat'='EEE, dd MMM yyyy HH:mm:ss Z'
);