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

Method invoke_with_args

datafusion/functions/src/encoding/inner.rs:119–129  ·  view source on GitHub ↗
(&self, args: ScalarFunctionArgs)

Source from the content-addressed store, hash-verified

117 }
118
119 fn invoke_with_args(&self, args: ScalarFunctionArgs) -> Result<ColumnarValue> {
120 let [expression, encoding] = take_function_args("encode", &args.args)?;
121 let encoding = Encoding::try_from(encoding)?;
122 match expression {
123 _ if expression.data_type().is_null() => {
124 Ok(ColumnarValue::Scalar(ScalarValue::Utf8(None)))
125 }
126 ColumnarValue::Array(array) => encode_array(array, encoding),
127 ColumnarValue::Scalar(scalar) => encode_scalar(scalar, encoding),
128 }
129 }
130
131 fn documentation(&self) -> Option<&Documentation> {
132 self.doc()

Callers

nothing calls this directly

Calls 7

take_function_argsFunction · 0.85
encode_arrayFunction · 0.85
encode_scalarFunction · 0.85
decode_arrayFunction · 0.85
decode_scalarFunction · 0.85
is_nullMethod · 0.45
data_typeMethod · 0.45

Tested by

no test coverage detected