MCPcopy Create free account
hub / github.com/apache/datafusion / verify_function_arguments

Function verify_function_arguments

datafusion/expr/src/expr_schema.rs:720–743  ·  view source on GitHub ↗

Verify that function is invoked with correct number and type of arguments as defined in `TypeSignature`.

(
    function: &F,
    input_fields: &[FieldRef],
)

Source from the content-addressed store, hash-verified

718/// Verify that function is invoked with correct number and type of arguments as
719/// defined in `TypeSignature`.
720fn verify_function_arguments<F: UDFCoercionExt>(
721 function: &F,
722 input_fields: &[FieldRef],
723) -> Result<Vec<FieldRef>> {
724 fields_with_udf(input_fields, function).map_err(|err| {
725 let data_types = input_fields
726 .iter()
727 .map(|f| f.data_type())
728 .cloned()
729 .collect::<Vec<_>>();
730 plan_datafusion_err!(
731 "{}. {}",
732 match err {
733 DataFusionError::Plan(msg) => msg,
734 err => err.to_string(),
735 },
736 utils::generate_signature_error_message(
737 function.name(),
738 function.signature(),
739 &data_types
740 )
741 )
742 })
743}
744
745/// Returns the innermost [Expr] that is provably null if `expr` is null.
746fn unwrap_certainly_null_expr(expr: &Expr) -> &Expr {

Callers 1

to_fieldMethod · 0.85

Calls 5

fields_with_udfFunction · 0.85
clonedMethod · 0.45
mapMethod · 0.45
iterMethod · 0.45
data_typeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…