IonToCsv
IonToCsv
yaml
type: "io.kestra.plugin.serdes.csv.IonToCsv"
Read an ion serialized data file and write it to a csv file.
Examples
Download a CSV file, transform it in SQL and store the transformed data as a CSV file.
yaml
id: ion_to_csv
namespace: company.team
tasks:
- id: download_csv
type: io.kestra.plugin.core.http.Download
description: salaries of data professionals from 2020 to 2023 (source ai-jobs.net)
uri: https://huggingface.co/datasets/kestra/datasets/raw/main/csv/salaries.csv
- id: avg_salary_by_job_title
type: io.kestra.plugin.jdbc.duckdb.Query
inputFiles:
data.csv: "{{ outputs.download_csv.uri }}"
sql: |
SELECT
job_title,
ROUND(AVG(salary),2) AS avg_salary
FROM read_csv_auto('{{ workingDir }}/data.csv', header=True)
GROUP BY job_title
HAVING COUNT(job_title) > 10
ORDER BY avg_salary DESC;
store: true
- id: result
type: io.kestra.plugin.serdes.csv.IonToCsv
from: "{{ outputs.avg_salary_by_job_title.uri }}"
Properties
from
- Type: string
- Dynamic: ✔️
- Required: ✔️
Source file URI
alwaysDelimitText
- Type: boolean
- Dynamic: ❌
- Required: ❌
- Default:
false
Whether fields should always be delimited using the textDelimiter option.
charset
- Type: string
- Dynamic: ❌
- Required: ❌
- Default:
UTF-8
The name of a supported charset
dateFormat
- Type: string
- Dynamic: ✔️
- Required: ❌
- Default:
yyyy-MM-dd
Format to use for date
dateTimeFormat
- Type: string
- Dynamic: ✔️
- Required: ❌
- Default:
yyyy-MM-dd'T'HH:mm:ss.SSS[XXX]
Format to use for zoned datetime
fieldSeparator
- Type: string
- Dynamic: ❌
- Required: ❌
- Default:
,
The field separator character
header
- Type: boolean
- Dynamic: ❌
- Required: ❌
- Default:
true
Specifies if the first line should be the header
lineDelimiter
- Type: string
- Dynamic: ❌
- Required: ❌
- Default:
The character used to separate rows
textDelimiter
- Type: string
- Dynamic: ❌
- Required: ❌
- Default:
"
The text delimiter character
timeFormat
- Type: string
- Dynamic: ✔️
- Required: ❌
- Default:
HH:mm:ss[XXX]
Format to use for time
timeZoneId
- Type: string
- Dynamic: ✔️
- Required: ❌
- Default:
Etc/UTC
Timezone to use when no timezone can be parsed on the source.
Outputs
uri
- Type: string
- Required: ❌
- Format:
uri
URI of a temporary result file
Was this page helpful?