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::ArrowVarcharData< SRC, OP, BUFTYPE > Struct Template Reference

Static Public Member Functions

static void Initialize (ArrowAppendData &result, const LogicalType &type, idx_t capacity)
template<bool LARGE_STRING>
static void AppendTemplated (ArrowAppendData &append_data, Vector &input, idx_t from, idx_t to, idx_t input_size)
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 SRC = string_t, class OP = ArrowVarcharConverter, class BUFTYPE = int64_t>
void duckdb::ArrowVarcharData< SRC, OP, BUFTYPE >::Initialize ( ArrowAppendData & result,
const LogicalType & type,
idx_t capacity )
inlinestatic
33959 {
33960 result.GetMainBuffer().reserve((capacity + 1) * sizeof(BUFTYPE));
33961 result.GetAuxBuffer().reserve(capacity);
33962 }
Definition duckdb.cpp:33958

◆ AppendTemplated()

template<class SRC = string_t, class OP = ArrowVarcharConverter, class BUFTYPE = int64_t>
template<bool LARGE_STRING>
void duckdb::ArrowVarcharData< SRC, OP, BUFTYPE >::AppendTemplated ( ArrowAppendData & append_data,
Vector & input,
idx_t from,
idx_t to,
idx_t input_size )
inlinestatic
33965 {
33966 idx_t size = to - from;
33968 input.ToUnifiedFormat(input_size, format);
33969 auto &main_buffer = append_data.GetMainBuffer();
33970 auto &validity_buffer = append_data.GetValidityBuffer();
33971 auto &aux_buffer = append_data.GetAuxBuffer();
33972
33973 // resize the validity mask and set up the validity buffer for iteration
33975 auto validity_data = (uint8_t *)validity_buffer.data();
33976
33977 // resize the offset buffer - the offset buffer holds the offsets into the child array
33978 main_buffer.resize(main_buffer.size() + sizeof(BUFTYPE) * (size + 1));
33980 auto offset_data = main_buffer.GetData<BUFTYPE>();
33981 if (append_data.row_count == 0) {
33982 // first entry
33983 offset_data[0] = 0;
33984 }
33985 // now append the string data to the auxiliary buffer
33986 // the auxiliary buffer's length depends on the string lengths, so we resize as required
33987 auto last_offset = offset_data[append_data.row_count];
33988 for (idx_t i = from; i < to; i++) {
33989 auto source_idx = format.sel->get_index(i);
33990 auto offset_idx = append_data.row_count + i + 1 - from;
33991
33992 if (!format.validity.RowIsValid(source_idx)) {
33998 continue;
33999 }
34000
34002
34003 // append the offset data
34005 if (!LARGE_STRING &&
34007 D_ASSERT(append_data.options.arrow_offset_size == ArrowOffsetSize::REGULAR);
34009 "Arrow Appender: The maximum total string size for regular string buffers is "
34010 "%u but the offset of %lu exceeds this.\n* SET arrow_large_buffer_size=true to use large string "
34011 "buffers",
34013 }
34015
34016 // resize the string buffer if required, and write the string data
34017 aux_buffer.resize(current_offset);
34019
34021 }
34022 append_data.row_count += size;
34023 }

◆ Append()

template<class SRC = string_t, class OP = ArrowVarcharConverter, class BUFTYPE = int64_t>
void duckdb::ArrowVarcharData< SRC, OP, BUFTYPE >::Append ( ArrowAppendData & append_data,
Vector & input,
idx_t from,
idx_t to,
idx_t input_size )
inlinestatic
34025 {
34026 if (append_data.options.arrow_offset_size == ArrowOffsetSize::REGULAR) {
34027 // Check if the offset exceeds the max supported value
34028 AppendTemplated<false>(append_data, input, from, to, input_size);
34029 } else {
34030 AppendTemplated<true>(append_data, input, from, to, input_size);
34031 }
34032 }

◆ Finalize()

template<class SRC = string_t, class OP = ArrowVarcharConverter, class BUFTYPE = int64_t>
void duckdb::ArrowVarcharData< SRC, OP, BUFTYPE >::Finalize ( ArrowAppendData & append_data,
const LogicalType & type,
ArrowArray * result )
inlinestatic
34034 {
34035 result->n_buffers = 3;
34036 result->buffers[1] = append_data.GetMainBuffer().data();
34037 result->buffers[2] = append_data.GetAuxBuffer().data();
34038 }

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