Skip to content

Commit

Permalink
clarify docs
Browse files Browse the repository at this point in the history
  • Loading branch information
alamb committed Apr 25, 2024
1 parent 7dbf695 commit cadb59e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion datafusion/expr/src/udf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,15 @@ pub trait ScalarUDFImpl: Debug + Send + Sync {
)
}

/// Invoke the function without `args` but number of rows, returning the appropriate result
/// Invoke the function without `args` but number of rows, returning the
/// appropriate result
///
/// Note this is different than [`Self::invoke`] in that it is called with
/// the number of rows in the batch.
///
/// For functions that return a constant such as `pi()` the number of rows
/// does not matter. However for functions such as `random()` that return a
/// batch with different values for each row, the number of rows is needed.
fn invoke_no_args(&self, _number_rows: usize) -> Result<ColumnarValue> {
not_impl_err!(
"Function {} does not implement invoke_no_args but called",
Expand Down

0 comments on commit cadb59e

Please sign in to comment.