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

Static Public Member Functions

static const ValidityMask & Validity (const Vector &vector)
static ValidityMask & Validity (Vector &vector)
static void SetValidity (Vector &vector, ValidityMask &new_validity)
static const_data_ptr_t GetCompressedData (const Vector &vector)
static data_ptr_t GetCompressedData (Vector &vector)
template<class T>
static const T * GetCompressedData (const Vector &vector)
template<class T>
static T * GetCompressedData (Vector &vector)
static void DecompressVector (const Vector &src, Vector &dst, idx_t src_offset, idx_t dst_offset, idx_t copy_count, const SelectionVector *sel)
 Decompresses an FSST_VECTOR into a FLAT_VECTOR. Note: validity is not copied.
static DUCKDB_API string_t AddCompressedString (Vector &vector, string_t data)
static DUCKDB_API string_t AddCompressedString (Vector &vector, const char *data, idx_t len)
static DUCKDB_API void RegisterDecoder (Vector &vector, buffer_ptr< void > &duckdb_fsst_decoder, const idx_t string_block_limit)
static DUCKDB_API void * GetDecoder (const Vector &vector)
static DUCKDB_API vector< unsigned char > & GetDecompressBuffer (const Vector &vector)
static DUCKDB_API void SetCount (Vector &vector, idx_t count)
 Setting the string count is required to be able to correctly flatten the vector.
static DUCKDB_API idx_t GetCount (Vector &vector)

Member Function Documentation

◆ Validity() [1/2]

const ValidityMask & duckdb::FSSTVector::Validity ( const Vector & vector)
inlinestatic
11039 {
11040 D_ASSERT(vector.GetVectorType() == VectorType::FSST_VECTOR);
11041 return vector.validity;
11042 }

◆ Validity() [2/2]

ValidityMask & duckdb::FSSTVector::Validity ( Vector & vector)
inlinestatic
11043 {
11044 D_ASSERT(vector.GetVectorType() == VectorType::FSST_VECTOR);
11045 return vector.validity;
11046 }

◆ SetValidity()

void duckdb::FSSTVector::SetValidity ( Vector & vector,
ValidityMask & new_validity )
inlinestatic
11047 {
11048 D_ASSERT(vector.GetVectorType() == VectorType::FSST_VECTOR);
11049 vector.validity.Initialize(new_validity);
11050 }

◆ GetCompressedData() [1/4]

const_data_ptr_t duckdb::FSSTVector::GetCompressedData ( const Vector & vector)
inlinestatic
11051 {
11052 D_ASSERT(vector.GetVectorType() == VectorType::FSST_VECTOR);
11053 return vector.data;
11054 }

◆ GetCompressedData() [2/4]

data_ptr_t duckdb::FSSTVector::GetCompressedData ( Vector & vector)
inlinestatic
11055 {
11056 D_ASSERT(vector.GetVectorType() == VectorType::FSST_VECTOR);
11057 return vector.data;
11058 }

◆ GetCompressedData() [3/4]

template<class T>
const T * duckdb::FSSTVector::GetCompressedData ( const Vector & vector)
inlinestatic
11060 {
11061 return (const T *)FSSTVector::GetCompressedData(vector);
11062 }

◆ GetCompressedData() [4/4]

template<class T>
T * duckdb::FSSTVector::GetCompressedData ( Vector & vector)
inlinestatic
11064 {
11065 return (T *)FSSTVector::GetCompressedData(vector);
11066 }

◆ DecompressVector()

void duckdb::FSSTVector::DecompressVector ( const Vector & src,
Vector & dst,
idx_t src_offset,
idx_t dst_offset,
idx_t copy_count,
const SelectionVector * sel )
static

Decompresses an FSST_VECTOR into a FLAT_VECTOR. Note: validity is not copied.

138055 {
138056 D_ASSERT(src.GetVectorType() == VectorType::FSST_VECTOR);
138057 D_ASSERT(dst.GetVectorType() == VectorType::FLAT_VECTOR);
138058 auto dst_mask = FlatVector::Validity(dst);
138059 auto ldata = FSSTVector::GetCompressedData<string_t>(src);
138060 auto tdata = FlatVector::GetData<string_t>(dst);
138061 auto &str_buffer = StringVector::GetStringBuffer(dst);
138062 for (idx_t i = 0; i < copy_count; i++) {
138063 auto source_idx = sel->get_index(src_offset + i);
138064 auto target_idx = dst_offset + i;
138065 string_t compressed_string = ldata[source_idx];
138066 if (dst_mask.RowIsValid(target_idx) && compressed_string.GetSize() > 0) {
138067 auto decoder = FSSTVector::GetDecoder(src);
138068 tdata[target_idx] = FSSTPrimitives::DecompressValue(decoder, str_buffer, compressed_string.GetData(),
138069 compressed_string.GetSize());
138070 } else {
138071 tdata[target_idx] = string_t(nullptr, 0);
138072 }
138073 }
138074}
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237
static DUCKDB_API VectorStringBuffer & GetStringBuffer(Vector &vector)
Returns a reference to the underlying VectorStringBuffer - throws an error if vector is not of type V...
Definition duckdb.cpp:137905
Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddCompressedString() [1/2]

string_t duckdb::FSSTVector::AddCompressedString ( Vector & vector,
string_t data )
static
137983 {
137984 D_ASSERT(vector.GetType().InternalType() == PhysicalType::VARCHAR);
137985 if (data.IsInlined()) {
137986 // string will be inlined: no need to store in string heap
137987 return data;
137988 }
137989 if (!vector.auxiliary) {
137990 vector.auxiliary = make_buffer<VectorFSSTStringBuffer>();
137991 }
137992 D_ASSERT(vector.auxiliary->GetBufferType() == VectorBufferType::FSST_BUFFER);
137993 auto &fsst_string_buffer = vector.auxiliary.get()->Cast<VectorFSSTStringBuffer>();
137994 return fsst_string_buffer.AddBlob(data);
137995}
@ VARCHAR
DuckDB Extensions.
Definition duckdb.hpp:2847

◆ AddCompressedString() [2/2]

string_t duckdb::FSSTVector::AddCompressedString ( Vector & vector,
const char * data,
idx_t len )
static
137979 {
137980 return FSSTVector::AddCompressedString(vector, string_t(data, UnsafeNumericCast<uint32_t>(len)));
137981}

◆ RegisterDecoder()

void duckdb::FSSTVector::RegisterDecoder ( Vector & vector,
buffer_ptr< void > & duckdb_fsst_decoder,
const idx_t string_block_limit )
static
138018 {
138019 D_ASSERT(vector.GetType().InternalType() == PhysicalType::VARCHAR);
138020
138021 if (!vector.auxiliary) {
138022 vector.auxiliary = make_buffer<VectorFSSTStringBuffer>();
138023 }
138024 D_ASSERT(vector.auxiliary->GetBufferType() == VectorBufferType::FSST_BUFFER);
138025
138026 auto &fsst_string_buffer = vector.auxiliary->Cast<VectorFSSTStringBuffer>();
138027 fsst_string_buffer.AddDecoder(duckdb_fsst_decoder, string_block_limit);
138028}

◆ GetDecoder()

void * duckdb::FSSTVector::GetDecoder ( const Vector & vector)
static
137997 {
137998 D_ASSERT(vector.GetType().InternalType() == PhysicalType::VARCHAR);
137999 if (!vector.auxiliary) {
138000 throw InternalException("GetDecoder called on FSST Vector without registered buffer");
138001 }
138002 D_ASSERT(vector.auxiliary->GetBufferType() == VectorBufferType::FSST_BUFFER);
138003 auto &fsst_string_buffer = vector.auxiliary->Cast<VectorFSSTStringBuffer>();
138004 return fsst_string_buffer.GetDecoder();
138005}

◆ GetDecompressBuffer()

vector< unsigned char > & duckdb::FSSTVector::GetDecompressBuffer ( const Vector & vector)
static
138007 {
138008 D_ASSERT(vector.GetType().InternalType() == PhysicalType::VARCHAR);
138009 if (!vector.auxiliary) {
138010 throw InternalException("GetDecompressBuffer called on FSST Vector without registered buffer");
138011 }
138012 D_ASSERT(vector.auxiliary->GetBufferType() == VectorBufferType::FSST_BUFFER);
138013 auto &fsst_string_buffer = vector.auxiliary->Cast<VectorFSSTStringBuffer>();
138014 return fsst_string_buffer.GetDecompressBuffer();
138015}

◆ SetCount()

void duckdb::FSSTVector::SetCount ( Vector & vector,
idx_t count )
static

Setting the string count is required to be able to correctly flatten the vector.

138030 {
138031 D_ASSERT(vector.GetType().InternalType() == PhysicalType::VARCHAR);
138032
138033 if (!vector.auxiliary) {
138034 vector.auxiliary = make_buffer<VectorFSSTStringBuffer>();
138035 }
138036 D_ASSERT(vector.auxiliary->GetBufferType() == VectorBufferType::FSST_BUFFER);
138037
138038 auto &fsst_string_buffer = vector.auxiliary->Cast<VectorFSSTStringBuffer>();
138039 fsst_string_buffer.SetCount(count);
138040}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetCount()

idx_t duckdb::FSSTVector::GetCount ( Vector & vector)
static
138042 {
138043 D_ASSERT(vector.GetType().InternalType() == PhysicalType::VARCHAR);
138044
138045 if (!vector.auxiliary) {
138046 vector.auxiliary = make_buffer<VectorFSSTStringBuffer>();
138047 }
138048 D_ASSERT(vector.auxiliary->GetBufferType() == VectorBufferType::FSST_BUFFER);
138049
138050 auto &fsst_string_buffer = vector.auxiliary->Cast<VectorFSSTStringBuffer>();
138051 return fsst_string_buffer.GetCount();
138052}

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