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::ArrowMapData< 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)

Member Function Documentation

◆ Initialize()

template<class BUFTYPE = int64_t>
void duckdb::ArrowMapData< BUFTYPE >::Initialize ( ArrowAppendData & result,
const LogicalType & type,
idx_t capacity )
inlinestatic
33741 {
33742 // map types are stored in a (too) clever way
33743 // the main buffer holds the null values and the offsets
33744 // then we have a single child, which is a struct of the map_type, and the key_type
33745 result.GetMainBuffer().reserve((capacity + 1) * sizeof(BUFTYPE));
33746
33750 internal_struct->child_data.push_back(ArrowAppender::InitializeChild(key_type, capacity, result.options));
33752
33753 result.child_data.push_back(std::move(internal_struct));
33754 }
Definition duckdb.cpp:33739

◆ Append()

template<class BUFTYPE = int64_t>
void duckdb::ArrowMapData< BUFTYPE >::Append ( ArrowAppendData & append_data,
Vector & input,
idx_t from,
idx_t to,
idx_t input_size )
inlinestatic
33756 {
33758 input.ToUnifiedFormat(input_size, format);
33759 idx_t size = to - from;
33760 append_data.AppendValidity(format, from, to);
33763
33767 auto list_size = child_indices.size();
33768
33769 auto &struct_data = *append_data.child_data[0];
33770 auto &key_data = *struct_data.child_data[0];
33771 auto &value_data = *struct_data.child_data[1];
33772
33779
33780 append_data.row_count += size;
33781 struct_data.row_count += size;
33782 }

◆ Finalize()

template<class BUFTYPE = int64_t>
void duckdb::ArrowMapData< BUFTYPE >::Finalize ( ArrowAppendData & append_data,
const LogicalType & type,
ArrowArray * result )
inlinestatic
33784 {
33785 // set up the main map buffer
33787 result->n_buffers = 2;
33788 result->buffers[1] = append_data.GetMainBuffer().data();
33789
33790 // the main map buffer has a single child: a struct
33792 result->children = append_data.child_pointers.data();
33793 result->n_children = 1;
33794
33795 auto &struct_data = *append_data.child_data[0];
33797
33798 // Initialize the struct array data
33799 const auto struct_child_count = 2;
33801 struct_result->children = struct_data.child_pointers.data();
33802 struct_result->n_buffers = 1;
33803 struct_result->n_children = struct_child_count;
33804 struct_result->length = NumericCast<int64_t>(struct_data.child_data[0]->row_count);
33805
33806 append_data.child_arrays[0] = *struct_result;
33807
33808 D_ASSERT(struct_data.child_data[0]->row_count == struct_data.child_data[1]->row_count);
33809
33813 struct_data.child_arrays[0] = *key_data;
33814 struct_data.child_arrays[1] = *ArrowAppender::FinalizeChild(value_type, std::move(struct_data.child_data[1]));
33815
33816 // keys cannot have null values
33817 if (key_data->null_count > 0) {
33818 throw std::runtime_error("Arrow doesn't accept NULL keys on Maps");
33819 }
33820 }

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