feat(flow-php/etl): plan the query before running it - #2640
Merged
Merged
Conversation
- 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()
Codecov Report❌ Patch coverage is 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
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change Log
Added
flow-php/etl- logical plan ofPlan\Nodeoperators, lowered byPlannerand run byExecutorflow-php/etl- each node declares its row count, transparency, materialization and redefined columnsflow-php/etl-Optimizerrules: combine limits, top N, push limit and partition filter into the sourceflow-php/etl-SinkandTransactioncontracts, so a write can fan out or commit per batchflow-php/etl-DataFrame::explain()prints any stage in tree, flow, boxes or declarations formatflow-php/etl-DataFrame::forEach(),addRowIndex(),aggregateBy(),asExtractor(),isRepeatable()flow-php/etl-adapter-doctrine-DbalTransactionwith configurable isolation levelflow-php/etl-adapter-postgresql-PostgreSqlTransactionwith configurable isolation levelflow-php/cli-ProgressBarLoaderadvancing a progress bar per batchFixed
flow-php/etl- a failure under a node shared by two sinks is offered to the error handler onceflow-php/etl- an inlinedfrom_data_frame()failure reaches the outer error handlerflow-php/etl- an embedded frame is optimized with its own rules, not the parent'sflow-php/etl- one refusing node no longer makes the whole frame'sschema()throwflow-php/etl-add_row_index()restarts its counter on every runflow-php/etl- non-deterministic functions no longer let partition pruning drop every rowChanged
flow-php/etl-Extractor::extract()takes the pushed row limit;FileExtractoralso takes a path filterflow-php/etl-Config::optimizer()replaced byplanner()andexecutor()flow-php/etl-DataFrame::run()no longer takes a callback, useforEach()flow-php/etl-adapter-doctrine-to_dbal_transaction()takes loaders or sinks and returnsSink\Transactionalflow-php/etl-adapter-postgresql-to_pgsql_transaction()takes loaders or sinks and returnsSink\TransactionalRemoved
flow-php/etl-Pipeline,Pipeline\Optimizerand both its optimizationsflow-php/etl- retry:RetryLoader,RetryStrategy,DelayFactory,SleepandDurationflow-php/etl- loader decoratorsBranchingLoader,OverridingLoader,TransformerLoaderandLoaderTreeflow-php/etl-DataFrame::filterPartitions(), replaced byfilter()pushed into the sourceflow-php/etl-adapter-doctrine-TransactionalDbalLoader, replaced byDbalTransactionflow-php/etl-adapter-postgresql-TransactionalPostgreSqlLoader, replaced byPostgreSqlTransactionDeprecated
Security