Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
duckdb::ArrowListData< BUFTYPE > Struct Template Reference

Static Public Member Functions

static void Initialize (ArrowAppendData &result, const LogicalType &type, idx_t capacity)
static void Append (ArrowAppendData &append_data, Vector &input, idx_t from, idx_t to, idx_t input_size)
static void Finalize (ArrowAppendData &append_data, const LogicalType &type, ArrowArray *result)
static void AppendOffsets (ArrowAppendData &append_data, UnifiedVectorFormat &format, idx_t from, idx_t to, vector< sel_t > &child_sel)

Member Function Documentation

◆ Initialize()

template<class BUFTYPE = int64_t>
void duckdb::ArrowListData< BUFTYPE >::Initialize ( ArrowAppendData & result,
const LogicalType & type,
idx_t capacity )
inlinestatic
33533 {
33535 result.GetMainBuffer().reserve((capacity + 1) * sizeof(BUFTYPE));
33537 result.child_data.push_back(std::move(child_buffer));
33538 }
Definition duckdb.cpp:33531

◆ Append()

template<class BUFTYPE = int64_t>
void duckdb::ArrowListData< BUFTYPE >::Append ( ArrowAppendData & append_data,
Vector & input,
idx_t from,
idx_t to,
idx_t input_size )
inlinestatic
33540 {
33542 input.ToUnifiedFormat(input_size, format);
33543 idx_t size = to - from;
33545 append_data.AppendValidity(format, from, to);
33546 AppendOffsets(append_data, format, from, to, child_indices);
33547
33548 // append the child vector of the list
33551 auto child_size = child_indices.size();
33552 Vector child_copy(child.GetType());
33554 append_data.child_data[0]->append_vector(*append_data.child_data[0], child_copy, 0, child_size, child_size);
33555 append_data.row_count += size;
33556 }
static DUCKDB_API const Vector & GetEntry(const Vector &vector)
Gets a reference to the underlying child-vector of a list.
Definition duckdb.cpp:138203

◆ Finalize()

template<class BUFTYPE = int64_t>
void duckdb::ArrowListData< BUFTYPE >::Finalize ( ArrowAppendData & append_data,
const LogicalType & type,
ArrowArray * result )
inlinestatic
33558 {
33559 result->n_buffers = 2;
33560 result->buffers[1] = append_data.GetMainBuffer().data();
33561
33564 result->children = append_data.child_pointers.data();
33565 result->n_children = 1;
33566 append_data.child_arrays[0] = *ArrowAppender::FinalizeChild(child_type, std::move(append_data.child_data[0]));
33567 }

◆ AppendOffsets()

template<class BUFTYPE = int64_t>
void duckdb::ArrowListData< BUFTYPE >::AppendOffsets ( ArrowAppendData & append_data,
UnifiedVectorFormat & format,
idx_t from,
idx_t to,
vector< sel_t > & child_sel )
inlinestatic
33571 {
33572 // resize the offset buffer - the offset buffer holds the offsets into the child array
33573 idx_t size = to - from;
33574 auto &main_buffer = append_data.GetMainBuffer();
33575
33576 main_buffer.resize(main_buffer.size() + sizeof(BUFTYPE) * (size + 1));
33578 auto offset_data = main_buffer.GetData<BUFTYPE>();
33579 if (append_data.row_count == 0) {
33580 // first entry
33581 offset_data[0] = 0;
33582 }
33583 // set up the offsets using the list entries
33584 auto last_offset = offset_data[append_data.row_count];
33585 for (idx_t i = from; i < to; i++) {
33586 auto source_idx = format.sel->get_index(i);
33587 auto offset_idx = append_data.row_count + i + 1 - from;
33588
33589 if (!format.validity.RowIsValid(source_idx)) {
33591 continue;
33592 }
33593
33594 // append the offset data
33595 auto list_length = data[source_idx].length;
33599 "Arrow Appender: The maximum combined list offset for regular list buffers is "
33600 "%u but the offset of %lu exceeds this.\n* SET arrow_large_buffer_size=true to use large list "
33601 "buffers",
33603 }
33606
33607 for (idx_t k = 0; k < list_length; k++) {
33609 }
33610 }
33611 }

The documentation for this struct was generated from the following file: