Skip to content

[Data] Make logical operator fields canonical - #63158

Open
myandpr wants to merge 1 commit into
ray-project:masterfrom
myandpr:data-next9-canonical-logical-fields
Open

myandpr wants to merge 1 commit into
ray-project:masterfrom
myandpr:data-next9-canonical-logical-fields

Conversation

@myandpr

@myandpr myandpr commented May 6, 2026 •

Copy link
Copy Markdown
Member

Description

Why this is needed:

This is the next cleanup in the #60312 logical plan migration stack.

After Operator became a thin shared base, LogicalOperator can own logical dependencies directly through the public input_dependencies contract instead of keeping a separate logical _input_dependencies backing field.

What this PR changes:

Makes LogicalOperator.input_dependencies the canonical dataclass field for logical inputs and removes the logical _input_dependencies backing field.

Keeps name and num_outputs as public logical-operator contracts on LogicalOperator:

  • name defaults to the class name, with derived-name operators overriding it through properties or fields.
  • num_outputs defaults to None; operators with caller-provided output counts store it as a field, while derived output counts remain properties.

Updates the abstract logical map / one-to-one / all-to-all layers to accept input_dependencies directly instead of accepting input_op and converting it in parent constructors.

Stores one-to-one output counts through the public num_outputs field instead of _num_outputs. Read keeps a manual constructor so the existing positional num_outputs argument continues to work while still participating in the new field model.

Preserves the existing _get_args() export key shape, including _name, _num_outputs, _input_dependencies, and _output_dependencies, for state/export compatibility.

Preserves custom logical-operator fallback rewiring in limit and predicate pushdown by updating copied operators through the frozen-safe input_dependencies field.

This PR does not change physical operator storage, clean up broader logical-rule special-casing, or change equality/comparability semantics. Those remain separate follow-ups in the current split plan.

Related issues

Part of #60312.

Additional information

This PR corresponds to the logical field-model cleanup step in the current split plan.

Tests

  • pre-commit run --files ...
  • Targeted logical plan, state export, limit pushdown, predicate pushdown, read-files logical, and operator fusion tests

Stack Plan

Done:

  • Convert remaining concrete logical operators to frozen dataclasses.
  • Make logical abstract classes frozen dataclasses.
  • Derive logical operator names from the base class.
  • Replace single-input input_op InitVars with input_dependencies.
  • Remove the one-to-one input_dependency convenience property.
  • Clean up logical operator args export.
  • Make Operator a thin shared base.
  • Consolidate redundant logical operator repr/string logic.

This PR:

  • Make logical operator fields canonical.

Next:

  • Clean up special-casing in logical rules.
  • Finish equality/comparability end-state.

@myandpr
myandpr requested a review from a team as a code owner May 6, 2026 14:44

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the logical operator hierarchy by replacing private attributes and properties with public fields for name, input_dependencies, and num_outputs, which simplifies operator definitions and standardizes attribute access across the codebase. Feedback suggests that subclasses should call super().post_init() to ensure that base class validation logic is executed and points out that redundant isinstance checks in the Zip, Mix, and Union operators can now be removed as they are handled by the base class.

@myandpr
myandpr force-pushed the data-next9-canonical-logical-fields branch 3 times, most recently from 48ad376 to 0c83dbd Compare May 6, 2026 15:59
@myandpr myandpr added data Ray Data-related issues go add ONLY when ready to merge, run all tests community-contribution Contributed by the community labels May 6, 2026
@myandpr
myandpr force-pushed the data-next9-canonical-logical-fields branch from 0c83dbd to 2d24d70 Compare May 6, 2026 17:07
@myandpr
myandpr force-pushed the data-next9-canonical-logical-fields branch from 2d24d70 to c950a3f Compare May 7, 2026 09:10
@myandpr
myandpr force-pushed the data-next9-canonical-logical-fields branch from c950a3f to 46dbca0 Compare May 20, 2026 20:17
@myandpr
myandpr force-pushed the data-next9-canonical-logical-fields branch from 46dbca0 to 178aaf5 Compare May 21, 2026 03:13
@myandpr
myandpr force-pushed the data-next9-canonical-logical-fields branch from 708e696 to 1739e47 Compare May 21, 2026 19:24
@myandpr

myandpr commented May 21, 2026

Copy link
Copy Markdown
Member Author

quick note:
Updated the PR to align with this direction: name and num_outputs are now public properties on LogicalOperator, with derived values implemented as properties and caller-provided values stored as fields.

I also removed the abstract-layer input_op -> input_dependencies=[input_op] bridge;

Read keeps a manual constructor only to preserve the existing positional num_outputs argument.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1739e47009248fc7431c01e675d2c0fbac517bd2. Configure here.

@myandpr
myandpr force-pushed the data-next9-canonical-logical-fields branch from 1739e47 to 1d22966 Compare May 21, 2026 20:41
@myandpr

myandpr commented May 22, 2026

Copy link
Copy Markdown
Member Author

ci fixed

@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had
any activity for 14 days. It will be closed in another 14 days if no further activity occurs.
Thank you for your contributions.

You can always ask for help on our discussion forum or Ray's public slack channel.

If you'd like to keep this open, just leave any comment, and the stale label will be removed.

@github-actions github-actions Bot added the stale The issue is stale. It will be closed within 7 days unless there are further conversation label Jun 5, 2026
@github-actions

Copy link
Copy Markdown

This pull request has been automatically closed because there has been no more activity in the 14 days
since being marked stale.

Please feel free to reopen or open a new pull request if you'd still like this to be addressed.

Again, you can always ask for help on our discussion forum or Ray's public slack channel.

Thanks again for your contribution!

@github-actions github-actions Bot closed this Jun 19, 2026
@bveeramani bveeramani reopened this Jun 24, 2026
@github-actions github-actions Bot added unstale A PR that has been marked unstale. It will not get marked stale again if this label is on it. and removed stale The issue is stale. It will be closed within 7 days unless there are further conversation labels Jun 25, 2026
@bveeramani bveeramani added this to the Data issue and PR backlog milestone Aug 19, 2026
goutamvenkat-anyscale added a commit that referenced this pull request Aug 19, 2026
## Why

Footer IO for the footer-based Parquet chunking path (the rest of the
split of #64985).

Reading N Parquet footers serially on the driver doesn't scale — it's
the step that decides which row groups a read even touches.
`FooterReader` runs as a pool of Ray actors, each reading footers on its
own thread pool and streaming results back in batches, so footer IO
spreads across the cluster instead of bottlenecking on one process.

**Nothing constructs it yet** — it's unused until the footer indexer
lands in step 6.

## Flow

Per file, it produces the row-group descriptors the bin packer (merged
in #65210) consumes:

```mermaid
flowchart LR
  B["(path, size) batch"] --> A["FooterReaderActor<br/>SPREAD across the cluster"]
  A --> R[read footer]
  R --> F["split_by_row_group(filter)<br/>prune by statistics"]
  F --> Q["split_by_row_group(~filter)<br/>classify fully_matched"]
  Q --> C["coalesce_row_groups<br/>(from #65210)"]
  C --> O["stream List[FileChunks]<br/>batched by result_batch_size"]
```

Three things it decides, each of which the packer and the limit
push-down depend on:

- **Predicate pruning.** `fragment.split_by_row_group(filter)` drops row
groups whose Parquet statistics contradict the pushed filter, so they
never reach the packer at all.
- **`fully_matched` classification.** A surviving group is *fully*
matched iff `~filter` prunes it entirely. Only fully-matched groups have
an exact survivor count, and only exact counts may drive limit
push-down. Any failure defaults to not-fully-matched, which is always
the safe direction. **This is the correctness-critical bit**: nulls are
the interesting case, since Parquet min/max stats are computed over
non-null values only, so a group whose non-null values all satisfy the
filter looks fully matched by bounds alone while its null rows don't
survive.
- **Projection-scoped sizing.** Byte sizes are accounted over only the
projected leaf columns, so bins get sized for what the reader will
actually fetch. Nested columns expand to all their leaves.

## What changed

Two new files, 368 insertions, 0 deletions:

| File | Change |
| --- | --- |
| `listing/footer_reader.py` | **new** — `FooterReader` plus
`FooterReaderActor = ray.remote(FooterReader)`. Kept as a plain class
with the actor built via the functional form, so callers can type
handles as `ActorProxy[FooterReader]`. `read_footers` is a streaming
`@ray.method` generator that yields `List[FileChunks]`, batched by
`result_batch_size` — the driver pays one object-store fetch per yielded
list, so batching cuts driver-side deserialization roughly
proportionally. |
| `tests/test_footer_reader.py` | **new** — 14 tests |

## Testing

The tests drive the plain class directly against local Parquet fixtures
— no actor, no cluster. Coverage is aimed at the decisions above rather
than the plumbing: predicate pruning by statistics, the partial-match
case (`id >= 30` splitting a row group, which must **not** count as
exact), a predicate matching nothing, projection shrinking accounted
size while leaving row counts alone, coalescing preserving total rows,
nested columns expanding to all leaves, and result batching at several
`result_batch_size` values.

```
$ python -m pytest -q python/ray/data/_internal/datasource_v2/tests/test_footer_reader.py
14 passed in 4.30s

$ python -m pytest -q python/ray/data/_internal/datasource_v2/tests/ python/ray/data/tests/unit/datasource_v2/
145 passed in 0.90s
```

## Stack

Step 5 of an 11-step split of #64985, which was 43 files / +3234 −719
and not reviewable as one unit.

- #65167 `[1/11]` Extract `FileIndexer.list_file_infos` ✅ merged
- #65168 `[2/11]` Push limit into `ReadFiles` when `Limit` sits directly
on it ✅ merged
- #65214 `[3/11]` Derive `ListFiles` pushdown state from the scanner ✅
merged
- #65210 `[4/11]` Parquet footer types + online bin packer ✅ merged
- **this PR** `[5/11]` — depends on #65210 for `parquet_footer_types`
and `parquet_row_group_coalescing`
- #65169 `[9/11]` Pin the Parquet footer actor pool to 1 in tests (open,
independent)

Step 6 wires this and the packer together behind an opt-in flag, and
needs both this and #65214.

---
Not a duplicate of any open PR (checked `gh pr list --state open` plus a
file-level overlap check against #65142 / #63158 / #64404 — no overlap;
only #64985, which this replaces).
AI assistance was used; every line reviewed by me and tests run locally.

---------

Signed-off-by: Goutam <[email protected]>
goutamvenkat-anyscale added a commit that referenced this pull request Sep 2, 2026
## Why

The last step of the split of #64985: flip Parquet V2 to the footer read
path, delete the blind one, and tune the release tests so this can be
validated by a real release run.

Everything it depends on has landed — footer types and the bin packer
(#65210), the `FooterReader` actor pool (#65273), the indexer plus
`count()` fix and packer-as-partitioner (#65596), reader IO tuning
(#65806), and test env pinning (#65169). The path has been reachable
behind `RAY_DATA_PARQUET_ENABLE_FOOTER_INDEXER` since #65596; this makes
it the only path.

## Flow

```mermaid
flowchart LR
  RP[read_parquet] --> FF["FooterFileIndexer<br/>+ OnlineBinPacker"]
  RP -.->|deleted| PC["ParquetFileChunker<br/>size-estimated chunks<br/>+ parquet_chunker_target_chunk_size"]
  style PC stroke-dasharray: 4 4
```

## What changed

**The flip** — `RAY_DATA_PARQUET_ENABLE_FOOTER_INDEXER` is gone from
both call sites. `_get_file_indexer()` always returns
`FooterFileIndexer`; `get_file_partitioner()` always returns
`OnlineBinPacker`.

**The deletions** — `ParquetFileChunker`, `ParquetFileChunkMetadata`,
`_calculate_row_group_range`, `_fragments_from_chunk_metadata`, and the
tests covering only that path.

**The config it left behind** —
`DataContext.parquet_chunker_target_chunk_size` and
`DEFAULT_PARQUET_CHUNKER_TARGET_CHUNK_SIZE` were read *only* by
`ParquetFileChunker.__init__`, so they would otherwise stay declared and
documented while doing nothing. Verified dead by grep across `.py` /
`.yaml` / `.rst` / `.md`.

**Reader pool defaults** — `RAY_DATA_PARQUET_READER_IO_THREAD_COUNT`
128, `RAY_DATA_PARQUET_READER_CPU_COUNT` 32.

## Release tests tuned

Budgets are per-test overrides of `RAY_DATA_PARQUET_BIN_PACKING_BYTES`
(uncompressed bytes of row-group data per read task; default 128 MiB).
The shape of the tuning: reads over few large groups want **large**
bins, because small bins shatter the read into short tasks the executor
cannot dispatch fast enough and the cluster idles; shuffle-bound reads
over many groups want **small** bins.

Rows whose variants all share the same tuning are collapsed and marked.

| release test | bin budget | other tuning |
| --- | --- | --- |
| `aggregate_groups_fixed_size_hash_shuffle_column02 column14` | 32 MiB
| — |
| `aggregate_groups_fixed_size_hash_shuffle_column08 column13 column14`
| 128 MiB | — |
| `aggregate_groups_fixed_size_shuffle_v2_column02 column14` | 64 MiB |
— |
| `aggregate_groups_fixed_size_shuffle_v2_column08 column13 column14` |
512 MiB | — |
| `aggregate_groups_fixed_size_sort_shuffle_pull_based_column02
column14` | 32 MiB | — |
| `aggregate_groups_fixed_size_sort_shuffle_pull_based_column08 column13
column14` | 256 MiB | — |
| `count_parquet_fixed_size` | 64 MiB | — |
| `cross_az_map_batches_autoscaling_iptable_failure_injection` | 1 GiB |
— |
| `distributed_training` | — | footer actors `20` |
| `flat_map` | 64 MiB | — |
| `iceberg_benchmark_overwrite` | 64 MiB | — |
| `iter_batches_pyarrow` | 64 MiB | — |
| `iter_torch_batches` | 64 MiB | — |
| `joins_{{dataset}}_{{join_type}} *(all 4 variants)*` | 1.25 GiB | — |
| `map` | 64 MiB | — |
| `map_batches_fixed_size_{{compute}}_{{format}}_{{repeat_map_batches}}
*(all 7 variants)*` | 1 GiB | scale-up threshold `0.6` |
| `map_groups_fixed_size_{{shuffle_strategy}}_{{columns}} *(all 6
variants)*` | 1.25 GiB | — |
| `mix` | — | footer actors `4` |
| `random_shuffle_fixed_size` | 64 MiB | — |
| `read_large_parquet_fixed_size` | 1 GiB | — |
| `read_parquet_fixed_size` | 64 MiB | — |
| `read_tfrecords` | 64 MiB | — |
| `streaming_split` | 64 MiB | footer batch `50`, result batch `50` |
| `to_tf` | 64 MiB | — |
| `tpch_q1_fixed_size_{{shuffle_strategy}} *(all 2 variants)*` | 192 MiB
| — |
| `training_ingest_benchmark` | 64 MiB | — |
| `wide_schema_pipeline_nested_structs` | 2 MiB | footer batch `1`,
footer actors `21`, io threads `5000` |
| `wide_schema_pipeline_objects` | 4.2 MiB | footer batch `1`, footer
actors `9`, io threads `5000` |
| `wide_schema_pipeline_primitives` | 256 KiB | footer batch `1`, footer
actors `27`, io threads `5000` |
| `wide_schema_pipeline_tensors` | 39 MiB | footer batch `1`, footer
actors `22`, io threads `5000` |
| `write_parquet` | 1.25 GiB | — |

**Three matrices are split**, because a matrix cannot vary
`byod.runtime_env` per value and their variants want different budgets:
`wide_schema_pipeline_{{data_type}}` into four entries, and one variant
each out of `iceberg_benchmark_{{mode}}` and `iter_batches_{{format}}`.
`aggregate_groups` keeps its matrix and carries the budget as a matrix
dimension with explicit adjustments. **Rendered test names are unchanged
— 121 before and after** — so release baselines still line up.

**Not carried over** from the original branch: 7 previously-pinned
entries no longer exist — the autoscaling variants removed in #65506,
plus `tpch_q20` and `tpch_q22`.

Any entry gaining its own `runtime_env` re-lists the four `DEFAULTS`
guards verbatim: `deep_update` overwrites lists rather than merging
them, so declaring one silently drops the OOM / dead-node / object-store
checks. (17 entries on master are already missing guards for this
reason; pre-existing, not touched here.)

`map_benchmark.py` also drops its `use_datasource_v2 = False` pin, which
existed because V2 was spilling.

> Budgets originally measured against the pre-decoupling design and
refined since. Packing moved between stages in #65596 but the packer and
its inputs did not, so bins should be unchanged — a release run against
this PR is what confirms that. The wide-schema tests are the first place
to look.

## Behavior change worth reviewing

**Read-task sizing no longer comes from `override_num_blocks` /
`read_op_min_num_blocks` for Parquet.** Bins are sized by
`RAY_DATA_PARQUET_BIN_PACKING_BYTES`, which is *also* not derived from
`DataContext.target_max_block_size`. That decoupling is deliberate —
read units are row-group-accurate rather than size-estimated — but it
means the two knobs users reach for first no longer affect Parquet read
parallelism. Deriving the budget from `target_max_block_size` is worth
considering as a follow-up; the per-test overrides above are the
evidence that a single global default does not fit every workload.

## Testing

```
$ python -m pytest -q python/ray/data/tests/datasource/test_parquet.py
286 passed, 6 skipped in 521.25s

$ python -m pytest -q python/ray/data/tests/datasource/test_read_parquet_v2.py
32 passed

$ python -m pytest -q python/ray/data/tests/unit/datasource_v2/ python/ray/data/_internal/datasource_v2/tests/
181 passed

$ python -m pytest -q python/ray/data/tests/test_predicate_pushdown.py \
                     python/ray/data/tests/test_execution_optimizer_limit_pushdown.py
78 passed
```

The 286-test parquet suite is the one that matters — it runs the full
read surface with the footer path as the default rather than behind a
flag. The release YAML is additionally checked for parse validity,
unresolved `{{...}}` in any pin, duplicate `byod:` keys, and
rendered-name stability.

## Stack

Final step of an 11-step split of #64985 (43 files / +3234 −719, not
reviewable as one unit).

- #65167 `[1]` · #65168 `[2]` · #65214 `[3]` · #65210 `[4]` · #65273
`[5]` · #65596 `[6]` · #65806 `[8]` · #65169 `[9]` — all merged
- `[7]` (count push-down fix) was absorbed into #65596
- `[10]` (release tuning) is folded into this PR, so a release run
exercises the flip and its tuning together
- **this PR** `[11/11]`

---
Not a duplicate. File-level overlap check: #63158 none; #65142 overlaps
`file_indexer.py` / `context.py`; #65406 / #65407 (arrow-rs reader A/B)
overlap broadly but are explicitly `[DO NOT MERGE]` benchmark branches
carrying the footer work out-of-tree.
AI assistance was used; every line reviewed by me and tests run locally.

---------

Signed-off-by: Goutam <[email protected]>
@bveeramani bveeramani removed their assignment Sep 26, 2026
nadongjun pushed a commit to nadongjun/ray that referenced this pull request Oct 6, 2026
)

## Why

Footer IO for the footer-based Parquet chunking path (the rest of the
split of ray-project#64985).

Reading N Parquet footers serially on the driver doesn't scale — it's
the step that decides which row groups a read even touches.
`FooterReader` runs as a pool of Ray actors, each reading footers on its
own thread pool and streaming results back in batches, so footer IO
spreads across the cluster instead of bottlenecking on one process.

**Nothing constructs it yet** — it's unused until the footer indexer
lands in step 6.

## Flow

Per file, it produces the row-group descriptors the bin packer (merged
in ray-project#65210) consumes:

```mermaid
flowchart LR
  B["(path, size) batch"] --> A["FooterReaderActor<br/>SPREAD across the cluster"]
  A --> R[read footer]
  R --> F["split_by_row_group(filter)<br/>prune by statistics"]
  F --> Q["split_by_row_group(~filter)<br/>classify fully_matched"]
  Q --> C["coalesce_row_groups<br/>(from ray-project#65210)"]
  C --> O["stream List[FileChunks]<br/>batched by result_batch_size"]
```

Three things it decides, each of which the packer and the limit
push-down depend on:

- **Predicate pruning.** `fragment.split_by_row_group(filter)` drops row
groups whose Parquet statistics contradict the pushed filter, so they
never reach the packer at all.
- **`fully_matched` classification.** A surviving group is *fully*
matched iff `~filter` prunes it entirely. Only fully-matched groups have
an exact survivor count, and only exact counts may drive limit
push-down. Any failure defaults to not-fully-matched, which is always
the safe direction. **This is the correctness-critical bit**: nulls are
the interesting case, since Parquet min/max stats are computed over
non-null values only, so a group whose non-null values all satisfy the
filter looks fully matched by bounds alone while its null rows don't
survive.
- **Projection-scoped sizing.** Byte sizes are accounted over only the
projected leaf columns, so bins get sized for what the reader will
actually fetch. Nested columns expand to all their leaves.

## What changed

Two new files, 368 insertions, 0 deletions:

| File | Change |
| --- | --- |
| `listing/footer_reader.py` | **new** — `FooterReader` plus
`FooterReaderActor = ray.remote(FooterReader)`. Kept as a plain class
with the actor built via the functional form, so callers can type
handles as `ActorProxy[FooterReader]`. `read_footers` is a streaming
`@ray.method` generator that yields `List[FileChunks]`, batched by
`result_batch_size` — the driver pays one object-store fetch per yielded
list, so batching cuts driver-side deserialization roughly
proportionally. |
| `tests/test_footer_reader.py` | **new** — 14 tests |

## Testing

The tests drive the plain class directly against local Parquet fixtures
— no actor, no cluster. Coverage is aimed at the decisions above rather
than the plumbing: predicate pruning by statistics, the partial-match
case (`id >= 30` splitting a row group, which must **not** count as
exact), a predicate matching nothing, projection shrinking accounted
size while leaving row counts alone, coalescing preserving total rows,
nested columns expanding to all leaves, and result batching at several
`result_batch_size` values.

```
$ python -m pytest -q python/ray/data/_internal/datasource_v2/tests/test_footer_reader.py
14 passed in 4.30s

$ python -m pytest -q python/ray/data/_internal/datasource_v2/tests/ python/ray/data/tests/unit/datasource_v2/
145 passed in 0.90s
```

## Stack

Step 5 of an 11-step split of ray-project#64985, which was 43 files / +3234 −719
and not reviewable as one unit.

- ray-project#65167 `[1/11]` Extract `FileIndexer.list_file_infos` ✅ merged
- ray-project#65168 `[2/11]` Push limit into `ReadFiles` when `Limit` sits directly
on it ✅ merged
- ray-project#65214 `[3/11]` Derive `ListFiles` pushdown state from the scanner ✅
merged
- ray-project#65210 `[4/11]` Parquet footer types + online bin packer ✅ merged
- **this PR** `[5/11]` — depends on ray-project#65210 for `parquet_footer_types`
and `parquet_row_group_coalescing`
- ray-project#65169 `[9/11]` Pin the Parquet footer actor pool to 1 in tests (open,
independent)

Step 6 wires this and the packer together behind an opt-in flag, and
needs both this and ray-project#65214.

---
Not a duplicate of any open PR (checked `gh pr list --state open` plus a
file-level overlap check against ray-project#65142 / ray-project#63158 / ray-project#64404 — no overlap;
only ray-project#64985, which this replaces).
AI assistance was used; every line reviewed by me and tests run locally.

---------

Signed-off-by: Goutam <[email protected]>
nadongjun pushed a commit to nadongjun/ray that referenced this pull request Oct 6, 2026
…ect#65821)

## Why

The last step of the split of ray-project#64985: flip Parquet V2 to the footer read
path, delete the blind one, and tune the release tests so this can be
validated by a real release run.

Everything it depends on has landed — footer types and the bin packer
(ray-project#65210), the `FooterReader` actor pool (ray-project#65273), the indexer plus
`count()` fix and packer-as-partitioner (ray-project#65596), reader IO tuning
(ray-project#65806), and test env pinning (ray-project#65169). The path has been reachable
behind `RAY_DATA_PARQUET_ENABLE_FOOTER_INDEXER` since ray-project#65596; this makes
it the only path.

## Flow

```mermaid
flowchart LR
  RP[read_parquet] --> FF["FooterFileIndexer<br/>+ OnlineBinPacker"]
  RP -.->|deleted| PC["ParquetFileChunker<br/>size-estimated chunks<br/>+ parquet_chunker_target_chunk_size"]
  style PC stroke-dasharray: 4 4
```

## What changed

**The flip** — `RAY_DATA_PARQUET_ENABLE_FOOTER_INDEXER` is gone from
both call sites. `_get_file_indexer()` always returns
`FooterFileIndexer`; `get_file_partitioner()` always returns
`OnlineBinPacker`.

**The deletions** — `ParquetFileChunker`, `ParquetFileChunkMetadata`,
`_calculate_row_group_range`, `_fragments_from_chunk_metadata`, and the
tests covering only that path.

**The config it left behind** —
`DataContext.parquet_chunker_target_chunk_size` and
`DEFAULT_PARQUET_CHUNKER_TARGET_CHUNK_SIZE` were read *only* by
`ParquetFileChunker.__init__`, so they would otherwise stay declared and
documented while doing nothing. Verified dead by grep across `.py` /
`.yaml` / `.rst` / `.md`.

**Reader pool defaults** — `RAY_DATA_PARQUET_READER_IO_THREAD_COUNT`
128, `RAY_DATA_PARQUET_READER_CPU_COUNT` 32.

## Release tests tuned

Budgets are per-test overrides of `RAY_DATA_PARQUET_BIN_PACKING_BYTES`
(uncompressed bytes of row-group data per read task; default 128 MiB).
The shape of the tuning: reads over few large groups want **large**
bins, because small bins shatter the read into short tasks the executor
cannot dispatch fast enough and the cluster idles; shuffle-bound reads
over many groups want **small** bins.

Rows whose variants all share the same tuning are collapsed and marked.

| release test | bin budget | other tuning |
| --- | --- | --- |
| `aggregate_groups_fixed_size_hash_shuffle_column02 column14` | 32 MiB
| — |
| `aggregate_groups_fixed_size_hash_shuffle_column08 column13 column14`
| 128 MiB | — |
| `aggregate_groups_fixed_size_shuffle_v2_column02 column14` | 64 MiB |
— |
| `aggregate_groups_fixed_size_shuffle_v2_column08 column13 column14` |
512 MiB | — |
| `aggregate_groups_fixed_size_sort_shuffle_pull_based_column02
column14` | 32 MiB | — |
| `aggregate_groups_fixed_size_sort_shuffle_pull_based_column08 column13
column14` | 256 MiB | — |
| `count_parquet_fixed_size` | 64 MiB | — |
| `cross_az_map_batches_autoscaling_iptable_failure_injection` | 1 GiB |
— |
| `distributed_training` | — | footer actors `20` |
| `flat_map` | 64 MiB | — |
| `iceberg_benchmark_overwrite` | 64 MiB | — |
| `iter_batches_pyarrow` | 64 MiB | — |
| `iter_torch_batches` | 64 MiB | — |
| `joins_{{dataset}}_{{join_type}} *(all 4 variants)*` | 1.25 GiB | — |
| `map` | 64 MiB | — |
| `map_batches_fixed_size_{{compute}}_{{format}}_{{repeat_map_batches}}
*(all 7 variants)*` | 1 GiB | scale-up threshold `0.6` |
| `map_groups_fixed_size_{{shuffle_strategy}}_{{columns}} *(all 6
variants)*` | 1.25 GiB | — |
| `mix` | — | footer actors `4` |
| `random_shuffle_fixed_size` | 64 MiB | — |
| `read_large_parquet_fixed_size` | 1 GiB | — |
| `read_parquet_fixed_size` | 64 MiB | — |
| `read_tfrecords` | 64 MiB | — |
| `streaming_split` | 64 MiB | footer batch `50`, result batch `50` |
| `to_tf` | 64 MiB | — |
| `tpch_q1_fixed_size_{{shuffle_strategy}} *(all 2 variants)*` | 192 MiB
| — |
| `training_ingest_benchmark` | 64 MiB | — |
| `wide_schema_pipeline_nested_structs` | 2 MiB | footer batch `1`,
footer actors `21`, io threads `5000` |
| `wide_schema_pipeline_objects` | 4.2 MiB | footer batch `1`, footer
actors `9`, io threads `5000` |
| `wide_schema_pipeline_primitives` | 256 KiB | footer batch `1`, footer
actors `27`, io threads `5000` |
| `wide_schema_pipeline_tensors` | 39 MiB | footer batch `1`, footer
actors `22`, io threads `5000` |
| `write_parquet` | 1.25 GiB | — |

**Three matrices are split**, because a matrix cannot vary
`byod.runtime_env` per value and their variants want different budgets:
`wide_schema_pipeline_{{data_type}}` into four entries, and one variant
each out of `iceberg_benchmark_{{mode}}` and `iter_batches_{{format}}`.
`aggregate_groups` keeps its matrix and carries the budget as a matrix
dimension with explicit adjustments. **Rendered test names are unchanged
— 121 before and after** — so release baselines still line up.

**Not carried over** from the original branch: 7 previously-pinned
entries no longer exist — the autoscaling variants removed in ray-project#65506,
plus `tpch_q20` and `tpch_q22`.

Any entry gaining its own `runtime_env` re-lists the four `DEFAULTS`
guards verbatim: `deep_update` overwrites lists rather than merging
them, so declaring one silently drops the OOM / dead-node / object-store
checks. (17 entries on master are already missing guards for this
reason; pre-existing, not touched here.)

`map_benchmark.py` also drops its `use_datasource_v2 = False` pin, which
existed because V2 was spilling.

> Budgets originally measured against the pre-decoupling design and
refined since. Packing moved between stages in ray-project#65596 but the packer and
its inputs did not, so bins should be unchanged — a release run against
this PR is what confirms that. The wide-schema tests are the first place
to look.

## Behavior change worth reviewing

**Read-task sizing no longer comes from `override_num_blocks` /
`read_op_min_num_blocks` for Parquet.** Bins are sized by
`RAY_DATA_PARQUET_BIN_PACKING_BYTES`, which is *also* not derived from
`DataContext.target_max_block_size`. That decoupling is deliberate —
read units are row-group-accurate rather than size-estimated — but it
means the two knobs users reach for first no longer affect Parquet read
parallelism. Deriving the budget from `target_max_block_size` is worth
considering as a follow-up; the per-test overrides above are the
evidence that a single global default does not fit every workload.

## Testing

```
$ python -m pytest -q python/ray/data/tests/datasource/test_parquet.py
286 passed, 6 skipped in 521.25s

$ python -m pytest -q python/ray/data/tests/datasource/test_read_parquet_v2.py
32 passed

$ python -m pytest -q python/ray/data/tests/unit/datasource_v2/ python/ray/data/_internal/datasource_v2/tests/
181 passed

$ python -m pytest -q python/ray/data/tests/test_predicate_pushdown.py \
                     python/ray/data/tests/test_execution_optimizer_limit_pushdown.py
78 passed
```

The 286-test parquet suite is the one that matters — it runs the full
read surface with the footer path as the default rather than behind a
flag. The release YAML is additionally checked for parse validity,
unresolved `{{...}}` in any pin, duplicate `byod:` keys, and
rendered-name stability.

## Stack

Final step of an 11-step split of ray-project#64985 (43 files / +3234 −719, not
reviewable as one unit).

- ray-project#65167 `[1]` · ray-project#65168 `[2]` · ray-project#65214 `[3]` · ray-project#65210 `[4]` · ray-project#65273
`[5]` · ray-project#65596 `[6]` · ray-project#65806 `[8]` · ray-project#65169 `[9]` — all merged
- `[7]` (count push-down fix) was absorbed into ray-project#65596
- `[10]` (release tuning) is folded into this PR, so a release run
exercises the flip and its tuning together
- **this PR** `[11/11]`

---
Not a duplicate. File-level overlap check: ray-project#63158 none; ray-project#65142 overlaps
`file_indexer.py` / `context.py`; ray-project#65406 / ray-project#65407 (arrow-rs reader A/B)
overlap broadly but are explicitly `[DO NOT MERGE]` benchmark branches
carrying the footer work out-of-tree.
AI assistance was used; every line reviewed by me and tests run locally.

---------

Signed-off-by: Goutam <[email protected]>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Contributed by the community data Ray Data-related issues go add ONLY when ready to merge, run all tests unstale A PR that has been marked unstale. It will not get marked stale again if this label is on it.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants