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::ColumnDataCollection Class Reference

#include <duckdb.hpp>

Collaboration diagram for duckdb::ColumnDataCollection:

Public Member Functions

DUCKDB_API ColumnDataCollection (Allocator &allocator, vector< LogicalType > types)
 Constructs an in-memory column data collection from an allocator.
 
DUCKDB_API ColumnDataCollection (Allocator &allocator)
 Constructs an empty (but valid) in-memory column data collection from an allocator.
 
DUCKDB_API ColumnDataCollection (BufferManager &buffer_manager, vector< LogicalType > types, ColumnDataCollectionLifetime lifetime=ColumnDataCollectionLifetime::REGULAR)
 Constructs a buffer-managed column data collection.
 
DUCKDB_API ColumnDataCollection (ClientContext &context, vector< LogicalType > types, ColumnDataAllocatorType type=ColumnDataAllocatorType::BUFFER_MANAGER_ALLOCATOR, ColumnDataCollectionLifetime lifetime=ColumnDataCollectionLifetime::REGULAR)
 Constructs either an in-memory or a buffer-managed column data collection.
 
DUCKDB_API ColumnDataCollection (ColumnDataCollection &parent)
 
DUCKDB_API ColumnDataCollection (shared_ptr< ColumnDataAllocator > allocator, vector< LogicalType > types)
 
vector< LogicalType > & Types ()
 The types of columns in the ColumnDataCollection.
 
const vector< LogicalType > & Types () const
 
const idx_tCount () const
 The amount of rows in the ColumnDataCollection.
 
idx_t ColumnCount () const
 The amount of columns in the ColumnDataCollection.
 
idx_t SizeInBytes () const
 The size (in bytes) of this ColumnDataCollection.
 
idx_t AllocationSize () const
 The allocation size (in bytes) of this ColumnDataCollection - this property is cached.
 
void SetPartitionIndex (idx_t index)
 Sets the partition index of this ColumnDataCollection.
 
DUCKDB_API AllocatorGetAllocator () const
 Get the allocator.
 
DUCKDB_API void InitializeAppend (ColumnDataAppendState &state)
 Initializes an Append state - useful for optimizing many appends made to the same column data collection.
 
DUCKDB_API void Append (ColumnDataAppendState &state, DataChunk &new_chunk)
 Append a DataChunk to this ColumnDataCollection using the specified append state.
 
DUCKDB_API void InitializeScanChunk (DataChunk &chunk) const
 Initializes a chunk with the correct types that can be used to call Scan.
 
DUCKDB_API void InitializeScanChunk (Allocator &allocator, DataChunk &chunk) const
 
DUCKDB_API void InitializeScanChunk (ColumnDataScanState &state, DataChunk &chunk) const
 Initializes a chunk with the correct types for a given scan state.
 
DUCKDB_API void InitializeScan (ColumnDataScanState &state, ColumnDataScanProperties properties=ColumnDataScanProperties::ALLOW_ZERO_COPY) const
 Initializes a Scan state for scanning all columns.
 
DUCKDB_API void InitializeScan (ColumnDataScanState &state, vector< column_t > column_ids, ColumnDataScanProperties properties=ColumnDataScanProperties::ALLOW_ZERO_COPY) const
 Initializes a Scan state for scanning a subset of the columns.
 
DUCKDB_API void InitializeScan (ColumnDataParallelScanState &state, ColumnDataScanProperties properties=ColumnDataScanProperties::ALLOW_ZERO_COPY) const
 Initialize a parallel scan over the column data collection over all columns.
 
DUCKDB_API void InitializeScan (ColumnDataParallelScanState &state, vector< column_t > column_ids, ColumnDataScanProperties properties=ColumnDataScanProperties::ALLOW_ZERO_COPY) const
 Initialize a parallel scan over the column data collection over a subset of the columns.
 
DUCKDB_API bool Scan (ColumnDataScanState &state, DataChunk &result) const
 Scans a DataChunk from the ColumnDataCollection.
 
DUCKDB_API bool Scan (ColumnDataParallelScanState &state, ColumnDataLocalScanState &lstate, DataChunk &result) const
 Scans a DataChunk from the ColumnDataCollection.
 
DUCKDB_API void Append (DataChunk &new_chunk)
 Append a DataChunk directly to this ColumnDataCollection - calls InitializeAppend and Append internally.
 
DUCKDB_API void Combine (ColumnDataCollection &other)
 Appends the other ColumnDataCollection to this, destroying the other data collection.
 
DUCKDB_API void Verify ()
 
DUCKDB_API string ToString () const
 
DUCKDB_API void Print () const
 
DUCKDB_API void Reset ()
 
DUCKDB_API idx_t ChunkCount () const
 Returns the number of data chunks present in the ColumnDataCollection.
 
DUCKDB_API void FetchChunk (idx_t chunk_idx, DataChunk &result) const
 Fetch an individual chunk from the ColumnDataCollection.
 
DUCKDB_API ColumnDataChunkIterationHelper Chunks () const
 
DUCKDB_API ColumnDataChunkIterationHelper Chunks (vector< column_t > column_ids) const
 
DUCKDB_API ColumnDataRowIterationHelper Rows () const
 
DUCKDB_API ColumnDataRowCollection GetRows () const
 
bool NextScanIndex (ColumnDataScanState &state, idx_t &chunk_index, idx_t &segment_index, idx_t &row_index) const
 Obtains the next scan index to scan from.
 
bool PrevScanIndex (ColumnDataScanState &state, idx_t &chunk_index, idx_t &segment_index, idx_t &row_index) const
 Obtains the previous scan index to scan from.
 
void ScanAtIndex (ColumnDataParallelScanState &state, ColumnDataLocalScanState &lstate, DataChunk &result, idx_t chunk_index, idx_t segment_index, idx_t row_index) const
 Scans at the indices (obtained from NextScanIndex)
 
bool Seek (idx_t row_idx, ColumnDataScanState &state, DataChunk &result) const
 
void Initialize (vector< LogicalType > types)
 Initialize the column data collection.
 
vector< shared_ptr< StringHeap > > GetHeapReferences ()
 Get references to the string heaps in this ColumnDataCollection.
 
ColumnDataAllocatorType GetAllocatorType () const
 Get the allocator type of this ColumnDataCollection.
 
BufferManagerGetBufferManager () const
 Get the buffer manager of the allocator.
 
const vector< unique_ptr< ColumnDataCollectionSegment > > & GetSegments () const
 Get a vector of the segments in this ColumnDataCollection.
 
void Serialize (Serializer &serializer) const
 

Static Public Member Functions

static bool ResultEquals (const ColumnDataCollection &left, const ColumnDataCollection &right, string &error_message, bool ordered=false)
 
static unique_ptr< ColumnDataCollectionDeserialize (Deserializer &deserializer)
 

Private Member Functions

void CreateSegment ()
 Creates a new segment within the ColumnDataCollection.
 

Static Private Member Functions

static ColumnDataCopyFunction GetCopyFunction (const LogicalType &type)
 

Private Attributes

buffer_ptr< ColumnDataAllocatorallocator
 The Column Data Allocator.
 
vector< LogicalTypetypes
 The types of the stored entries.
 
idx_t count
 The number of entries stored in the column data collection.
 
vector< unique_ptr< ColumnDataCollectionSegment > > segments
 The data segments of the column data collection.
 
vector< ColumnDataCopyFunctioncopy_functions
 The set of copy functions.
 
bool finished_append
 When the column data collection is marked as finished - new tuples can no longer be appended to it.
 
optional_idx partition_index
 Partition index (optional, if partitioned)
 

Detailed Description

The ColumnDataCollection represents a set of (buffer-managed) data stored in columnar format It is efficient to read and scan

Constructor & Destructor Documentation

◆ ColumnDataCollection()

DUCKDB_API duckdb::ColumnDataCollection::ColumnDataCollection ( ColumnDataCollection parent)

Creates a column data collection that inherits the blocks to write to. This allows blocks to be shared between multiple column data collections and prevents wasting space. Note that after one CDC inherits blocks from another, the other cannot be written to anymore (i.e. we take ownership of the half-written blocks).

Member Function Documentation

◆ Types() [1/2]

vector< LogicalType > & duckdb::ColumnDataCollection::Types ( )
inline

The types of columns in the ColumnDataCollection.

18993 {
18994 return types;
18995 }
vector< LogicalType > types
The types of the stored entries.
Definition duckdb.hpp:19130

◆ Types() [2/2]

const vector< LogicalType > & duckdb::ColumnDataCollection::Types ( ) const
inline
18996 {
18997 return types;
18998 }

◆ Count()

const idx_t & duckdb::ColumnDataCollection::Count ( ) const
inline

The amount of rows in the ColumnDataCollection.

19001 {
19002 return count;
19003 }
idx_t count
The number of entries stored in the column data collection.
Definition duckdb.hpp:19132

◆ ColumnCount()

idx_t duckdb::ColumnDataCollection::ColumnCount ( ) const
inline

The amount of columns in the ColumnDataCollection.

19006 {
19007 return types.size();
19008 }

◆ Chunks() [1/2]

DUCKDB_API ColumnDataChunkIterationHelper duckdb::ColumnDataCollection::Chunks ( ) const

Constructs a class that can be iterated over to fetch individual chunks Iterating over this is syntactic sugar over just calling Scan

◆ Chunks() [2/2]

DUCKDB_API ColumnDataChunkIterationHelper duckdb::ColumnDataCollection::Chunks ( vector< column_t column_ids) const

Constructs a class that can be iterated over to fetch individual chunks Only the column indexes specified in the column_ids list are scanned

◆ Rows()

DUCKDB_API ColumnDataRowIterationHelper duckdb::ColumnDataCollection::Rows ( ) const

Constructs a class that can be iterated over to fetch individual rows Note that row iteration is slow, and the .Chunks() method should be used instead

◆ GetRows()

DUCKDB_API ColumnDataRowCollection duckdb::ColumnDataCollection::GetRows ( ) const

Returns a materialized set of all of the rows in the column data collection Note that usage of this is slow - avoid using this unless the amount of rows is small, or if you do not care about performance

◆ ResultEquals()

static bool duckdb::ColumnDataCollection::ResultEquals ( const ColumnDataCollection left,
const ColumnDataCollection right,
string &  error_message,
bool  ordered = false 
)
static

Compare two column data collections to another. If they are equal according to result equality rules, return true. That means null values are equal, and approx equality is used for floating point values. If they are not equal, return false and fill in the error message.

◆ Seek()

bool duckdb::ColumnDataCollection::Seek ( idx_t  row_idx,
ColumnDataScanState state,
DataChunk result 
) const

Seeks to the chunk containing the row. Returns false if it is past the end. Note that the returned chunk will likely not be aligned to the given row but the scan state will provide the actual range


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