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

Function sliced_list_values

datafusion/common/src/utils/mod.rs:1084–1098  ·  view source on GitHub ↗
(list: &GenericListArray<O>)

Source from the content-addressed store, hash-verified

1082}
1083
1084fn sliced_list_values<O: OffsetSizeTrait>(list: &GenericListArray<O>) -> ArrayRef {
1085 let values = list.values();
1086 let offsets = list.offsets();
1087
1088 if let (Some(first), Some(last)) = (offsets.first(), offsets.last()) {
1089 let first = first.as_usize();
1090 let last = last.as_usize();
1091
1092 if first != 0 || last != values.len() {
1093 return values.slice(first, last - first);
1094 }
1095 }
1096
1097 Arc::clone(values)
1098}
1099
1100/// If `list` is sliced, returns an adjusted offset buffer so that
1101/// it points to the sliced portion of the list values, and not the whole list values

Callers 1

list_valuesFunction · 0.85

Calls 7

offsetsMethod · 0.80
lastMethod · 0.80
sliceMethod · 0.80
valuesMethod · 0.45
firstMethod · 0.45
as_usizeMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…