apache / iceberg-rust

Apache Iceberg
https://rust.iceberg.apache.org/
Apache License 2.0
616 stars 138 forks source link

Implement transform_literal for TransformFunction #283

Closed ZENOTME closed 6 months ago

ZENOTME commented 6 months ago

I'm quite unsure about the fn transform and the handling of the arrow_array - seems kinda clunky?

I think the transform can provide an interface like transform_literal later.

pub trait TransformFunction: Send {
    /// transform will take an input array and transform it into a new array.
    /// The implementation of this function will need to check and downcast the input to specific
    /// type.
    fn transform(&self, input: ArrayRef) -> Result<ArrayRef>;
+ fn transform_literal(&self, literal:Literal) -> Result<Literal>; 
}

Originally posted by @ZENOTME in https://github.com/apache/iceberg-rust/issues/269#issuecomment-2004158618