Logo of php-etl
Getting Started
🐘 Standalone 🎵 Symfony 🦢 Sylius
Core Concepts
The Concept Execution Context Item Types Custom Operations Glossary FAQ
⛓️ Operations
Building Blocks
Split Merge Repeat Safe
Extract
File Finder CSV JSON
Transform
External File Processor Filter Data Rule Transformer Split Item HTTP Client Log Callback
Aggregation
Simple Grouping
Load
CSV JSON
🧑‍🍳 Cookbook
Without Context
Grouping / Aggregation Filtering Splitting/Forking Making your chains configurable Complex data to csv / Flatten Data Api to CSV N°1 Api to CSV N°2 Sub chains
With Context
Api to CSV Import external file
Custom Operations

PHP-ETL - Operations
Building Blocks - Chain Split(split)

The split operation executes multiple, independent chains of operations with the same input data. Each chain, or “branch,” processes data in parallel without affecting other branches or the main chain. This is useful for performing distinct tasks simultaneously, such as logging, sending to an API, and saving to a database.

Options

  • branches: An array of chains of operations.

Example

Here’s an example of how to use the split operation to process a CSV file in two different ways simultaneously:

chain:
  - operation: extract-csv
    options:
      path: /path/to/input.csv

  - operation: split
    options:
      branches:
        - - operation: rule-transformer
            options:
              # ... rules for transformation
          - operation: load-csv
            options:
              path: /path/to/output.csv

        - - operation: log
            options:
              message: "Processing item "

Network

GitHub Repo Issues Good First Issues

Help Preserve This Project

Support for the continued development of php ETL. I maintain this project in my free time.

Support
Free & Open Source (MIT)