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

Method invoke_with_args

datafusion/functions/src/unicode/right.rs:90–102  ·  view source on GitHub ↗

Returns right n characters in the string, or when n is negative, returns all but first |n| characters. right('abcde', 2) = 'de' right('abcde', -2) = 'cde' The implementation uses UTF-8 code points as characters

(&self, args: ScalarFunctionArgs)

Source from the content-addressed store, hash-verified

88 /// right('abcde', -2) = 'cde'
89 /// The implementation uses UTF-8 code points as characters
90 fn invoke_with_args(&self, args: ScalarFunctionArgs) -> Result<ColumnarValue> {
91 let args = &args.args;
92 match args[0].data_type() {
93 DataType::Utf8 | DataType::Utf8View | DataType::LargeUtf8 => {
94 make_scalar_function(general_left_right::<RightSlicer>, vec![])(args)
95 }
96 other => exec_err!(
97 "Unsupported data type {other:?} for function {},\
98 expected Utf8View, Utf8 or LargeUtf8.",
99 self.name()
100 ),
101 }
102 }
103
104 fn documentation(&self) -> Option<&Documentation> {
105 self.doc()

Callers

nothing calls this directly

Calls 2

make_scalar_functionFunction · 0.50
data_typeMethod · 0.45

Tested by

no test coverage detected