Core Plugins and tasks DeduplicateItems

Core Plugins and tasks DeduplicateItems

Certified

Deduplicate a line-oriented file by key.

Reads the file twice: first to map each key (from expr) to its last occurrence offset, then to write only those last occurrences to a new file. Avoids loading the full file in memory.

Use for ordered “keep-last” semantics; expression can reference columns directly.

yaml
type: io.kestra.plugin.core.storage.DeduplicateItems

Remove duplicate customer emails from a CSV file.

yaml
    id: deduplicate_items
    namespace: company.team

    tasks:
      - id: generate_files
        type: io.kestra.plugin.scripts.shell.Script
        script: |
          cat <<EOF > my_data.csv
          order_id,customer_name,customer_email,product_id,price
          1,Kelly Olsen,kelly@example.com,20,166.89
          2,Miguel Moore,mccarthylee@example.net,14,171.63
          3,Kelly Olsen,kelly@example.com,20,166.89
          4,Jessica White,jessica@example.com,12,50.62
          5,Jessica White,jessica@example.com,12,50.62
          EOF
        outputFiles:
          - "my_data.csv"

      - id: csv_to_ion
        type: io.kestra.plugin.serdes.csv.CsvToIon
        from: "{{ outputs.generate_files.outputFiles['my_data.csv'] }}"

      - id: dedup
        type: io.kestra.plugin.core.storage.DeduplicateItems
        from: "{{ outputs.csv_to_ion.uri }}"
        expr: "{{ customer_email }}"
Properties

The Pebble expression to extract the deduplication key from each item

Headers from the file can be referenced directly e.g. {{ customer_email }}

The file to be deduplicated

Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.

Definitions
assetFailureBehaviorstring
Possible Values
IGNOREFAILWARN

Asset failure behavior

Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.

enableAutobooleanstring

Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.

inputsarray

The assets consumed as inputs.

id*string
Min length1
typestring
outputs

The assets produced as outputs.

id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*string
Min length1

Custom asset type

descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150

The total number of items that was dropped by the task

The number of distinct keys observed by the task

The total number of items that was processed by the task

Formaturi

The deduplicated file URI