Skip to content

[EPIC] Execution-time adaptive pruning for Iceberg readers #3343

Open

Description

@unikdahal

What's the feature are you trying to implement?

Summary

Add generic execution-time predicate support to iceberg-rust so readers can progressively avoid file, row-group, page, and payload reads as predicates become available during query execution.

The reader remains producer-agnostic: callers publish Iceberg predicates and generations, while iceberg-rust handles safe application through the existing reader pipeline.

This epic tracks the upstream reader infrastructure required by execution engines such as DataFusion Comet.

Related work

Work items

Dependencies

Reader foundations

Adaptive pruning

  • Reject file tasks before footer and delete-file I/O
  • Refresh predicates and prune unread row groups
  • Represent static page selections per row group
  • Preserve position and equality deletes during live pruning
  • Refresh page pruning and row filters after predicate updates
  • Preserve late materialization with runtime predicates

Correctness and robustness

  • Bound refresh overhead and cover reader edge cases
  • Add adaptive pruning observability and reader-level metrics
  • Complete delete, split-task, schema-evolution, and fallback coverage

Correctness principles

  • Runtime predicates are conservative restrictions.
  • Previously skipped data is never required by a later predicate publication.
  • Missing or unusable statistics retain candidates.
  • Runtime predicate failures must not disable planned filtering or delete handling.
  • Position deletes and metadata row positions preserve original file ordinals.
  • Equality deletes remain active across predicate refreshes.
  • Existing reader and schema adaptation paths should be reused rather than duplicated.

Definition of done

  • No private Arrow/Parquet patch is required.
  • Generic task-start and live runtime predicate APIs are upstream.
  • Whole-file, row-group, page, and row-filter pruning use the existing reader pipeline.
  • Position deletes, equality deletes, and combined deletes are supported.
  • Stable predicates add minimal reader overhead.
  • Each work item above is linked to its corresponding issue or PR.

Willingness to contribute

I can contribute to this feature independently

Activity

  1. unikdahal commented on Oct 4, 2026

    @unikdahal
    Author

    take

  2. unikdahal commented on Oct 12, 2026

    @unikdahal
    Author

    Hi all, a quick heads-up: I'll be away for about a month starting now, and I don't want this epic to block anyone in the meantime. If any part of it is useful to you, please feel free to pick it up, rework it, or take it in a different direction. There's no need to wait for me or ask first.

    Here's where things stand, to make that easier:

    A few things I learned from an end-to-end prototype (iceberg-rust plus DataFusion Comet), in case they save someone time:

    • Keep runtime predicates advisory. A bind, planning or evaluation failure should only drop the runtime restriction, never the planned filter or delete handling.
    • Bind once per generation, not once per task. Binding a large IN list for every file adds up quickly. A monotonic generation from the publisher keeps the cache simple and safe.
    • Floats need care. Iceberg statistics and Arrow kernels disagree on NaN and signed zero, so I declined float runtime predicates and guarded the "all rows match" shortcut for floats.
    • Large membership sets benefit from hash lookups in the row filter (binary and decimal included), and a task needs a cap on how much replanning it does when predicates change often.
    • Position deletes and _pos / _row_id have to keep original file ordinals through all of the pruning.

    I also just saw apache/datafusion-iceberg#68, which proposes a very similar hook. If that design, or its author, ends up driving this, I'm completely happy for #3351 to be closed in favour of it. What matters is that the feature lands, not whose PR it is.

    Thanks to everyone who has weighed in on the related issues and PRs, and sorry for leaving this half-finished for a few weeks.

  3. alexanderbianchi commented on Oct 12, 2026

    @alexanderbianchi

    Thanks for all the summaries, they are useful. DataDog is very interested in dynamic filtering (ideally landing it before end of november, and ideally on the open source not in our fork that we try and keep slim) I'll be happy to keep an eye on any reviews of #3351 and dive in responding to them. I still need to do a review myself.

  4. anuragmantri commented on Oct 12, 2026

    @anuragmantri
    Contributor

    Thanks for the write up and summaries!

    I picked up "Add opt-in file statistics retention to scan tasks" in #3422 as I needed it for an optimization in apache/datafusion-iceberg#55.

  5. JeonDaehong commented on Oct 12, 2026

    @JeonDaehong

    Thanks @unikdahal, and enjoy the time off! I'll pick up #3345: rebase it on #3145 and switch the unknown size to Option. I'll open a follow-up PR crediting you and link it here.

  6. JeonDaehong commented on Oct 13, 2026

    @JeonDaehong

    Opened #3433 for #3345.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions