Skip to content

Commit

Permalink
Improve docs for aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
alamb committed Dec 19, 2023
1 parent 3c86513 commit 3ce1802
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions datafusion/expr/src/udf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,15 @@ pub trait ScalarUDFImpl {
/// and treating all arguments as arrays will work, but will be slower.
fn invoke(&self, args: &[ColumnarValue]) -> Result<ColumnarValue>;

/// Returns any aliases (alternate names) for this function. This should not
/// include the value of [`Self::name`]. Defaults to `[]` (no aliases)
/// Returns any aliases (alternate names) for this function.
///
/// Aliases can be used to invoke the same function using different names.
/// For example in some databases `now()` and `current_timestamp()` are
/// aliases for the same function. This behavior can be obtained by
/// returning `current_timestamp` as an alias for the `now` function.
///
/// Note: `aliases` should only include names other than [`Self::name`].
/// Defaults to `[]` (no aliases)
fn aliases(&self) -> &[String] {
&[]
}
Expand Down

0 comments on commit 3ce1802

Please sign in to comment.