JSONLine#

class onetl.file.format.jsonline.JSONLine(*, multiLine: Literal[False] = False, encoding: str = 'utf-8', lineSep: str = '\n', **kwargs)#

JSONLine file format (each line of file contains a JSON object). support_hooks

Based on Spark JSON file format.

Supports reading/writing files with .json extension (NOT .jsonl or .jsonline) with content like:

example.json#
{"key": "value1"}
{"key": "value2"}

Note

You can pass any option to the constructor, even if it is not mentioned in this documentation. Option names should be in camelCase!

The set of supported options depends on Spark version. See link above.

Examples

Describe options how to read from/write to JSON file with specific options:

jsonline = JSONLine(encoding="utf-8", compression="gzip")
__init__(**kwargs)#