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

TableFilter represents a filter pushed down into the table scan. More...

Inheritance diagram for duckdb::ColumnSegment:
Collaboration diagram for duckdb::ColumnSegment:

Public Member Functions

 ColumnSegment (DatabaseInstance &db, shared_ptr< BlockHandle > block, const LogicalType &type, const ColumnSegmentType segment_type, const idx_t count, const CompressionFunction &function_p, BaseStatistics statistics, const block_id_t block_id_p, const idx_t offset, const idx_t segment_size_p, unique_ptr< ColumnSegmentState > segment_state_p=nullptr)
 Construct a column segment.
 
 ColumnSegment (ColumnSegment &other)
 
void InitializePrefetch (PrefetchState &prefetch_state, ColumnScanState &scan_state)
 
void InitializeScan (ColumnScanState &state)
 
void Scan (ColumnScanState &state, idx_t scan_count, Vector &result, idx_t result_offset, ScanVectorType scan_type)
 Scan one vector from this segment.
 
void Select (ColumnScanState &state, idx_t scan_count, Vector &result, const SelectionVector &sel, idx_t sel_count)
 Scan a subset of a vector (defined by the selection vector)
 
void Filter (ColumnScanState &state, idx_t scan_count, Vector &result, SelectionVector &sel, idx_t &sel_count, const TableFilter &filter, TableFilterState &filter_state)
 Scan one vector while applying a filter to the vector, returning only the matching elements.
 
void FetchRow (ColumnFetchState &state, row_t row_id, Vector &result, idx_t result_idx)
 Fetch a value of the specific row id and append it to the result.
 
void Skip (ColumnScanState &state)
 Skip a scan forward to the row_index specified in the scan state.
 
idx_t SegmentSize () const
 
void Resize (idx_t segment_size)
 Resize the block.
 
const CompressionFunctionGetCompressionFunction ()
 
void InitializeAppend (ColumnAppendState &state)
 Initialize an append of this segment. Appends are only supported on transient segments.
 
idx_t Append (ColumnAppendState &state, UnifiedVectorFormat &data, idx_t offset, idx_t count)
 Appends a (part of) vector to the segment, returns the amount of entries successfully appended.
 
idx_t FinalizeAppend (ColumnAppendState &state)
 
void RevertAppend (idx_t new_count)
 Revert an append made to this segment.
 
void ConvertToPersistent (QueryContext context, optional_ptr< BlockManager > block_manager, const block_id_t block_id)
 
void MarkAsPersistent (shared_ptr< BlockHandle > block, uint32_t offset_in_block)
 
void SetBlock (shared_ptr< BlockHandle > block, uint32_t offset)
 
DataPointer GetDataPointer (idx_t row_start)
 Gets a data pointer from a persistent column segment.
 
block_id_t GetBlockId ()
 
idx_t GetBlockSize () const
 Returns the size of the underlying block of the segment. It is size is the size available for usage on a block.
 
idx_t GetBlockOffset ()
 
optional_ptr< CompressedSegmentStateGetSegmentState () const
 
void VisitBlockIds (BlockIdVisitor &visitor) const
 
- Public Member Functions inherited from duckdb::SegmentBase< ColumnSegment >
 SegmentBase (idx_t count)
 

Static Public Member Functions

static unique_ptr< ColumnSegmentCreatePersistentSegment (DatabaseInstance &db, BlockManager &block_manager, block_id_t id, idx_t offset, const LogicalType &type_p, idx_t count, CompressionType compression_type, BaseStatistics statistics, unique_ptr< ColumnSegmentState > segment_state)
 
static unique_ptr< ColumnSegmentCreateTransientSegment (DatabaseInstance &db, const CompressionFunction &function, const LogicalType &type, const idx_t segment_size, BlockManager &block_manager)
 
static idx_t FilterSelection (SelectionVector &sel, Vector &vector, UnifiedVectorFormat &vdata, const TableFilter &filter, TableFilterState &filter_state, idx_t scan_count, idx_t &approved_tuple_count)
 

Public Attributes

DatabaseInstancedb
 The database instance.
 
LogicalType type
 The type stored in the column.
 
idx_t type_size
 The size of the type.
 
ColumnSegmentType segment_type
 The column segment type (transient or persistent)
 
SegmentStatistics stats
 The statistics for the segment.
 
shared_ptr< BlockHandleblock
 The block that this segment relates to.
 
- Public Attributes inherited from duckdb::SegmentBase< ColumnSegment >
atomic< idx_tcount
 The amount of entries in this storage chunk.
 

Private Member Functions

void Scan (ColumnScanState &state, idx_t scan_count, Vector &result)
 
void ScanPartial (ColumnScanState &state, idx_t scan_count, Vector &result, idx_t result_offset)
 

Private Attributes

reference< const CompressionFunctionfunction
 The compression function.
 
block_id_t block_id
 The block id that this segment relates to (persistent segment only)
 
idx_t offset
 The offset into the block (persistent segment only)
 
idx_t segment_size
 The allocated segment size, which is bounded by Storage::BLOCK_SIZE.
 
unique_ptr< CompressedSegmentStatesegment_state
 Storage associated with the compressed segment.
 

Detailed Description

TableFilter represents a filter pushed down into the table scan.

Constructor & Destructor Documentation

◆ ColumnSegment()

duckdb::ColumnSegment::ColumnSegment ( ColumnSegment other)

Construct a column segment from another column segment. The other column segment becomes invalid (std::move).

Member Function Documentation

◆ FinalizeAppend()

idx_t duckdb::ColumnSegment::FinalizeAppend ( ColumnAppendState state)

Finalize the segment for appending - no more appends can follow on this segment The segment should be compacted as much as possible Returns the number of bytes occupied within the segment

◆ ConvertToPersistent()

void duckdb::ColumnSegment::ConvertToPersistent ( QueryContext  context,
optional_ptr< BlockManager block_manager,
const block_id_t  block_id 
)

Convert a transient in-memory segment to a persistent segment backed by an on-disk block. Only used during checkpointing.

◆ MarkAsPersistent()

void duckdb::ColumnSegment::MarkAsPersistent ( shared_ptr< BlockHandle block,
uint32_t  offset_in_block 
)

Updates pointers to refer to the given block and offset. This is only used when sharing a block among segments. This is invoked only AFTER the block is written.

◆ GetBlockId()

block_id_t duckdb::ColumnSegment::GetBlockId ( )
inline
49062 {
49063 D_ASSERT(segment_type == ColumnSegmentType::PERSISTENT);
49064 return block_id;
49065 }
block_id_t block_id
The block id that this segment relates to (persistent segment only)
Definition duckdb.hpp:49105
ColumnSegmentType segment_type
The column segment type (transient or persistent)
Definition duckdb.hpp:49095

◆ GetBlockSize()

idx_t duckdb::ColumnSegment::GetBlockSize ( ) const
inline

Returns the size of the underlying block of the segment. It is size is the size available for usage on a block.

49068 {
49069 return block->GetBlockSize();
49070 }
shared_ptr< BlockHandle > block
The block that this segment relates to.
Definition duckdb.hpp:49099

◆ GetBlockOffset()

idx_t duckdb::ColumnSegment::GetBlockOffset ( )
inline
49072 {
49073 D_ASSERT(segment_type == ColumnSegmentType::PERSISTENT || offset == 0);
49074 return offset;
49075 }
idx_t offset
The offset into the block (persistent segment only)
Definition duckdb.hpp:49107

◆ GetSegmentState()

optional_ptr< CompressedSegmentState > duckdb::ColumnSegment::GetSegmentState ( ) const
inline
49077 {
49078 return segment_state.get();
49079 }
unique_ptr< CompressedSegmentState > segment_state
Storage associated with the compressed segment.
Definition duckdb.hpp:49111

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