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

Method take

datafusion/functions-aggregate/src/first_last/state.rs:87–94  ·  view source on GitHub ↗
(&mut self, emit_to: EmitTo)

Source from the content-addressed store, hash-verified

85 }
86
87 fn take(&mut self, emit_to: EmitTo) -> Result<ArrayRef> {
88 let values = emit_to.take_needed(&mut self.vals);
89 let null_buf = NullBuffer::new(take_need(&mut self.nulls, emit_to));
90 let array: PrimitiveArray<T> =
91 PrimitiveArray::<T>::new(values.into(), Some(null_buf))
92 .with_data_type(self.data_type.clone());
93 Ok(Arc::new(array))
94 }
95
96 fn size(&self) -> usize {
97 self.vals.capacity() * size_of::<T::Native>() + self.nulls.capacity() / 8

Callers 15

general_replaceFunction · 0.45
random_tokenFunction · 0.45
generate_random_stringFunction · 0.45
create_space_trim_argsFunction · 0.45
gen_string_arrayFunction · 0.45
dataFunction · 0.45
gen_string_arrayFunction · 0.45
gen_string_arrayFunction · 0.45
generate_random_stringFunction · 0.45
create_scalar_argsFunction · 0.45
gen_string_arrayFunction · 0.45

Calls 13

newFunction · 0.85
take_needFunction · 0.85
take_neededMethod · 0.80
with_data_typeMethod · 0.80
flattenMethod · 0.80
intoMethod · 0.45
cloneMethod · 0.45
iterMethod · 0.45
lenMethod · 0.45
capacityMethod · 0.45
append_valueMethod · 0.45
append_nullMethod · 0.45