Repository navigation
Description
Is your feature request related to a problem or challenge?
iceberg-rust already performs many levels of data pruning - skipping files, row groups etc. The predicates used to do this are collected when a scan is being built, and they remain static through the entire execution pipeline.
Query engines, like DataFusion, can gather information during a query's execution that can be used to further filter out data being scanned from Iceberg (aka dynamic filtering). However, iceberg-rust doesn't yet have a way for the engine to pass in this information at runtime.
Additionally, if an engine plans FileScanTasks up-front, it needs to be able to use information that becomes available as the query runs to skip file scans that are provably useless.
There is some work ongoing here - #3343 , which plans to implement a general runtime/adaptive pruning system. However, the current proposed changes take effect after a file has been opened, while we could use partition-column information to skip files entirely.
Describe the solution you'd like
I would like to propose a smaller set of changes that allow consumers of the library to use the partition pruning logic that is currently private. This would allow dropping a FileScanTask based on predicates that became available during query execution.
Approach 1
Make ExpressionEvaluator and InclusiveProjection public. These provide the building blocks that engines can use to implement this filtering themselves.
However, these aren't enough on their own; callers would also need to build the partition schema, handle partition spec changes etc. This would also tie callers to iceberg-rust internals that may change over time.
There is a draft PR here in DataFusion Distributed that reimplements these pieces today.
Approach 2
Create a public PartitionFilter utility which performs the same work - evaluates whether a FileScanTask can be skipped based on the given predicate - but has its internals abstracted away from the user.
The API could be something like -
let filter = PartitionFilter::try_new(predicate, task.schema_ref(), spec, task.case_sensitive())?;
if !filter.can_match(partition)? {
// skip the task
}I have a draft version of this approach here - the set of changes are fairly small; if the structure looks acceptable, I can iterate on it to make it suitable for a review and merging it in.
There might be other approaches that I am missing due to lack of context, and I'm happy to pursue any path that the maintainers feel comfortable with - the goal is to make it possible for query engines to make scan decisions at runtime
Willingness to contribute
I would be willing to contribute to this feature with guidance from the Iceberg Rust community
Activity
[-]feature: exposing utilities for runtime filtering/pruning[/-][+]feature: exposing utilities for partition-based runtime filtering/pruning[/+]Perseus commentedon Nov 12, 2026
Some more context from other libraries/query engines
The Java library (https://github.com/apache/iceberg) exposes all the functions required to do the partition evaluation -
Evaluator(equivalent toExpressionEvaluatorin iceberg-rust)Projection(containsInclusiveProjectionequivalent for iceberg-rust)Engines like Spark that plan the scan tasks eagerly use these APIs to perform runtime filtering for partitions
nevzheng commentedon Nov 12, 2026
Thanks for writing this up, @Perseus, and for the draft in #3674.
The use case makes sense to me: engines learn things during execution (e.g. DataFusion dynamic filters from a join build side) that could prune whole files by partition, and today there's no supported way to do that without reimplementing internals, as the DataFusion Distributed draft shows.
High level: From my perspective, this feels like a new public API for iceberg-rust, so it seems worth taking extra care in how it's designed and maintained. For that reason I lean toward Approach 2: a small, deliberate surface rather than making
ExpressionEvaluator/InclusiveProjectionpublic. I'm not sure if those were intended as public contracts, and exposing them would push partition-schema construction and spec evolution onto callers and lock in internals that may need to change.A possible way to approach it:
FileScanTaskcan be skipped based on its partition values. Define that well and keep the rest internal.Things a scope doc could cover:
Details
Evaluator/Projection), and which are in scope for v1 vs. later.falseis safe to skip on andtruemeans "maybe". Something likemight_matchcould make that conservative contract more explicit.spec_idinternally could help, and would also hide spec evolution from callers.Predicate,FileScanTask) would keep internal types out of the public surface.Evaluatorbehavior, plus an end-to-end test showing files actually get skipped in an engine integration.#[non_exhaustive], builder-style construction, possibly marking it experimental at first), and how it relates to a future built-in runtime-filter hook. Ideally iceberg-rust's own planning uses the same code path, so the API stays well tested.Happy to help review as this evolves. Thanks for driving it!
Looking forward to any maintainers thoughts on this.
cc: @mbutrovich