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

Function create_args_n

datafusion/functions-nested/benches/array_replace.rs:450–478  ·  view source on GitHub ↗
(
    haystack: ArrayRef,
    from: ScalarValue,
    to: ScalarValue,
    n: ScalarValue,
)

Source from the content-addressed store, hash-verified

448
449#[inline]
450fn create_args_n(
451 haystack: ArrayRef,
452 from: ScalarValue,
453 to: ScalarValue,
454 n: ScalarValue,
455) -> ScalarFunctionArgs {
456 let number_rows = haystack.len();
457 let haystack_type = haystack.data_type().clone();
458 let from_type = from.data_type().clone();
459 let to_type = to.data_type().clone();
460 let n_type = n.data_type().clone();
461 ScalarFunctionArgs {
462 args: vec![
463 ColumnarValue::Array(haystack),
464 ColumnarValue::Scalar(from),
465 ColumnarValue::Scalar(to),
466 ColumnarValue::Scalar(n),
467 ],
468 arg_fields: vec![
469 Field::new("haystack", haystack_type.clone(), true).into(),
470 Field::new("from", from_type, true).into(),
471 Field::new("to", to_type, true).into(),
472 Field::new("n", n_type, true).into(),
473 ],
474 number_rows,
475 return_field: Field::new("result", haystack_type, true).into(),
476 config_options: Arc::new(ConfigOptions::default()),
477 }
478}
479
480fn create_list_array<Builder, Item>(
481 num_rows: usize,

Callers 2

Calls 5

newFunction · 0.85
lenMethod · 0.45
cloneMethod · 0.45
data_typeMethod · 0.45
intoMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…