Skip to content

Extractor statistics - #2647

Merged
norberttech merged 3 commits into
1.xfrom
extractor-statistics
Sep 22, 2026
Merged

norberttech merged 3 commits into
1.xfrom
extractor-statistics

Conversation

@norberttech

Copy link
Copy Markdown
Member

Change Log


Added

  • flow-php/etl - Extractor::statistics(): every source declares its rows and bytes as a Cardinality
  • flow-php/etl - physical explain() prints the statistics of every source
  • flow-php/etl - analyze()->withSourceStatistics() reports declared vs. read rows per source
  • flow-php/etl - count() answers from exact source statistics without reading rows
  • flow-php/etl - Floe footer carries a statistics block
  • flow-php/etl-adapter-parquet - exact rows and bytes from file footers
  • flow-php/etl-adapter-csv - row estimate from the sampled row size, listed byte size
  • flow-php/etl-adapter-json - JSON Lines row estimate, JSON exact rows on a whole-file sample, listed byte size
  • flow-php/etl-adapter-excel - exact rows on a whole-workbook sample, listed byte size
  • flow-php/etl-adapter-xml - listed byte size
  • flow-php/etl-adapter-text - listed byte size
  • flow-php/etl-adapter-doctrine - row estimate from EXPLAIN on PostgreSQL and MySQL
  • flow-php/etl-adapter-postgresql - row estimate from EXPLAIN
  • flow-php/etl-adapter-google-sheet - row bound from the sheet grid size
  • flow-php/cli - --stats-sources option for pipeline:run and file:analyze
  • flow-php/flow-php-ext - native CSV reader reports the bytes it consumed

Fixed

Changed

  • flow-php/etl - existing .floe files must be rewritten for the new footer
  • flow-php/etl - Report constructor takes the source statistics of the run
  • flow-php/etl - cache index stores the row count of every entry

Removed

Deprecated

Security

- Extractor::statistics() with Cardinality and Statistics: rows and bytes known before reading
- file sources declare listed bytes; CSV and JSON Lines estimate rows from the schema sample
- Parquet and Floe read footer totals once, shared with schema(); Floe footer gains a statistics block
- PostgreSQL and Doctrine (PostgreSQL, MySQL) estimate rows with EXPLAIN, never ANALYZE
- exact counts for sequences, file listings, cache index and whole-source samples
- native CSV reader reports consumed bytes
- physical explain prints every source's declared statistics
- analyze reports declared vs. read rows per source (withSourceStatistics(), --stats-sources)
- count() is planned as Trigger::count and answered from exact statistics by the CountFromStatistics rule
- rowsError() is null for a read narrowed by a pushed limit/partition filter or stopped early
- Cardinality::exactly() and isUnknown() replace re-derived checks in explain and count()
- document source statistics: Cardinality, what each source declares, custom extractors
@norberttech norberttech added this to the 0.45.0 milestone Sep 22, 2026
@codecov

codecov Bot commented Sep 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.51023% with 29 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.87%. Comparing base (b9bfc36) to head (874e0b6).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff              @@
##                1.x    #2647      +/-   ##
============================================
+ Coverage     84.77%   84.87%   +0.09%     
- Complexity    23126    31275    +8149     
============================================
  Files          2098     2123      +25     
  Lines         88854    89617     +763     
============================================
+ Hits          75329    76064     +735     
- Misses        13525    13553      +28     
Components Coverage Δ
etl 92.31% <98.94%> (+0.09%) ⬆️
cli 76.03% <100.00%> (+0.54%) ⬆️
lib-array-dot 96.52% <ø> (ø)
lib-azure-sdk 64.44% <ø> (ø)
lib-doctrine-dbal-bulk 70.36% <ø> (ø)
lib-filesystem 77.18% <ø> (ø)
lib-types 90.49% <ø> (ø)
lib-parquet 70.32% <ø> (ø)
lib-parquet-viewer 82.26% <ø> (ø)
lib-snappy 90.30% <ø> (ø)
lib-dremel 0.00% <ø> (ø)
lib-postgresql 85.63% <ø> (ø)
lib-telemetry 86.59% <ø> (ø)
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 88.55% <88.11%> (+0.13%) ⬆️
adapter-doctrine 90.06% <94.31%> (+0.42%) ⬆️
adapter-google-sheet 81.17% <100.00%> (+1.17%) ⬆️
adapter-http 75.75% <0.00%> (-0.77%) ⬇️
adapter-json 67.77% <100.00%> (+1.96%) ⬆️
adapter-logger 28.57% <ø> (ø)
adapter-parquet 76.58% <100.00%> (+0.76%) ⬆️
adapter-text 72.06% <100.00%> (+0.47%) ⬆️
adapter-xml 60.32% <100.00%> (+0.32%) ⬆️
adapter-avro 7.14% <0.00%> (-0.55%) ⬇️
adapter-excel 80.00% <100.00%> (+0.82%) ⬆️
adapter-postgresql 78.56% <100.00%> (+0.61%) ⬆️
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 54830ab into 1.x Sep 22, 2026
50 checks passed
@norberttech
norberttech deleted the extractor-statistics branch September 22, 2026 11:25
@github-project-automation github-project-automation Bot moved this from Todo to Done in Roadmap Sep 22, 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