JsonToIon JsonToIon

yaml
type: "io.kestra.plugin.serdes.json.JsonToIon"

Read a JSON file and write it to an ION serialized data file.

Please note that we support JSONL format only, i.e. one JSON dictionary/map per line.

Here is how a sample JSON file content might look like:

{"product_id":"1","product_name":"streamline turn-key systems","product_category":"Electronics","brand":"gomez"},
{"product_id":"2","product_name":"morph viral applications","product_category":"Household","brand":"wolfe"},
{"product_id":"3","product_name":"expedite front-end schemas","product_category":"Household","brand":"davis-martinez"}

We do NOT support an array of JSON objects. A JSON file in the following array format is not supported:

[
    {"product_id":"1","product_name":"streamline turn-key systems","product_category":"Electronics","brand":"gomez"},
    {"product_id":"2","product_name":"morph viral applications","product_category":"Household","brand":"wolfe"},
    {"product_id":"3","product_name":"expedite front-end schemas","product_category":"Household","brand":"davis-martinez"}
]

Examples

Convert a JSON file to the Amazon Ion format.

yaml
id: json_to_ion
namespace: company.team

tasks:
  - id: http_download
    type: io.kestra.plugin.core.http.Download
    uri: https://huggingface.co/datasets/kestra/datasets/raw/main/json/products.json

  - id: to_ion
    type: io.kestra.plugin.serdes.json.JsonToIon
    from: "{{ outputs.http_download.uri }}"

Properties

from

  • Type: string
  • Dynamic: ✔️
  • Required: ✔️

Source file URI

charset

  • Type: string
  • Dynamic:
  • Required:
  • Default: UTF-8

The name of a supported charset

Default value is UTF-8.

newLine

  • Type: boolean
  • Dynamic:
  • Required:
  • Default: true

Is the file is a json new line (JSON-NL)

Is the file is a json with new line separator Warning, if not, the whole file will loaded in memory and can lead to out of memory!

Outputs

uri

  • Type: string
  • Required:
  • Format: uri

URI of a temporary result file

Definitions

Was this page helpful?