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::ListCast Struct Reference

Static Public Member Functions

static bool ListToListCast (Vector &source, Vector &result, idx_t count, CastParameters &parameters)

Member Function Documentation

◆ ListToListCast()

bool duckdb::ListCast::ListToListCast ( Vector & source,
Vector & result,
idx_t count,
CastParameters & parameters )
static
214043 {
214044 auto &cast_data = parameters.cast_data->Cast<ListBoundCastData>();
214045
214046 // only handle constant and flat vectors here for now
214047 if (source.GetVectorType() == VectorType::CONSTANT_VECTOR) {
214048 result.SetVectorType(source.GetVectorType());
214049 const bool is_null = ConstantVector::IsNull(source);
214050 ConstantVector::SetNull(result, is_null);
214051
214052 if (!is_null) {
214053 auto ldata = ConstantVector::GetData<list_entry_t>(source);
214054 auto tdata = ConstantVector::GetData<list_entry_t>(result);
214055 *tdata = *ldata;
214056 }
214057 } else {
214058 source.Flatten(count);
214059 result.SetVectorType(VectorType::FLAT_VECTOR);
214060 FlatVector::SetValidity(result, FlatVector::Validity(source));
214061
214062 auto ldata = FlatVector::GetData<list_entry_t>(source);
214063 auto tdata = FlatVector::GetData<list_entry_t>(result);
214064 for (idx_t i = 0; i < count; i++) {
214065 tdata[i] = ldata[i];
214066 }
214067 }
214068 auto &source_cc = ListVector::GetEntry(source);
214069 auto source_size = ListVector::GetListSize(source);
214070
214071 ListVector::Reserve(result, source_size);
214072 auto &append_vector = ListVector::GetEntry(result);
214073
214074 CastParameters child_parameters(parameters, cast_data.child_cast_info.cast_data, parameters.local_state);
214075 bool all_succeeded = cast_data.child_cast_info.function(source_cc, append_vector, source_size, child_parameters);
214076 ListVector::SetListSize(result, source_size);
214077 D_ASSERT(ListVector::GetListSize(result) == source_size);
214078 return all_succeeded;
214079}
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237
static DUCKDB_API const Vector & GetEntry(const Vector &vector)
Gets a reference to the underlying child-vector of a list.
Definition duckdb.cpp:138203
static DUCKDB_API void SetListSize(Vector &vec, idx_t size)
Sets the total size of the underlying child-vector of a list.
Definition duckdb.cpp:138248
static DUCKDB_API void Reserve(Vector &vec, idx_t required_capacity)
Sets the total capacity of the underlying child-vector of a list.
Definition duckdb.cpp:138211
static DUCKDB_API idx_t GetListSize(const Vector &vector)
Gets the total size of the underlying child-vector of a list.
Definition duckdb.cpp:138221

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