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

The set of compression functions. More...

#include <duckdb.hpp>

Collaboration diagram for duckdb::CompressionFunctionSet:

Public Member Functions

vector< reference< const CompressionFunction > > GetCompressionFunctions (PhysicalType physical_type)
optional_ptr< const CompressionFunction > GetCompressionFunction (CompressionType type, PhysicalType physical_type)
void SetDisabledCompressionMethods (const vector< CompressionType > &methods)
vector< CompressionType > GetDisabledCompressionMethods () const

Static Public Attributes

static constexpr idx_t COMPRESSION_TYPE_COUNT = 16
static constexpr idx_t PHYSICAL_TYPE_COUNT = 19

Private Member Functions

void ResetDisabledMethods ()

Static Private Member Functions

static idx_t GetCompressionIndex (PhysicalType physical_type)
static idx_t GetCompressionIndex (CompressionType type)

Private Attributes

atomic< bool > is_disabled [COMPRESSION_TYPE_COUNT]
vector< vector< CompressionFunction > > functions

Detailed Description

The set of compression functions.

Constructor & Destructor Documentation

◆ CompressionFunctionSet()

duckdb::CompressionFunctionSet::CompressionFunctionSet ( )
220291 {
220292 ResetDisabledMethods();
220293 functions.resize(PHYSICAL_TYPE_COUNT);
220294
220295 static PhysicalType physical_types[PHYSICAL_TYPE_COUNT] = {
220299 PhysicalType::VARCHAR, PhysicalType::UINT128, PhysicalType::INT128, PhysicalType::BIT,
220300 };
220301 for (idx_t type_index = 0; type_index < PHYSICAL_TYPE_COUNT; type_index++) {
220302 const auto physical_type = physical_types[type_index];
220303 const auto index = GetCompressionIndex(physical_type);
220304 auto &function_list = functions[index];
220305
220306 for (idx_t method_index = 0; internal_compression_methods[method_index].get_function; method_index++) {
220307 auto &method = internal_compression_methods[method_index];
220308 if (!method.supports_type(physical_type)) {
220309 // Not supported for this type.
220310 continue;
220311 }
220312 // The type is supported.
220313 // We create the function and insert it into the set of available functions.
220314 function_list.push_back(method.get_function(physical_type));
220315 }
220316 }
220317}
index
PhysicalType
Definition duckdb.hpp:2738
@ UINT32
Unsigned 32-bit little-endian integer.
Definition duckdb.hpp:2758
@ INTERVAL
YEAR_MONTH or DAY_TIME interval in SQL style.
Definition duckdb.hpp:2806
@ LIST
A list of some logical data type.
Definition duckdb.hpp:2813
@ UINT16
Unsigned 16-bit little-endian integer.
Definition duckdb.hpp:2752
@ INT64
Signed 64-bit little-endian integer.
Definition duckdb.hpp:2767
@ INT16
Signed 16-bit little-endian integer.
Definition duckdb.hpp:2755
@ INT32
Signed 32-bit little-endian integer.
Definition duckdb.hpp:2761
@ UINT64
Unsigned 64-bit little-endian integer.
Definition duckdb.hpp:2764
@ BOOL
Boolean as 8 bit "bool" value.
Definition duckdb.hpp:2743
@ STRUCT
Struct of logical types.
Definition duckdb.hpp:2816
@ BIT
Boolean as 1 bit, LSB bit-packed ordering.
Definition duckdb.hpp:2852
@ VARCHAR
DuckDB Extensions.
Definition duckdb.hpp:2847
@ FLOAT
4-byte floating point value
Definition duckdb.hpp:2773
@ UINT8
Unsigned 8-bit little-endian integer.
Definition duckdb.hpp:2746
@ INT8
Signed 8-bit little-endian integer.
Definition duckdb.hpp:2749
@ DOUBLE
8-byte floating point value
Definition duckdb.hpp:2776
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237

Member Function Documentation

◆ GetCompressionFunctions()

vector< reference< const CompressionFunction > > duckdb::CompressionFunctionSet::GetCompressionFunctions ( PhysicalType physical_type)
220340 {
220341 const auto index = GetCompressionIndex(physical_type);
220342 auto &function_list = functions[index];
220343 vector<reference<const CompressionFunction>> result;
220344 for (auto &entry : function_list) {
220345 const auto compression_index = GetCompressionIndex(entry.type);
220346 if (is_disabled[compression_index]) {
220347 continue;
220348 }
220349 if (!EmitCompressionFunction(entry.type)) {
220350 continue;
220351 }
220352 result.push_back(entry);
220353 }
220354 return result;
220355}

◆ GetCompressionFunction()

optional_ptr< const CompressionFunction > duckdb::CompressionFunctionSet::GetCompressionFunction ( CompressionType type,
PhysicalType physical_type )
220358 {
220359 const auto index = GetCompressionIndex(physical_type);
220360 const auto &function_list = functions[index];
220361 for (auto &function : function_list) {
220362 if (function.type == type) {
220363 return &function;
220364 }
220365 }
220366 return nullptr;
220367}

◆ SetDisabledCompressionMethods()

void duckdb::CompressionFunctionSet::SetDisabledCompressionMethods ( const vector< CompressionType > & methods)
220369 {
220370 ResetDisabledMethods();
220371 for (auto &method : methods) {
220372 const auto idx = GetCompressionIndex(method);
220373 is_disabled[idx] = true;
220374 }
220375}

◆ GetDisabledCompressionMethods()

vector< CompressionType > duckdb::CompressionFunctionSet::GetDisabledCompressionMethods ( ) const
220381 {
220382 vector<CompressionType> result;
220383 for (idx_t i = 0; i < COMPRESSION_TYPE_COUNT; i++) {
220384 if (is_disabled[i]) {
220385 result.push_back(static_cast<CompressionType>(i));
220386 }
220387 }
220388 return result;
220389}

◆ GetCompressionIndex() [1/2]

idx_t duckdb::CompressionFunctionSet::GetCompressionIndex ( PhysicalType physical_type)
staticprivate
220242 {
220243 switch (physical_type) {
220244 case PhysicalType::BOOL:
220245 return 0;
220246 case PhysicalType::UINT8:
220247 return 1;
220248 case PhysicalType::INT8:
220249 return 2;
220251 return 3;
220252 case PhysicalType::INT16:
220253 return 4;
220255 return 5;
220256 case PhysicalType::INT32:
220257 return 6;
220259 return 7;
220260 case PhysicalType::INT64:
220261 return 8;
220262 case PhysicalType::FLOAT:
220263 return 9;
220265 return 10;
220267 return 11;
220268 case PhysicalType::LIST:
220269 return 12;
220271 return 13;
220272 case PhysicalType::ARRAY:
220273 return 14;
220275 return 15;
220276 case PhysicalType::UINT128:
220277 return 16;
220278 case PhysicalType::INT128:
220279 return 17;
220280 case PhysicalType::BIT:
220281 return 18;
220282 default:
220283 throw InternalException("Unsupported physical type for compression index");
220284 }
220285}

◆ GetCompressionIndex() [2/2]

idx_t duckdb::CompressionFunctionSet::GetCompressionIndex ( CompressionType type)
staticprivate
220287 {
220288 return static_cast<idx_t>(type);
220289}

◆ ResetDisabledMethods()

void duckdb::CompressionFunctionSet::ResetDisabledMethods ( )
private
220395 {
220396 for (idx_t i = 0; i < COMPRESSION_TYPE_COUNT; i++) {
220397 is_disabled[i] = false;
220398 }
220399}

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