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

Static Public Member Functions

static void GenerateVector (TestVectorInfo &info, const LogicalType &type, Vector &result)
static void Generate (TestVectorInfo &info)

Member Function Documentation

◆ GenerateVector()

void duckdb::TestVectorSequence::GenerateVector ( TestVectorInfo & info,
const LogicalType & type,
Vector & result )
inlinestatic
250882 {
250883 D_ASSERT(type == result.GetType());
250884 switch (type.id()) {
250885 case LogicalTypeId::TINYINT:
250886 case LogicalTypeId::SMALLINT:
250887 case LogicalTypeId::INTEGER:
250888 case LogicalTypeId::BIGINT:
250889 case LogicalTypeId::UTINYINT:
250890 case LogicalTypeId::USMALLINT:
250891 case LogicalTypeId::UINTEGER:
250892 case LogicalTypeId::UBIGINT:
250893 result.Sequence(3, 2, 3);
250894#if STANDARD_VECTOR_SIZE <= 2
250895 result.Flatten(3);
250896#endif
250897 return;
250898 default:
250899 break;
250900 }
250901 switch (type.InternalType()) {
250902 case PhysicalType::STRUCT: {
250903 auto &child_entries = StructVector::GetEntries(result);
250904 for (auto &child_entry : child_entries) {
250905 GenerateVector(info, child_entry->GetType(), *child_entry);
250906 }
250907 break;
250908 }
250909 case PhysicalType::LIST: {
250910 D_ASSERT(type.id() != LogicalTypeId::MAP);
250911 auto data = FlatVector::GetData<list_entry_t>(result);
250912 data[0].offset = 0;
250913 data[0].length = 2;
250914 data[1].offset = 2;
250915 data[1].length = 0;
250916 data[2].offset = 2;
250917 data[2].length = 1;
250918
250919 GenerateVector(info, ListType::GetChildType(type), ListVector::GetEntry(result));
250920 ListVector::SetListSize(result, 3);
250921 break;
250922 }
250923 default: {
250924 auto entry = info.test_type_map.find(type.id());
250925 if (entry == info.test_type_map.end()) {
250926 throw NotImplementedException("Unimplemented type for test_vector_types %s", type.ToString());
250927 }
250928 result.SetValue(0, entry->second.min_value);
250929 result.SetValue(1, entry->second.max_value);
250930 result.SetValue(2, Value(type));
250931 break;
250932 }
250933 }
250934 }
@ LIST
A list of some logical data type.
Definition duckdb.hpp:2813
@ STRUCT
Struct of logical types.
Definition duckdb.hpp:2816
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

◆ Generate()

void duckdb::TestVectorSequence::Generate ( TestVectorInfo & info)
inlinestatic
250936 {
250937 static constexpr const idx_t SEQ_CARDINALITY = 3;
250938
250939 auto result = make_uniq<DataChunk>();
250940 result->Initialize(Allocator::DefaultAllocator(), info.types,
250941 MaxValue<idx_t>(SEQ_CARDINALITY, STANDARD_VECTOR_SIZE));
250942
250943 for (idx_t c = 0; c < info.types.size(); c++) {
250944 if (info.types[c].id() == LogicalTypeId::MAP) {
250945 // FIXME: we don't support MAP in the TestVectorSequence
250946 return;
250947 }
250948 GenerateVector(info, info.types[c], result->data[c]);
250949 }
250950 result->SetCardinality(SEQ_CARDINALITY);
250951#if STANDARD_VECTOR_SIZE > 2
250952 info.entries.push_back(std::move(result));
250953#else
250954 // vsize = 2, split into two smaller data chunks
250955 for (idx_t offset = 0; offset < SEQ_CARDINALITY; offset += STANDARD_VECTOR_SIZE) {
250956 auto new_result = make_uniq<DataChunk>();
250957 new_result->Initialize(Allocator::DefaultAllocator(), info.types);
250958
250959 idx_t copy_count = MinValue<idx_t>(STANDARD_VECTOR_SIZE, SEQ_CARDINALITY - offset);
250960 result->Copy(*new_result, *FlatVector::IncrementalSelectionVector(), offset + copy_count, offset);
250961
250962 info.entries.push_back(std::move(new_result));
250963 }
250964#endif
250965 }
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237

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