Skip to content

Support unbound transform in predicate expression #2456

@advancedxy

Description

@advancedxy

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

# 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<Predicate, 2>),
    /// Or predicate, for example, `a > 10 OR b < 20`.
    Or(LogicalExpression<Predicate, 2>),
    /// Not predicate, for example, `NOT (a > 10)`.
    Not(LogicalExpression<Predicate, 1>),
    /// Unary expression, for example, `a IS NULL`.
    Unary(UnaryExpression<Reference>),
    /// Binary expression, for example, `a > 10`.
    Binary(BinaryExpression<Reference>),
    /// Set predicates, for example, `a in (1, 2, 3)`.
    Set(SetExpression<Reference>),
}

Describe the solution you'd like

Add unbound transform to the predicate expression.

Willingness to contribute

I can contribute to this feature independently

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions