Skip to content

Commit

Permalink
chore: fix type
Browse files Browse the repository at this point in the history
  • Loading branch information
appletreeisyellow committed May 21, 2024
1 parent 6ea3a01 commit 2056931
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions datafusion/functions/src/core/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ make_udf_function!(coalesce::CoalesceFunc, COALESCE, coalesce);

// Export the functions out of this package, both as expr_fn as well as a list of functions
pub mod expr_fn {
use datafusion_expr::Expr;
use datafusion_expr::{Expr, Literal};

/// returns NULL if value1 equals value2; otherwise it returns value1. This
/// can be used to perform the inverse operation of the COALESCE expression
Expand Down Expand Up @@ -84,8 +84,8 @@ pub mod expr_fn {
}

/// Returns the value of the field with the given name from the struct
pub fn get_field(arg1: Expr, arg2: Expr) -> Expr {
super::get_field().call(vec![arg1, arg2])
pub fn get_field(arg1: Expr, field_name: impl Literal) -> Expr {
super::get_field().call(vec![arg1, field_name.lit()])
}

/// Returns `coalesce(args...)`, which evaluates to the value of the first expr which is not NULL
Expand Down

0 comments on commit 2056931

Please sign in to comment.