JsonToIon
Convert a JSON file into ION.
We support one JSON dictionary/map per line as well as a JSON file in array format.
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"}
Here is how a sample JSON file in array format might look:
[
{"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"}
]
type: "io.kestra.plugin.serdes.json.JsonToIon"
Examples
Convert a JSON file to the Amazon Ion format.
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 *Requiredstring
Source file URI
Pebble expression referencing an Internal Storage URI e.g. {{ outputs.mytask.uri }}
.
charset string
UTF-8
The name of a supported charset
Default value is UTF-8.
newLine booleanstring
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 string
uri
URI of a temporary result file