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::ArrowEnumData< TGT > Struct Template Reference
Inheritance diagram for duckdb::ArrowEnumData< TGT >:
Collaboration diagram for duckdb::ArrowEnumData< TGT >:

Static Public Member Functions

static idx_t GetLength (string_t input)
 
static void WriteData (data_ptr_t target, string_t input)
 
static void EnumAppendVector (ArrowAppendData &append_data, const Vector &input, idx_t size)
 
static void Initialize (ArrowAppendData &result, const LogicalType &type, idx_t capacity)
 
static void Finalize (ArrowAppendData &append_data, const LogicalType &type, ArrowArray *result)
 
- Static Public Member Functions inherited from duckdb::ArrowScalarBaseData< TGT, SRC, OP >
static void Append (ArrowAppendData &append_data, Vector &input, idx_t from, idx_t to, idx_t input_size)
 

Member Function Documentation

◆ GetLength()

template<class TGT >
static idx_t duckdb::ArrowEnumData< TGT >::GetLength ( string_t  input)
inlinestatic
33450 {
33451 return input.GetSize();
33452 }

◆ WriteData()

template<class TGT >
static void duckdb::ArrowEnumData< TGT >::WriteData ( data_ptr_t  target,
string_t  input 
)
inlinestatic
33454 {
33455 memcpy(target, input.GetData(), input.GetSize());
33456 }

◆ EnumAppendVector()

template<class TGT >
static void duckdb::ArrowEnumData< TGT >::EnumAppendVector ( ArrowAppendData append_data,
const Vector input,
idx_t  size 
)
inlinestatic
33458 {
33459 D_ASSERT(input.GetVectorType() == VectorType::FLAT_VECTOR);
33460 auto &main_buffer = append_data.GetMainBuffer();
33461 auto &aux_buffer = append_data.GetAuxBuffer();
33462 // resize the validity mask and set up the validity buffer for iteration
33463 ArrowAppendData::ResizeValidity(append_data.GetValidityBuffer(), append_data.row_count + size);
33464
33465 // resize the offset buffer - the offset buffer holds the offsets into the child array
33466 main_buffer.resize(main_buffer.size() + sizeof(int32_t) * (size + 1));
33467 auto data = FlatVector::GetData<string_t>(input);
33468 auto offset_data = main_buffer.GetData<int32_t>();
33469 if (append_data.row_count == 0) {
33470 // first entry
33471 offset_data[0] = 0;
33472 }
33473 // now append the string data to the auxiliary buffer
33474 // the auxiliary buffer's length depends on the string lengths, so we resize as required
33475 auto last_offset = offset_data[append_data.row_count];
33476 for (idx_t i = 0; i < size; i++) {
33477 auto offset_idx = append_data.row_count + i + 1;
33478
33479 auto string_length = GetLength(data[i]);
33480
33481 // append the offset data
33482 auto current_offset = UnsafeNumericCast<idx_t>(last_offset) + string_length;
33483 offset_data[offset_idx] = UnsafeNumericCast<int32_t>(current_offset);
33484
33485 // resize the string buffer if required, and write the string data
33486 aux_buffer.resize(current_offset);
33487 WriteData(aux_buffer.data() + last_offset, data[i]);
33488
33489 last_offset = UnsafeNumericCast<int32_t>(current_offset);
33490 }
33491 append_data.row_count += size;
33492 }
GOpaque< Size > size(const GMat &src)
::int32_t int32_t

◆ Initialize()

template<class TGT >
static void duckdb::ArrowEnumData< TGT >::Initialize ( ArrowAppendData result,
const LogicalType type,
idx_t  capacity 
)
inlinestatic
33494 {
33495 result.GetMainBuffer().reserve(capacity * sizeof(TGT));
33496 // construct the enum child data
33497 auto enum_data = ArrowAppender::InitializeChild(LogicalType::VARCHAR, EnumType::GetSize(type), result.options);
33498 EnumAppendVector(*enum_data, EnumType::GetValuesInsertOrder(type), EnumType::GetSize(type));
33499 result.child_data.push_back(std::move(enum_data));
33500 }

◆ Finalize()

template<class TGT >
static void duckdb::ArrowEnumData< TGT >::Finalize ( ArrowAppendData append_data,
const LogicalType type,
ArrowArray result 
)
inlinestatic
33502 {
33503 result->n_buffers = 2;
33504 result->buffers[1] = append_data.GetMainBuffer().data();
33505 // finalize the enum child data, and assign it to the dictionary
33506 result->dictionary = &append_data.dictionary;
33507 append_data.dictionary =
33508 *ArrowAppender::FinalizeChild(LogicalType::VARCHAR, std::move(append_data.child_data[0]));
33509 }

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