Skip to content

feat(flow-php/etl): plan the query before running it - #2640

Merged
norberttech merged 1 commit into
1.xfrom
optimizer
Sep 20, 2026
Merged

norberttech merged 1 commit into
1.xfrom
optimizer

Conversation

@norberttech

Copy link
Copy Markdown
Member

Change Log


Added

  • flow-php/etl - logical plan of Plan\Node operators, lowered by Planner and run by Executor
  • flow-php/etl - each node declares its row count, transparency, materialization and redefined columns
  • flow-php/etl - Optimizer rules: combine limits, top N, push limit and partition filter into the source
  • flow-php/etl - Sink and Transaction contracts, so a write can fan out or commit per batch
  • flow-php/etl - DataFrame::explain() prints any stage in tree, flow, boxes or declarations format
  • flow-php/etl - DataFrame::forEach(), addRowIndex(), aggregateBy(), asExtractor(), isRepeatable()
  • flow-php/etl-adapter-doctrine - DbalTransaction with configurable isolation level
  • flow-php/etl-adapter-postgresql - PostgreSqlTransaction with configurable isolation level
  • flow-php/cli - ProgressBarLoader advancing a progress bar per batch

Fixed

  • flow-php/etl - a failure under a node shared by two sinks is offered to the error handler once
  • flow-php/etl - an inlined from_data_frame() failure reaches the outer error handler
  • flow-php/etl - an embedded frame is optimized with its own rules, not the parent's
  • flow-php/etl - one refusing node no longer makes the whole frame's schema() throw
  • flow-php/etl - add_row_index() restarts its counter on every run
  • flow-php/etl - non-deterministic functions no longer let partition pruning drop every row

Changed

  • flow-php/etl - Extractor::extract() takes the pushed row limit; FileExtractor also takes a path filter
  • flow-php/etl - Config::optimizer() replaced by planner() and executor()
  • flow-php/etl - DataFrame::run() no longer takes a callback, use forEach()
  • flow-php/etl-adapter-doctrine - to_dbal_transaction() takes loaders or sinks and returns Sink\Transactional
  • flow-php/etl-adapter-postgresql - to_pgsql_transaction() takes loaders or sinks and returns Sink\Transactional

Removed

  • flow-php/etl - Pipeline, Pipeline\Optimizer and both its optimizations
  • flow-php/etl - retry: RetryLoader, RetryStrategy, DelayFactory, Sleep and Duration
  • flow-php/etl - loader decorators BranchingLoader, OverridingLoader, TransformerLoader and LoaderTree
  • flow-php/etl - DataFrame::filterPartitions(), replaced by filter() pushed into the source
  • flow-php/etl-adapter-doctrine - TransactionalDbalLoader, replaced by DbalTransaction
  • flow-php/etl-adapter-postgresql - TransactionalPostgreSqlLoader, replaced by PostgreSqlTransaction

Deprecated

Security

- DataFrame builds a logical plan of Nodes; a Planner lowers it to pipelines an Executor runs
- nodes declare their own row count, transparency, materialization and redefined columns, so
  optimizer rules read declarations instead of hardcoded class lists
- sinks are plan roots: write() fans out, and a Transaction commits per batch
  (DbalTransaction, PostgreSqlTransaction replace TransactionalDbalLoader)
- limits and partition filters are pushed into the source; filterPartitions() is gone, filter() does it
- explain() prints any stage (unoptimized, optimized, physical) in four formats
- run($callback) splits into run() and forEach()
@norberttech norberttech added this to the 0.45.0 milestone Sep 20, 2026
@codecov

codecov Bot commented Sep 20, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.81005% with 27 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.81%. Comparing base (58aea29) to head (69e29ba).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff              @@
##                1.x    #2640      +/-   ##
============================================
+ Coverage     84.54%   84.81%   +0.26%     
- Complexity    23267    30939    +7672     
============================================
  Files          2007     2094      +87     
  Lines         87052    88711    +1659     
============================================
+ Hits          73594    75236    +1642     
- Misses        13458    13475      +17     
Components Coverage Δ
etl 92.21% <98.78%> (+0.73%) ⬆️
cli 75.49% <100.00%> (+0.03%) ⬆️
lib-array-dot 96.52% <ø> (ø)
lib-azure-sdk 64.44% <ø> (ø)
lib-doctrine-dbal-bulk 70.36% <ø> (ø)
lib-filesystem 77.08% <ø> (ø)
lib-types 90.49% <ø> (ø)
lib-parquet 70.23% <ø> (ø)
lib-parquet-viewer 82.26% <ø> (ø)
lib-snappy 89.86% <ø> (ø)
lib-dremel 0.00% <ø> (ø)
lib-postgresql 85.63% <ø> (ø)
lib-telemetry 86.59% <ø> (-0.03%) ⬇️
bridge-filesystem-async-aws 86.31% <ø> (ø)
bridge-filesystem-azure 80.96% <ø> (ø)
bridge-filesystem-sftp 91.02% <ø> (ø)
bridge-monolog-http 91.54% <ø> (ø)
bridge-monolog-telemetry 94.79% <ø> (ø)
bridge-openapi-specification 60.86% <ø> (ø)
symfony-http-foundation 56.86% <ø> (ø)
bridge-psr18-telemetry 100.00% <ø> (ø)
bridge-psr3-telemetry 98.95% <ø> (ø)
bridge-psr7-telemetry 100.00% <ø> (ø)
bridge-telemetry-otlp 90.11% <ø> (ø)
bridge-symfony-http-foundation-telemetry 92.85% <ø> (ø)
bridge-symfony-filesystem-bundle 91.85% <ø> (ø)
bridge-symfony-filesystem-cache 98.18% <ø> (ø)
bridge-symfony-postgresql-bundle 93.04% <ø> (ø)
bridge-symfony-postgresql-cache 94.41% <ø> (ø)
bridge-symfony-postgresql-messenger 98.80% <ø> (ø)
bridge-symfony-postgresql-session 93.65% <ø> (ø)
bridge-symfony-telemetry-bundle 90.72% <ø> (ø)
adapter-chartjs 80.50% <ø> (ø)
adapter-csv 95.99% <100.00%> (+<0.01%) ⬆️
adapter-doctrine 89.63% <100.00%> (-3.39%) ⬇️
adapter-google-sheet 80.00% <100.00%> (-0.12%) ⬇️
adapter-http 76.52% <100.00%> (ø)
adapter-json 65.80% <100.00%> (+0.18%) ⬆️
adapter-logger 28.57% <ø> (ø)
adapter-parquet 75.82% <100.00%> (+0.43%) ⬆️
adapter-text 71.59% <100.00%> (+0.80%) ⬆️
adapter-xml 60.00% <100.00%> (+0.16%) ⬆️
adapter-avro 7.69% <66.66%> (+7.69%) ⬆️
adapter-excel 79.17% <100.00%> (+0.06%) ⬆️
adapter-postgresql 77.94% <100.00%> (-2.02%) ⬇️
adapter-seal 65.69% <ø> (ø)
bridge-phpunit-postgresql 75.30% <ø> (ø)
bridge-phpunit-telemetry 87.36% <ø> (ø)
bridge-phpstan-types 0.00% <ø> (ø)
bridge-postgresql-valinor 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@norberttech
norberttech merged commit 031f5fb into 1.x Sep 20, 2026
50 checks passed
@norberttech
norberttech deleted the optimizer branch September 20, 2026 18:42
@github-project-automation github-project-automation Bot moved this from Todo to Done in Roadmap Sep 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant