apache / apache/iceberg-rust

Support unbound transform in predicate expression

Open
#2,456 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
1.4k
Forks
567
Avg merge
2d 2h
Merged PRs (30d)
93

Description

### Is your feature request related to a problem or challenge?

Currently, only reference is supported in iceberg-rust's predicate API, which means we can construct scan filters like: `ref(a) > 10)`, or `ref(a) == 10` etc. However, for iceberg table with bucket transform, it's impossible to express the bucket partition filter, which should be something like `bucket(10, col_a) >=0 and bucket(10, col_a) < 5`. It would be useful to extend the predicate to support unbound transform in the predicate expression

Ref: the predicate enum definition
```rust
# in the predicate.rs
#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)]
pub enum Predicate {
/// AlwaysTrue predicate, for example, `TRUE`.
AlwaysTrue,
/// AlwaysFalse predicate, for example, `FALSE`.
AlwaysFalse,
/// And predicate, for example, `a > 10 AND b < 20`.
And(LogicalExpression),
/// Or predicate, for example, `a > 10 OR b < 20`.
Or(LogicalExpression),
/// Not predicate, for example, `NOT (a > 10)`.
Not(LogicalExpression),
/// Unary expression, for example, `a IS NULL`.
Unary(UnaryExpression),
/// Binary expression, for example, `a > 10`.
Binary(BinaryExpression),
/// Set predicates, for example, `a in (1, 2, 3)`.
Set(SetExpression),
}
```

### Describe the solution you'd like

Add unbound transform to the predicate expression.

### Willingness to contribute

I can contribute to this feature independently

Contributor guide

Open the contributing guide

Research direction

Start in predicate.rs with the Predicate enum and the existing Reference-based unary, binary, and set expression types. Trace how predicate expressions are constructed and evaluated, then verify that an unbound transform can represent the bucket(10, col_a) range shown in the issue and add coverage for the requested expression.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
data-engineering, databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.