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

Function trim_and_append_view

datafusion/functions/src/string/common.rs:248–263  ·  view source on GitHub ↗
(
    src_str_opt: Option<&str>,
    pattern: &[char],
    views_buf: &mut Vec<u128>,
    null_builder: &mut NullBufferBuilder,
    original_view: &u128,
)

Source from the content-addressed store, hash-verified

246/// - `original_view`: The original view value (that contains src_str_opt)
247#[inline]
248fn trim_and_append_view<Tr: Trimmer>(
249 src_str_opt: Option<&str>,
250 pattern: &[char],
251 views_buf: &mut Vec<u128>,
252 null_builder: &mut NullBufferBuilder,
253 original_view: &u128,
254) {
255 if let Some(src_str) = src_str_opt {
256 let (trimmed, offset) = Tr::trim(src_str, pattern);
257 append_view(views_buf, original_view, trimmed, offset);
258 null_builder.append_non_null();
259 } else {
260 null_builder.append_null();
261 views_buf.push(0);
262 }
263}
264
265/// Applies the trim function to the given string array(s)
266/// and returns a new string array with the trimmed values.

Callers

nothing calls this directly

Calls 4

trimFunction · 0.85
append_viewFunction · 0.85
append_nullMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…