![]() |
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.
|
Struct column data represents a struct. More...


Public Member Functions | |
| VariantColumnData (BlockManager &block_manager, DataTableInfo &info, idx_t column_index, LogicalType type, ColumnDataType data_type, optional_ptr< ColumnData > parent) | |
| idx_t | GetMaxEntry () override |
| bool | IsShredded () const |
| void | InitializePrefetch (PrefetchState &prefetch_state, ColumnScanState &scan_state, idx_t rows) override |
| Initialize prefetch state with required I/O data for the next N rows. | |
| void | InitializeScan (ColumnScanState &state) override |
| Initialize a scan of the column. | |
| void | InitializeScanWithOffset (ColumnScanState &state, idx_t row_idx) override |
| Initialize a scan starting at the specified offset. | |
| idx_t | Scan (TransactionData transaction, idx_t vector_index, ColumnScanState &state, Vector &result, idx_t scan_count) override |
| idx_t | ScanCount (ColumnScanState &state, Vector &result, idx_t count, idx_t result_offset=0) override |
| void | Skip (ColumnScanState &state, idx_t count=STANDARD_VECTOR_SIZE) override |
| Skip the scan forward by "count" rows. | |
| void | InitializeAppend (ColumnAppendState &state) override |
| Initialize an appending phase for this column. | |
| void | Append (BaseStatistics &stats, ColumnAppendState &state, Vector &vector, idx_t count) override |
| Append a vector of type [type] to the end of the column. | |
| void | RevertAppend (row_t new_count) override |
| Revert a set of appends to the ColumnData. | |
| idx_t | Fetch (ColumnScanState &state, row_t row_id, Vector &result) override |
| Fetch the vector from the column data that belongs to this specific row. | |
| void | FetchRow (TransactionData transaction, ColumnFetchState &state, const StorageIndex &storage_index, row_t row_id, Vector &result, idx_t result_idx) override |
| Fetch a specific row id and append it to the vector. | |
| void | Update (TransactionData transaction, DataTable &data_table, idx_t column_index, Vector &update_vector, row_t *row_ids, idx_t update_count, idx_t row_group_start) override |
| void | UpdateColumn (TransactionData transaction, DataTable &data_table, const vector< column_t > &column_path, Vector &update_vector, row_t *row_ids, idx_t update_count, idx_t depth, idx_t row_group_start) override |
| unique_ptr< BaseStatistics > | GetUpdateStatistics () override |
| void | VisitBlockIds (BlockIdVisitor &visitor) const override |
| unique_ptr< ColumnCheckpointState > | CreateCheckpointState (const RowGroup &row_group, PartialBlockManager &partial_block_manager) override |
| unique_ptr< ColumnCheckpointState > | Checkpoint (const RowGroup &row_group, ColumnCheckpointInfo &info, const BaseStatistics &old_stats) override |
| bool | IsPersistent () override |
| bool | HasAnyChanges () const override |
| Whether or not the column has ANY changes, including in child columns. | |
| PersistentColumnData | Serialize () override |
| void | InitializeColumn (PersistentColumnData &column_data, BaseStatistics &target_stats) override |
| void | GetColumnSegmentInfo (const QueryContext &context, duckdb::idx_t row_group_index, vector< duckdb::idx_t > col_path, vector< duckdb::ColumnSegmentInfo > &result) override |
| void | Verify (RowGroup &parent) override |
| void | SetValidityData (shared_ptr< ValidityColumnData > validity_p) |
| void | SetChildData (vector< shared_ptr< ColumnData > > child_data) |
| Public Member Functions inherited from duckdb::ColumnData | |
| ColumnData (BlockManager &block_manager, DataTableInfo &info, idx_t column_index, LogicalType type, ColumnDataType data_type, optional_ptr< ColumnData > parent) | |
| virtual FilterPropagateResult | CheckZonemap (ColumnScanState &state, TableFilter &filter) |
| BlockManager & | GetBlockManager () const |
| DatabaseInstance & | GetDatabase () const |
| DataTableInfo & | GetTableInfo () const |
| StorageManager & | GetStorageManager () const |
| idx_t | GetAllocationSize () const |
| optional_ptr< const CompressionFunction > | GetCompressionFunction () const |
| virtual void | SetDataType (ColumnDataType data_type) |
| ColumnDataType | GetDataType () const |
| bool | HasParent () const |
| void | SetParent (optional_ptr< ColumnData > parent) |
| const ColumnData & | Parent () const |
| virtual const BaseStatistics & | GetChildStats (const ColumnData &child) const |
| const LogicalType & | GetType () const |
| ColumnSegmentTree & | GetSegmentTree () |
| void | SetCount (idx_t new_count) |
| bool | HasUpdates () const |
| Whether or not the column has any updates. | |
| bool | HasChanges (idx_t start_row, idx_t end_row) const |
| bool | HasChanges () const |
| Whether or not the column has changes at this level. | |
| virtual ScanVectorType | GetVectorScanType (ColumnScanState &state, idx_t scan_count, Vector &result) |
| Whether or not we can scan an entire vector. | |
| idx_t | Scan (TransactionData transaction, idx_t vector_index, ColumnScanState &state, Vector &result) |
| Scan the next vector from the column. | |
| virtual void | ScanCommittedRange (idx_t row_group_start, idx_t offset_in_row_group, idx_t count, Vector &result) |
| virtual void | Filter (TransactionData transaction, idx_t vector_index, ColumnScanState &state, Vector &result, SelectionVector &sel, idx_t &count, const TableFilter &filter, TableFilterState &filter_state) |
| Select. | |
| virtual void | Select (TransactionData transaction, idx_t vector_index, ColumnScanState &state, Vector &result, SelectionVector &sel, idx_t count) |
| void | Append (ColumnAppendState &state, Vector &vector, idx_t count) |
| Append a vector of type [type] to the end of the column. | |
| virtual void | AppendData (BaseStatistics &stats, ColumnAppendState &state, UnifiedVectorFormat &vdata, idx_t count) |
| unique_ptr< ColumnCheckpointState > | Checkpoint (const RowGroup &row_group, ColumnCheckpointInfo &info) |
| If this is a nested column, "stats" are the corresponding statistics from the parent column Otherwise, "stats" == this->statistics->stats. | |
| virtual void | CheckpointScan (ColumnSegment &segment, ColumnScanState &state, idx_t count, Vector &scan_vector) const |
| vector< DataPointer > | GetDataPointers () |
| void | InitializeColumn (PersistentColumnData &column_data) |
| FilterPropagateResult | CheckZonemap (const StorageIndex &index, TableFilter &filter) |
| void | MergeStatistics (const BaseStatistics &other) |
| void | MergeIntoStatistics (BaseStatistics &other) |
| unique_ptr< BaseStatistics > | GetStatistics () const |
| const BaseStatistics & | GetStatisticsRef () const |
| template<class TARGET> | |
| TARGET & | Cast () |
| template<class TARGET> | |
| const TARGET & | Cast () const |
| Public Member Functions inherited from duckdb::enable_shared_from_this< ColumnData > | |
| shared_ptr< ColumnData > | shared_from_this () |
Static Public Member Functions | |
| static void | ShredVariantData (Vector &input, Vector &output, idx_t count) |
| static void | UnshredVariantData (Vector &input, Vector &output, idx_t count) |
| Static Public Member Functions inherited from duckdb::ColumnData | |
| static shared_ptr< ColumnData > | Deserialize (BlockManager &block_manager, DataTableInfo &info, idx_t column_index, ReadStream &source, const LogicalType &type) |
| static shared_ptr< ColumnData > | CreateColumn (BlockManager &block_manager, DataTableInfo &info, idx_t column_index, const LogicalType &type, ColumnDataType data_type=ColumnDataType::MAIN_TABLE, optional_ptr< ColumnData > parent=nullptr) |
Public Attributes | |
| vector< shared_ptr< ColumnData > > | sub_columns |
| The sub-columns of the struct. | |
| shared_ptr< ValidityColumnData > | validity |
| Public Attributes inherited from duckdb::ColumnData | |
| atomic< idx_t > | count |
| The count of the column data. | |
| BlockManager & | block_manager |
| The block manager. | |
| DataTableInfo & | info |
| Table info for the column. | |
| idx_t | column_index |
| The column index of the column, either within the parent table or within the parent. | |
| LogicalType | type |
| The type of the column. | |
Static Public Attributes | |
| static constexpr idx_t | TYPED_VALUE_INDEX = 0 |
| Indices into the inner shredded struct: STRUCT(typed_value <type>, untyped_value_index UINTEGER). | |
| static constexpr idx_t | UNTYPED_VALUE_INDEX = 1 |
Private Member Functions | |
| Vector | CreateUnshreddingIntermediate (idx_t count) const |
| vector< shared_ptr< ColumnData > > | WriteShreddedData (const RowGroup &row_group, const LogicalType &shredded_type, BaseStatistics &stats) |
| bool | PushdownShreddedFieldExtract (const StorageIndex &variant_extract, StorageIndex &out_struct_extract) const |
| void | CreateScanStates (ColumnScanState &state) |
| idx_t | ScanWithCallback (ColumnScanState &state, Vector &result, idx_t target_count, const std::function< idx_t(ColumnData &column, ColumnScanState &child_state, Vector &target_vector, idx_t count)> &callback) const |
| LogicalType | GetShreddedType () |
Additional Inherited Members | |
| Protected Member Functions inherited from duckdb::ColumnData | |
| void | AppendTransientSegment (SegmentLock &l, idx_t start_row) |
| Append a transient segment. | |
| void | AppendSegment (SegmentLock &l, unique_ptr< ColumnSegment > segment) |
| void | BeginScanVectorInternal (ColumnScanState &state) |
| idx_t | ScanVector (ColumnScanState &state, Vector &result, idx_t remaining, ScanVectorType scan_type, idx_t result_offset=0) |
| Scans a base vector from the column. | |
| idx_t | ScanVector (TransactionData transaction, idx_t vector_index, ColumnScanState &state, Vector &result, idx_t target_scan, ScanVectorType scan_type, UpdateScanType update_type) |
| Scans a vector from the column merged with any potential updates. | |
| idx_t | ScanVector (TransactionData transaction, idx_t vector_index, ColumnScanState &state, Vector &result, idx_t target_scan, UpdateScanType update_type) |
| void | SelectVector (ColumnScanState &state, Vector &result, idx_t target_count, const SelectionVector &sel, idx_t sel_count) |
| void | FilterVector (ColumnScanState &state, Vector &result, idx_t target_count, SelectionVector &sel, idx_t &sel_count, const TableFilter &filter, TableFilterState &filter_state) |
| void | FetchUpdates (TransactionData transaction, idx_t vector_index, Vector &result, idx_t scan_count, UpdateScanType update_type) |
| void | FetchUpdateRow (TransactionData transaction, row_t row_id, Vector &result, idx_t result_idx) |
| void | UpdateInternal (TransactionData transaction, DataTable &data_table, idx_t column_index, Vector &update_vector, row_t *row_ids, idx_t update_count, Vector &base_vector, idx_t row_group_start) |
| idx_t | FetchUpdateData (ColumnScanState &state, row_t *row_ids, Vector &base_vector, idx_t row_group_start) |
| idx_t | GetVectorCount (idx_t vector_index) const |
| Protected Member Functions inherited from duckdb::enable_shared_from_this< ColumnData > | |
| enable_shared_from_this & | operator= (enable_shared_from_this const &) noexcept |
| Protected Attributes inherited from duckdb::ColumnData | |
| ColumnSegmentTree | data |
| The segments holding the data of this column segment. | |
| mutex | update_lock |
| The lock for the updates. | |
| unique_ptr< UpdateSegment > | updates |
| The updates for this column segment. | |
| mutex | stats_lock |
| The lock for the stats. | |
| atomic< idx_t > | allocation_size |
| Total transient allocation size. | |
| unique_ptr< SegmentStatistics > | stats |
| The stats of the root segment. | |
Struct column data represents a struct.
| duckdb::VariantColumnData::VariantColumnData | ( | BlockManager & | block_manager, |
| DataTableInfo & | info, | ||
| idx_t | column_index, | ||
| LogicalType | type, | ||
| ColumnDataType | data_type, | ||
| optional_ptr< ColumnData > | parent ) |
|
overridevirtual |
Reimplemented from duckdb::ColumnData.
|
inline |
|
overridevirtual |
Initialize prefetch state with required I/O data for the next N rows.
FIXME: does this also need CreateScanStates ??
Reimplemented from duckdb::ColumnData.


|
overridevirtual |
Initialize a scan of the column.
Reimplemented from duckdb::ColumnData.


|
overridevirtual |
Initialize a scan starting at the specified offset.
Reimplemented from duckdb::ColumnData.


|
overridevirtual |
Reimplemented from duckdb::ColumnData.
|
overridevirtual |
Reimplemented from duckdb::ColumnData.
|
overridevirtual |
Skip the scan forward by "count" rows.
Reimplemented from duckdb::ColumnData.


|
overridevirtual |
Initialize an appending phase for this column.
Reimplemented from duckdb::ColumnData.


|
overridevirtual |
Append a vector of type [type] to the end of the column.
Reimplemented from duckdb::ColumnData.


|
overridevirtual |
Revert a set of appends to the ColumnData.
Reimplemented from duckdb::ColumnData.


|
overridevirtual |
Fetch the vector from the column data that belongs to this specific row.
Reimplemented from duckdb::ColumnData.


|
overridevirtual |
Fetch a specific row id and append it to the vector.
Shredded field exists and is fully shredded, add the storage index to create a pushed-down 'struct_extract' to get the leaf
FIXME: adjust UnshredVariantData so we can write the value in place directly.
No extract required
No cast required
Need to perform the cast here as well
Reimplemented from duckdb::ColumnData.


|
overridevirtual |
Reimplemented from duckdb::ColumnData.
|
overridevirtual |
Reimplemented from duckdb::ColumnData.
|
overridevirtual |
Reimplemented from duckdb::ColumnData.
|
overridevirtual |
Reimplemented from duckdb::ColumnData.
|
overridevirtual |
Reimplemented from duckdb::ColumnData.
|
overridevirtual |
We couldn't determine a shredding type from the data
STRUCT(unshredded VARIANT, shredded <...>)
Now checkpoint the shredded data
Reimplemented from duckdb::ColumnData.


|
overridevirtual |
Reimplemented from duckdb::ColumnData.
|
overridevirtual |
Whether or not the column has ANY changes, including in child columns.
Reimplemented from duckdb::ColumnData.


|
overridevirtual |
Reimplemented from duckdb::ColumnData.
|
overridevirtual |
This means the VARIANT is shredded
Reimplemented from duckdb::ColumnData.


|
overridevirtual |
Reimplemented from duckdb::ColumnData.
|
overridevirtual |
Reimplemented from duckdb::ColumnData.
|
static |
First traverse the Variant to write the shredded values and collect the 'untyped_value_index'es
Now we can write the unshredded values
Allocate for the new data, use the same size as source


|
static |
| void duckdb::VariantColumnData::SetValidityData | ( | shared_ptr< ValidityColumnData > | validity_p | ) |
| void duckdb::VariantColumnData::SetChildData | ( | vector< shared_ptr< ColumnData > > | child_data | ) |
|
private |
scan_chunk
append_chunk
Create the new column data for the shredded data
Scan + transform + append


|
private |
FIXME: this happens when we Checkpoint but don't restart, the stats of the ColumnData aren't updated by Checkpoint The variant is shredded, but there are no stats / the stats are cluttered (?)
shredded.typed_value
Can't push down an extract if the leaf we're extracting is not a primitive (Since the shredded representation for OBJECT/ARRAY is interleaved with 'untyped_value_index' fields)


|
private |
Re-initialize the scan state, since VARIANT can have a different shape for every RowGroup
Shredded field exists and is fully shredded, add the storage index to create a pushed-down 'struct_extract' to get the leaf


|
private |
FIXME: We could also push down the extract if we're returning VARIANT Then we can do the unshredding on the extracted data, rather than falling back to unshredding+extracting This invariant is ensured by CreateScanStates
In the initialize we have verified that the field exists and the data is fully shredded (for this rowgroup) We have created a scan state that performs a 'struct_extract' in the shredded data, to extract the requested field.s
Shredded ARRAY Variant looks like: LIST(STRUCT(typed_value <child_type>, untyped_value_index UINTEGER)) We need to transform this to: LIST(<child_type>)
Fall back to unshredding


|
private |
scan_chunk

