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

Method lambda_parameters

datafusion/expr/src/expr.rs:462–487  ·  view source on GitHub ↗

Invokes the inner function [`crate::HigherOrderUDFImpl::lambda_parameters`] using the arguments of this invocation. This expression lambda variables must be already resolved either by coming from the default sql planner or by calling [Expr::resolve_lambda_variables] or [LogicalPlan::resolve_lambda_variables] [LogicalPlan::resolve_lambda_variables]: crate::LogicalPlan::resolve_lambda_variables

(
        &self,
        schema: &dyn ExprSchema,
    )

Source from the content-addressed store, hash-verified

460 ///
461 /// [LogicalPlan::resolve_lambda_variables]: crate::LogicalPlan::resolve_lambda_variables
462 pub fn lambda_parameters(
463 &self,
464 schema: &dyn ExprSchema,
465 ) -> Result<Vec<Vec<FieldRef>>> {
466 let args = self
467 .args
468 .iter()
469 .map(|e| match e {
470 Expr::Lambda(lambda) => {
471 Ok(ValueOrLambda::Lambda(Some(lambda.body.to_field(schema)?.1)))
472 }
473 _ => Ok(ValueOrLambda::Value(e.to_field(schema)?.1)),
474 })
475 .collect::<Result<Vec<_>>>()?;
476
477 let coerced_fields =
478 value_fields_with_higher_order_udf(&args, self.func.as_ref())?;
479
480 match self.func.lambda_parameters(0, &coerced_fields)? {
481 LambdaParametersProgress::Partial(_) => plan_err!(
482 "{} lambda_parameters returned a partial result when the return type of all it's lambdas were provided",
483 self.name()
484 ),
485 LambdaParametersProgress::Complete(items) => Ok(items),
486 }
487 }
488}
489
490impl Hash for HigherOrderFunction {

Callers

nothing calls this directly

Calls 7

LambdaClass · 0.85
to_fieldMethod · 0.80
ValueEnum · 0.50
mapMethod · 0.45
iterMethod · 0.45
as_refMethod · 0.45

Tested by

no test coverage detected