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

Method format

datafusion/spark/src/function/string/format_string.rs:361–381  ·  view source on GitHub ↗
(&self, args: &[ScalarValue])

Source from the content-addressed store, hash-verified

359 }
360
361 pub fn format(&self, args: &[ScalarValue]) -> Result<String> {
362 if args.len() < self.arg_num {
363 return exec_err!(
364 "Expected at least {} arguments, got {}",
365 self.arg_num,
366 args.len()
367 );
368 }
369 let mut string = String::new();
370 for element in &self.elements {
371 match element {
372 FormatElement::Verbatim(text) => {
373 string.push_str(text);
374 }
375 FormatElement::Format(spec) => {
376 spec.format(&mut string, &args[spec.argument_index - 1])?;
377 }
378 }
379 }
380 Ok(string)
381 }
382}
383
384#[derive(Debug)]

Callers 7

update_commit_cargo_tomlFunction · 0.80
mainFunction · 0.80
print_pullsFunction · 0.80
invoke_with_argsMethod · 0.80
format_time_componentMethod · 0.80

Calls 15

newFunction · 0.85
integer_scalar_to_charFunction · 0.85
format_stringMethod · 0.80
format_booleanMethod · 0.80
format_charMethod · 0.80
format_signedMethod · 0.80
format_unsignedMethod · 0.80
supports_integerMethod · 0.80
format_floatMethod · 0.80
spark_stringMethod · 0.80
format_hex_floatMethod · 0.80
supports_floatMethod · 0.80

Tested by

no test coverage detected