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

Static Public Member Functions

static bool HasEnoughSpace (idx_t current_count, idx_t index_count, idx_t dict_size, bitpacking_width_t packing_width, const idx_t block_size)
static idx_t RequiredSpace (idx_t current_count, idx_t index_count, idx_t dict_size, bitpacking_width_t packing_width)
static StringDictionaryContainer GetDictionary (ColumnSegment &segment, BufferHandle &handle)
static void SetDictionary (ColumnSegment &segment, BufferHandle &handle, StringDictionaryContainer container)

Static Public Attributes

static constexpr float MINIMUM_COMPRESSION_RATIO = 1.2F
static constexpr uint16_t DICTIONARY_HEADER_SIZE = sizeof(dictionary_compression_header_t)
 Dictionary header size at the beginning of the string segment (offset + length).

Member Function Documentation

◆ HasEnoughSpace()

bool duckdb::DictionaryCompression::HasEnoughSpace ( idx_t current_count,
idx_t index_count,
idx_t dict_size,
bitpacking_width_t packing_width,
const idx_t block_size )
static
399877 {
399878 return RequiredSpace(current_count, index_count, dict_size, packing_width) <= block_size;
399879}

◆ RequiredSpace()

idx_t duckdb::DictionaryCompression::RequiredSpace ( idx_t current_count,
idx_t index_count,
idx_t dict_size,
bitpacking_width_t packing_width )
static
399882 {
399883 idx_t base_space = DICTIONARY_HEADER_SIZE + dict_size;
399884 idx_t string_number_space = BitpackingPrimitives::GetRequiredSize(current_count, packing_width);
399885 idx_t index_space = index_count * sizeof(uint32_t);
399886
399887 idx_t used_space = base_space + index_space + string_number_space;
399888
399889 return used_space;
399890}
::uint32_t uint32_t
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237
static constexpr uint16_t DICTIONARY_HEADER_SIZE
Dictionary header size at the beginning of the string segment (offset + length).
Definition duckdb.cpp:399725

◆ GetDictionary()

StringDictionaryContainer duckdb::DictionaryCompression::GetDictionary ( ColumnSegment & segment,
BufferHandle & handle )
static
399892 {
399893 auto header_ptr = reinterpret_cast<dictionary_compression_header_t *>(handle.Ptr() + segment.GetBlockOffset());
399894 StringDictionaryContainer container;
399895 container.size = Load<uint32_t>(data_ptr_cast(&header_ptr->dict_size));
399896 container.end = Load<uint32_t>(data_ptr_cast(&header_ptr->dict_end));
399897 return container;
399898}

◆ SetDictionary()

void duckdb::DictionaryCompression::SetDictionary ( ColumnSegment & segment,
BufferHandle & handle,
StringDictionaryContainer container )
static
399901 {
399902 auto header_ptr = reinterpret_cast<dictionary_compression_header_t *>(handle.Ptr() + segment.GetBlockOffset());
399903 Store<uint32_t>(container.size, data_ptr_cast(&header_ptr->dict_size));
399904 Store<uint32_t>(container.end, data_ptr_cast(&header_ptr->dict_end));
399905}

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