Skip to content

Commit

Permalink
UDF evaluate bounds default impl
Browse files Browse the repository at this point in the history
  • Loading branch information
ch-sc committed Feb 25, 2025
1 parent 8813adb commit f521a6a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions datafusion/expr/src/udf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -722,8 +722,13 @@ pub trait ScalarUDFImpl: Debug + Send + Sync {
///
/// If the function is `ABS(a)`, and the input interval is `a: [-3, 2]`,
/// then the output interval would be `[0, 3]`.
fn evaluate_bounds(&self, _input: &[&Interval]) -> Result<Interval> {
not_impl_err!("Not implemented for UDF {:?}", self)
fn evaluate_bounds(&self, input: &[&Interval]) -> Result<Interval> {
let input_data_types = input
.iter()
.map(|i| i.data_type())
.collect::<Vec<DataType>>();
let return_type = self.return_type(&input_data_types)?;
Interval::make_unbounded(&return_type)
}

/// Indicates whether this ['ScalarUDFImpl'] supports interval arithmetic.
Expand Down

0 comments on commit f521a6a

Please sign in to comment.