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

Method append_value

datafusion/physical-expr-common/src/binary_view_map.rs:430–454  ·  view source on GitHub ↗

Append a value to our buffers and return the view pointing to it

(&mut self, value: &[u8])

Source from the content-addressed store, hash-verified

428
429 /// Append a value to our buffers and return the view pointing to it
430 fn append_value(&mut self, value: &[u8]) -> u128 {
431 let len = value.len();
432 let view = if len <= 12 {
433 make_view(value, 0, 0)
434 } else {
435 // Ensure buffer is big enough
436 if self.in_progress.len() + len > BYTE_VIEW_MAX_BLOCK_SIZE {
437 let flushed = std::mem::replace(
438 &mut self.in_progress,
439 Vec::with_capacity(BYTE_VIEW_MAX_BLOCK_SIZE),
440 );
441 self.completed.push(Buffer::from_vec(flushed));
442 }
443
444 let buffer_index = self.completed.len() as u32;
445 let offset = self.in_progress.len() as u32;
446 self.in_progress.extend_from_slice(value);
447
448 make_view(value, buffer_index, offset)
449 };
450
451 self.views.push(view);
452 self.nulls.append_non_null();
453 view
454 }
455
456 /// Total number of entries (including null, if present)
457 pub fn len(&self) -> usize {

Callers 15

make_batchFunction · 0.45
criterion_benchmarkFunction · 0.45
make_int32_dict_arrayFunction · 0.45
make_f64_dict_arrayFunction · 0.45
create_decimal_arrayFunction · 0.45
create_batchFunction · 0.45
create_q2_like_batchesFunction · 0.45
create_q16_like_batchesFunction · 0.45
create_q20_like_batchesFunction · 0.45

Calls 3

replaceFunction · 0.85
lenMethod · 0.45
pushMethod · 0.45