From 2056931b830d1454f78b3bb197328c49727b6bd9 Mon Sep 17 00:00:00 2001 From: Chunchun <14298407+appletreeisyellow@users.noreply.github.com> Date: Tue, 21 May 2024 09:52:29 -0500 Subject: [PATCH] chore: fix type --- datafusion/functions/src/core/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/datafusion/functions/src/core/mod.rs b/datafusion/functions/src/core/mod.rs index 6859379fbbf9..349d483a4100 100644 --- a/datafusion/functions/src/core/mod.rs +++ b/datafusion/functions/src/core/mod.rs @@ -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 @@ -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