![]() |
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.
|
DataTable represents a physical table on disk. More...
#include <duckdb.hpp>


Public Member Functions | |
| DataTable (AttachedDatabase &db, shared_ptr< TableIOManager > table_io_manager, const string &schema, const string &table, vector< ColumnDefinition > column_definitions_p, unique_ptr< PersistentTableData > data=nullptr) | |
| Constructs a new data table from an (optional) set of persistent segments. | |
| DataTable (ClientContext &context, DataTable &parent, ColumnDefinition &new_column, Expression &default_value) | |
| Constructs a DataTable as a delta on an existing data table with a newly added column. | |
| DataTable (ClientContext &context, DataTable &parent, idx_t removed_column) | |
| Constructs a DataTable as a delta on an existing data table but with one column removed. | |
| DataTable (ClientContext &context, DataTable &parent, idx_t changed_idx, const LogicalType &target_type, const vector< StorageIndex > &bound_columns, Expression &cast_expr) | |
| Constructs a DataTable as a delta on an existing data table but with one column changed type. | |
| DataTable (ClientContext &context, DataTable &parent, BoundConstraint &constraint) | |
| Constructs a DataTable as a delta on an existing data table but with one column added new constraint. | |
| AttachedDatabase & | GetAttached () |
| TableIOManager & | GetTableIOManager () |
| bool | IsTemporary () const |
| vector< LogicalType > | GetTypes () |
| Returns a list of types of the table. | |
| const vector< ColumnDefinition > & | Columns () const |
| void | InitializeScan (ClientContext &context, DuckTransaction &transaction, TableScanState &state, const vector< StorageIndex > &column_ids, optional_ptr< TableFilterSet > table_filters=nullptr) |
| idx_t | MaxThreads (ClientContext &context) const |
| Returns the maximum amount of threads that should be assigned to scan this data table. | |
| void | InitializeParallelScan (ClientContext &context, ParallelTableScanState &state, const vector< ColumnIndex > &column_indexes) |
| idx_t | NextParallelScan (ClientContext &context, ParallelTableScanState &state, TableScanState &scan_state) |
| void | Scan (DuckTransaction &transaction, DataChunk &result, TableScanState &state) |
| Scans up to STANDARD_VECTOR_SIZE elements from the table starting from offset and store them in result. Offset is incremented with how many elements were returned. Returns true if all pushed down filters were executed during data fetching. | |
| void | Fetch (DuckTransaction &transaction, DataChunk &result, const vector< StorageIndex > &column_ids, const Vector &row_ids, idx_t fetch_count, ColumnFetchState &state) |
| Fetch data from the specific row identifiers from the base table. | |
| void | FetchCommitted (DataChunk &result, const vector< StorageIndex > &column_ids, const Vector &row_identifiers, idx_t fetch_count, ColumnFetchState &state) |
| bool | CanFetch (DuckTransaction &transaction, const row_t row_id) |
| Returns true, if the transaction can fetch the row ID. | |
| void | InitializeLocalAppend (LocalAppendState &state, TableCatalogEntry &table, ClientContext &context, const vector< unique_ptr< BoundConstraint > > &bound_constraints) |
| Initializes appending to transaction-local storage. | |
| void | InitializeLocalStorage (LocalAppendState &state, TableCatalogEntry &table, ClientContext &context, const vector< unique_ptr< BoundConstraint > > &bound_constraints) |
| Initializes only the delete-indexes of the transaction-local storage. | |
| void | LocalAppend (LocalAppendState &state, ClientContext &context, DataChunk &chunk, bool unsafe) |
| Append a DataChunk to the transaction-local storage of the table. | |
| void | FinalizeLocalAppend (LocalAppendState &state) |
| Finalizes a transaction-local append. | |
| void | LocalAppend (TableCatalogEntry &table, ClientContext &context, DataChunk &chunk, const vector< unique_ptr< BoundConstraint > > &bound_constraints, Vector &row_ids, DataChunk &delete_chunk) |
| Append a chunk to the transaction-local storage of this table and update the delete indexes. | |
| void | LocalAppend (TableCatalogEntry &table, ClientContext &context, DataChunk &chunk, const vector< unique_ptr< BoundConstraint > > &bound_constraints) |
| Appends to the transaction-local storage of this table. | |
| void | LocalWALAppend (TableCatalogEntry &table, ClientContext &context, DataChunk &chunk, const vector< unique_ptr< BoundConstraint > > &bound_constraints) |
| Append a chunk to the transaction-local storage of this table. | |
| void | LocalAppend (TableCatalogEntry &table, ClientContext &context, ColumnDataCollection &collection, const vector< unique_ptr< BoundConstraint > > &bound_constraints, optional_ptr< const vector< LogicalIndex > > column_ids) |
| Append a column data collection with default values to the transaction-local storage of this table. | |
| void | LocalMerge (ClientContext &context, OptimisticWriteCollection &collection) |
| Merge a row group collection into the transaction-local storage. | |
| PhysicalIndex | CreateOptimisticCollection (ClientContext &context, unique_ptr< OptimisticWriteCollection > collection) |
| Create an optimistic row group collection for this table. Used for optimistically writing parallel appends. Returns the index into the optimistic_collections vector for newly created collection. | |
| OptimisticWriteCollection & | GetOptimisticCollection (ClientContext &context, const PhysicalIndex collection_index) |
| Returns the optimistic row group collection corresponding to the index. | |
| void | ResetOptimisticCollection (ClientContext &context, const PhysicalIndex collection_index) |
| Resets the optimistic row group collection corresponding to the index. | |
| OptimisticDataWriter & | GetOptimisticWriter (ClientContext &context) |
| Returns the optimistic writer of the corresponding local table. | |
| unique_ptr< TableDeleteState > | InitializeDelete (TableCatalogEntry &table, ClientContext &context, const vector< unique_ptr< BoundConstraint > > &bound_constraints) |
| idx_t | Delete (TableDeleteState &state, ClientContext &context, Vector &row_ids, idx_t count) |
| Delete the entries with the specified row identifier from the table. | |
| unique_ptr< TableUpdateState > | InitializeUpdate (TableCatalogEntry &table, ClientContext &context, const vector< unique_ptr< BoundConstraint > > &bound_constraints) |
| void | Update (TableUpdateState &state, ClientContext &context, Vector &row_ids, const vector< PhysicalIndex > &column_ids, DataChunk &data) |
| Update the entries with the specified row identifier from the table. | |
| void | UpdateColumn (TableCatalogEntry &table, ClientContext &context, Vector &row_ids, const vector< column_t > &column_path, DataChunk &updates) |
| Update a single (sub-)column along a column path The column_path vector is a path towards a column within the table i.e. if we have a table with a single column S STRUCT(A INT, B INT) and we update the validity mask of "S.B" the column path is: 0 (first column of table) -> 1 (second subcolumn of struct) -> 0 (first subcolumn of INT) This method should only be used from the WAL replay. It does not verify update constraints. | |
| void | AppendLock (DuckTransaction &transaction, TableAppendState &state) |
| Fetches an append lock. | |
| void | InitializeAppend (DuckTransaction &transaction, TableAppendState &state) |
| Begin appending structs to this table, obtaining necessary locks, etc. | |
| void | Append (DataChunk &chunk, TableAppendState &state) |
| Append a chunk to the table using the AppendState obtained from InitializeAppend. | |
| void | FinalizeAppend (DuckTransaction &transaction, TableAppendState &state) |
| Finalize an append. | |
| void | CommitAppend (transaction_t commit_id, idx_t row_start, idx_t count) |
| Commit the append. | |
| void | WriteToLog (DuckTransaction &transaction, WriteAheadLog &log, idx_t row_start, idx_t count, optional_ptr< StorageCommitState > commit_state) |
| Write a segment of the table to the WAL. | |
| void | RevertAppend (DuckTransaction &transaction, idx_t start_row, idx_t count) |
| Revert a set of appends made by the given AppendState, used to revert appends in the event of an error during commit (e.g. because of an I/O exception). | |
| void | RevertAppendInternal (idx_t start_row) |
| void | ScanTableSegment (DuckTransaction &transaction, idx_t start_row, idx_t count, const std::function< void(DataChunk &chunk)> &function) |
| void | MergeStorage (RowGroupCollection &data, optional_ptr< StorageCommitState > commit_state) |
| Merge a row group collection directly into this table - appending it to the end of the table without copying. | |
| ErrorData | AppendToIndexes (optional_ptr< TableIndexList > delete_indexes, DataChunk &table_chunk, DataChunk &index_chunk, const vector< StorageIndex > &mapped_column_ids, row_t row_start, const IndexAppendMode index_append_mode) |
| void | RevertIndexAppend (TableAppendState &state, DataChunk &chunk, row_t row_start) |
| Revert a previous append made to indexes in a chunk with the row ids [row_start, ..., row_start + chunk.size()]. | |
| void | RevertIndexAppend (TableAppendState &state, DataChunk &chunk, Vector &row_identifiers) |
| Revert a previous append made to indexes with the given row-ids. | |
| void | RemoveFromIndexes (const QueryContext &context, Vector &row_identifiers, idx_t count, IndexRemovalType removal_type, optional_idx checkpoint_id=optional_idx()) |
| Remove the row identifiers from all the indexes of the table. | |
| void | SetAsMainTable () |
| void | SetAsDropped () |
| bool | IsMainTable () const |
| bool | IsRoot () const |
| string | TableModification () const |
| unique_ptr< BaseStatistics > | GetStatistics (ClientContext &context, const StorageIndex &column_id) |
| Get statistics of a physical column within the table. | |
| unique_ptr< BlockingSample > | GetSample () |
| Get table sample. | |
| void | SetDistinct (column_t column_id, unique_ptr< DistinctStatistics > distinct_stats) |
| Sets statistics of a physical column within the table. | |
| unique_ptr< StorageLockKey > | GetCheckpointLock () |
| Obtains a lock during a checkpoint operation that prevents other threads from reading this table. | |
| void | Checkpoint (TableDataWriter &writer, Serializer &serializer) |
| Checkpoint the table to the specified table data writer. | |
| void | CommitDropTable () |
| void | CommitDropColumn (const idx_t column_index) |
| idx_t | ColumnCount () const |
| idx_t | GetTotalRows () const |
| vector< ColumnSegmentInfo > | GetColumnSegmentInfo (const QueryContext &context) |
| bool | CreateIndexScan (TableScanState &state, DataChunk &result) |
| Scans the next chunk for the CREATE INDEX operator. | |
| bool | IndexNameIsUnique (const string &name) |
| Returns true, if the index name is unique (i.e., no PK, UNIQUE, FK constraint has the same name) FIXME: This is only necessary until we treat all indexes as catalog entries, allowing to alter constraints. | |
| unique_ptr< ConstraintState > | InitializeConstraintState (TableCatalogEntry &table, const vector< unique_ptr< BoundConstraint > > &bound_constraints) |
| Initialize constraint verification state. | |
| void | VerifyAppendConstraints (ConstraintState &constraint_state, ClientContext &context, DataChunk &chunk, optional_ptr< LocalTableStorage > local_storage, optional_ptr< ConflictManager > manager) |
| Verify constraints with a chunk from the Append containing all columns of the table. | |
| shared_ptr< DataTableInfo > & | GetDataTableInfo () |
| void | BindIndexes (ClientContext &context) |
| bool | HasIndexes () const |
| bool | HasUniqueIndexes () const |
| bool | HasForeignKeyIndex (const vector< PhysicalIndex > &keys, ForeignKeyType type) |
| void | SetIndexStorageInfo (vector< IndexStorageInfo > index_storage_info) |
| void | VacuumIndexes () |
| void | VerifyIndexBuffers () |
| void | CleanupAppend (transaction_t lowest_transaction, idx_t start, idx_t count) |
| void | Destroy () |
| string | GetTableName () const |
| void | SetTableName (string new_name) |
| TableStorageInfo | GetStorageInfo () |
| idx_t | GetRowGroupSize () const |
| void | VerifyUniqueIndexes (TableIndexList &indexes, optional_ptr< LocalTableStorage > storage, DataChunk &chunk, optional_ptr< ConflictManager > manager) |
| Verify any unique indexes using optional delete indexes in the local storage. | |
| void | AddIndex (const ColumnList &columns, const vector< LogicalIndex > &column_indexes, const IndexConstraintType type, IndexStorageInfo index_info) |
| AddIndex initializes an index and adds it to the table's index list. It is either empty, or initialized via its index storage information. | |
| void | AddIndex (unique_ptr< Index > index) |
| AddIndex moves an index to this table's index list. | |
| vector< PartitionStatistics > | GetPartitionStats (ClientContext &context) |
| Returns a list of the partition stats. | |
| Public Member Functions inherited from duckdb::enable_shared_from_this< DataTable > | |
| shared_ptr< DataTable > | shared_from_this () |
Static Public Member Functions | |
| static ErrorData | AppendToIndexes (TableIndexList &indexes, optional_ptr< TableIndexList > delete_indexes, DataChunk &table_chunk, DataChunk &index_chunk, const vector< StorageIndex > &mapped_column_ids, row_t row_start, const IndexAppendMode index_append_mode, optional_idx active_checkpoint) |
| Appends a chunk with the row ids [row_start, ..., row_start + chunk.size()] to all indexes of the table. If an index is bound, it appends table_chunk. Else, it buffers index_chunk. | |
Public Attributes | |
| AttachedDatabase & | db |
| A reference to the database instance. | |
Private Member Functions | |
| void | VerifyNewConstraint (LocalStorage &local_storage, DataTable &parent, const BoundConstraint &constraint) |
| Verify the new added constraints against current persistent&local data. | |
| void | VerifyUpdateConstraints (ConstraintState &state, ClientContext &context, DataChunk &chunk, const vector< PhysicalIndex > &column_ids) |
| Verify constraints with a chunk from the Update containing only the specified column_ids. | |
| void | VerifyDeleteConstraints (optional_ptr< LocalTableStorage > storage, TableDeleteState &state, ClientContext &context, DataChunk &chunk) |
| Verify constraints with a chunk from the Delete containing all columns of the table. | |
| void | InitializeScanWithOffset (DuckTransaction &transaction, TableScanState &state, const vector< StorageIndex > &column_ids, idx_t start_row, idx_t end_row) |
| void | RebuildIndexes () |
| Rebuild all indexes after vacuuming changed rowid's (used with vacuum_rebuild_indexes setting). | |
| void | VerifyForeignKeyConstraint (optional_ptr< LocalTableStorage > storage, const BoundForeignKeyConstraint &bound_foreign_key, ClientContext &context, DataChunk &chunk, VerifyExistenceType type) |
| void | VerifyAppendForeignKeyConstraint (optional_ptr< LocalTableStorage > storage, const BoundForeignKeyConstraint &bound_foreign_key, ClientContext &context, DataChunk &chunk) |
| void | VerifyDeleteForeignKeyConstraint (optional_ptr< LocalTableStorage > storage, const BoundForeignKeyConstraint &bound_foreign_key, ClientContext &context, DataChunk &chunk) |
Private Attributes | |
| shared_ptr< DataTableInfo > | info |
| The table info. | |
| vector< ColumnDefinition > | column_definitions |
| The set of physical columns stored by this DataTable. | |
| mutex | append_lock |
| Lock for appending entries to the table. | |
| shared_ptr< RowGroupCollection > | row_groups |
| The row groups of the table. | |
| atomic< DataTableVersion > | version |
| The version of the data table. | |
Additional Inherited Members | |
| Protected Member Functions inherited from duckdb::enable_shared_from_this< DataTable > | |
| enable_shared_from_this & | operator= (enable_shared_from_this const &) noexcept |
DataTable represents a physical table on disk.
| duckdb::DataTable::DataTable | ( | AttachedDatabase & | db, |
| shared_ptr< TableIOManager > | table_io_manager, | ||
| const string & | schema, | ||
| const string & | table, | ||
| vector< ColumnDefinition > | column_definitions_p, | ||
| unique_ptr< PersistentTableData > | data = nullptr ) |
Constructs a new data table from an (optional) set of persistent segments.


| duckdb::DataTable::DataTable | ( | ClientContext & | context, |
| DataTable & | parent, | ||
| ColumnDefinition & | new_column, | ||
| Expression & | default_value ) |
Constructs a DataTable as a delta on an existing data table with a newly added column.

| duckdb::DataTable::DataTable | ( | ClientContext & | context, |
| DataTable & | parent, | ||
| idx_t | removed_column ) |
Constructs a DataTable as a delta on an existing data table but with one column removed.

| duckdb::DataTable::DataTable | ( | ClientContext & | context, |
| DataTable & | parent, | ||
| idx_t | changed_idx, | ||
| const LogicalType & | target_type, | ||
| const vector< StorageIndex > & | bound_columns, | ||
| Expression & | cast_expr ) |
Constructs a DataTable as a delta on an existing data table but with one column changed type.

| duckdb::DataTable::DataTable | ( | ClientContext & | context, |
| DataTable & | parent, | ||
| BoundConstraint & | constraint ) |
Constructs a DataTable as a delta on an existing data table but with one column added new constraint.

| AttachedDatabase & duckdb::DataTable::GetAttached | ( | ) |
| TableIOManager & duckdb::DataTable::GetTableIOManager | ( | ) |
| bool duckdb::DataTable::IsTemporary | ( | ) | const |
| vector< LogicalType > duckdb::DataTable::GetTypes | ( | ) |
Returns a list of types of the table.

| const vector< ColumnDefinition > & duckdb::DataTable::Columns | ( | ) | const |
| void duckdb::DataTable::InitializeScan | ( | ClientContext & | context, |
| DuckTransaction & | transaction, | ||
| TableScanState & | state, | ||
| const vector< StorageIndex > & | column_ids, | ||
| optional_ptr< TableFilterSet > | table_filters = nullptr ) |
| idx_t duckdb::DataTable::MaxThreads | ( | ClientContext & | context | ) | const |
Returns the maximum amount of threads that should be assigned to scan this data table.
| void duckdb::DataTable::InitializeParallelScan | ( | ClientContext & | context, |
| ParallelTableScanState & | state, | ||
| const vector< ColumnIndex > & | column_indexes ) |
| idx_t duckdb::DataTable::NextParallelScan | ( | ClientContext & | context, |
| ParallelTableScanState & | state, | ||
| TableScanState & | scan_state ) |
| void duckdb::DataTable::Scan | ( | DuckTransaction & | transaction, |
| DataChunk & | result, | ||
| TableScanState & | state ) |
Scans up to STANDARD_VECTOR_SIZE elements from the table starting from offset and store them in result. Offset is incremented with how many elements were returned. Returns true if all pushed down filters were executed during data fetching.
| void duckdb::DataTable::Fetch | ( | DuckTransaction & | transaction, |
| DataChunk & | result, | ||
| const vector< StorageIndex > & | column_ids, | ||
| const Vector & | row_ids, | ||
| idx_t | fetch_count, | ||
| ColumnFetchState & | state ) |
Fetch data from the specific row identifiers from the base table.


| void duckdb::DataTable::FetchCommitted | ( | DataChunk & | result, |
| const vector< StorageIndex > & | column_ids, | ||
| const Vector & | row_identifiers, | ||
| idx_t | fetch_count, | ||
| ColumnFetchState & | state ) |
| bool duckdb::DataTable::CanFetch | ( | DuckTransaction & | transaction, |
| const row_t | row_id ) |
Returns true, if the transaction can fetch the row ID.

| void duckdb::DataTable::InitializeLocalAppend | ( | LocalAppendState & | state, |
| TableCatalogEntry & | table, | ||
| ClientContext & | context, | ||
| const vector< unique_ptr< BoundConstraint > > & | bound_constraints ) |
Initializes appending to transaction-local storage.


| void duckdb::DataTable::InitializeLocalStorage | ( | LocalAppendState & | state, |
| TableCatalogEntry & | table, | ||
| ClientContext & | context, | ||
| const vector< unique_ptr< BoundConstraint > > & | bound_constraints ) |
Initializes only the delete-indexes of the transaction-local storage.

| void duckdb::DataTable::LocalAppend | ( | LocalAppendState & | state, |
| ClientContext & | context, | ||
| DataChunk & | chunk, | ||
| bool | unsafe ) |
Append a DataChunk to the transaction-local storage of the table.


| void duckdb::DataTable::FinalizeLocalAppend | ( | LocalAppendState & | state | ) |
Finalizes a transaction-local append.


| void duckdb::DataTable::LocalAppend | ( | TableCatalogEntry & | table, |
| ClientContext & | context, | ||
| DataChunk & | chunk, | ||
| const vector< unique_ptr< BoundConstraint > > & | bound_constraints, | ||
| Vector & | row_ids, | ||
| DataChunk & | delete_chunk ) |
Append a chunk to the transaction-local storage of this table and update the delete indexes.

| void duckdb::DataTable::LocalAppend | ( | TableCatalogEntry & | table, |
| ClientContext & | context, | ||
| DataChunk & | chunk, | ||
| const vector< unique_ptr< BoundConstraint > > & | bound_constraints ) |
Appends to the transaction-local storage of this table.

| void duckdb::DataTable::LocalWALAppend | ( | TableCatalogEntry & | table, |
| ClientContext & | context, | ||
| DataChunk & | chunk, | ||
| const vector< unique_ptr< BoundConstraint > > & | bound_constraints ) |
Append a chunk to the transaction-local storage of this table.

| void duckdb::DataTable::LocalAppend | ( | TableCatalogEntry & | table, |
| ClientContext & | context, | ||
| ColumnDataCollection & | collection, | ||
| const vector< unique_ptr< BoundConstraint > > & | bound_constraints, | ||
| optional_ptr< const vector< LogicalIndex > > | column_ids ) |
Append a column data collection with default values to the transaction-local storage of this table.

| void duckdb::DataTable::LocalMerge | ( | ClientContext & | context, |
| OptimisticWriteCollection & | collection ) |
Merge a row group collection into the transaction-local storage.

| PhysicalIndex duckdb::DataTable::CreateOptimisticCollection | ( | ClientContext & | context, |
| unique_ptr< OptimisticWriteCollection > | collection ) |
Create an optimistic row group collection for this table. Used for optimistically writing parallel appends. Returns the index into the optimistic_collections vector for newly created collection.
| OptimisticWriteCollection & duckdb::DataTable::GetOptimisticCollection | ( | ClientContext & | context, |
| const PhysicalIndex | collection_index ) |
Returns the optimistic row group collection corresponding to the index.

| void duckdb::DataTable::ResetOptimisticCollection | ( | ClientContext & | context, |
| const PhysicalIndex | collection_index ) |
Resets the optimistic row group collection corresponding to the index.

| OptimisticDataWriter & duckdb::DataTable::GetOptimisticWriter | ( | ClientContext & | context | ) |
Returns the optimistic writer of the corresponding local table.

| unique_ptr< TableDeleteState > duckdb::DataTable::InitializeDelete | ( | TableCatalogEntry & | table, |
| ClientContext & | context, | ||
| const vector< unique_ptr< BoundConstraint > > & | bound_constraints ) |
| idx_t duckdb::DataTable::Delete | ( | TableDeleteState & | state, |
| ClientContext & | context, | ||
| Vector & | row_ids, | ||
| idx_t | count ) |
Delete the entries with the specified row identifier from the table.

| unique_ptr< TableUpdateState > duckdb::DataTable::InitializeUpdate | ( | TableCatalogEntry & | table, |
| ClientContext & | context, | ||
| const vector< unique_ptr< BoundConstraint > > & | bound_constraints ) |
| void duckdb::DataTable::Update | ( | TableUpdateState & | state, |
| ClientContext & | context, | ||
| Vector & | row_ids, | ||
| const vector< PhysicalIndex > & | column_ids, | ||
| DataChunk & | data ) |
Update the entries with the specified row identifier from the table.

| void duckdb::DataTable::UpdateColumn | ( | TableCatalogEntry & | table, |
| ClientContext & | context, | ||
| Vector & | row_ids, | ||
| const vector< column_t > & | column_path, | ||
| DataChunk & | updates ) |
Update a single (sub-)column along a column path The column_path vector is a path towards a column within the table i.e. if we have a table with a single column S STRUCT(A INT, B INT) and we update the validity mask of "S.B" the column path is: 0 (first column of table) -> 1 (second subcolumn of struct) -> 0 (first subcolumn of INT) This method should only be used from the WAL replay. It does not verify update constraints.

| void duckdb::DataTable::AppendLock | ( | DuckTransaction & | transaction, |
| TableAppendState & | state ) |
Fetches an append lock.

| void duckdb::DataTable::InitializeAppend | ( | DuckTransaction & | transaction, |
| TableAppendState & | state ) |
Begin appending structs to this table, obtaining necessary locks, etc.
| void duckdb::DataTable::Append | ( | DataChunk & | chunk, |
| TableAppendState & | state ) |
Append a chunk to the table using the AppendState obtained from InitializeAppend.
| void duckdb::DataTable::FinalizeAppend | ( | DuckTransaction & | transaction, |
| TableAppendState & | state ) |
Finalize an append.
| void duckdb::DataTable::CommitAppend | ( | transaction_t | commit_id, |
| idx_t | row_start, | ||
| idx_t | count ) |
Commit the append.
| void duckdb::DataTable::WriteToLog | ( | DuckTransaction & | transaction, |
| WriteAheadLog & | log, | ||
| idx_t | row_start, | ||
| idx_t | count, | ||
| optional_ptr< StorageCommitState > | commit_state ) |
Write a segment of the table to the WAL.
| void duckdb::DataTable::RevertAppend | ( | DuckTransaction & | transaction, |
| idx_t | start_row, | ||
| idx_t | count ) |
Revert a set of appends made by the given AppendState, used to revert appends in the event of an error during commit (e.g. because of an I/O exception).

| void duckdb::DataTable::RevertAppendInternal | ( | idx_t | start_row | ) |
| void duckdb::DataTable::ScanTableSegment | ( | DuckTransaction & | transaction, |
| idx_t | start_row, | ||
| idx_t | count, | ||
| const std::function< void(DataChunk &chunk)> & | function ) |
| void duckdb::DataTable::MergeStorage | ( | RowGroupCollection & | data, |
| optional_ptr< StorageCommitState > | commit_state ) |
Merge a row group collection directly into this table - appending it to the end of the table without copying.
|
static |
Appends a chunk with the row ids [row_start, ..., row_start + chunk.size()] to all indexes of the table. If an index is bound, it appends table_chunk. Else, it buffers index_chunk.


| ErrorData duckdb::DataTable::AppendToIndexes | ( | optional_ptr< TableIndexList > | delete_indexes, |
| DataChunk & | table_chunk, | ||
| DataChunk & | index_chunk, | ||
| const vector< StorageIndex > & | mapped_column_ids, | ||
| row_t | row_start, | ||
| const IndexAppendMode | index_append_mode ) |
| void duckdb::DataTable::RevertIndexAppend | ( | TableAppendState & | state, |
| DataChunk & | chunk, | ||
| row_t | row_start ) |
Revert a previous append made to indexes in a chunk with the row ids [row_start, ..., row_start + chunk.size()].


| void duckdb::DataTable::RevertIndexAppend | ( | TableAppendState & | state, |
| DataChunk & | chunk, | ||
| Vector & | row_identifiers ) |
Revert a previous append made to indexes with the given row-ids.

| void duckdb::DataTable::RemoveFromIndexes | ( | const QueryContext & | context, |
| Vector & | row_identifiers, | ||
| idx_t | count, | ||
| IndexRemovalType | removal_type, | ||
| optional_idx | checkpoint_id = optional_idx() ) |
Remove the row identifiers from all the indexes of the table.
|
inline |
|
inline |
|
inline |
|
inline |
| string duckdb::DataTable::TableModification | ( | ) | const |
| unique_ptr< BaseStatistics > duckdb::DataTable::GetStatistics | ( | ClientContext & | context, |
| const StorageIndex & | column_id ) |
Get statistics of a physical column within the table.
| unique_ptr< BlockingSample > duckdb::DataTable::GetSample | ( | ) |
Get table sample.
| void duckdb::DataTable::SetDistinct | ( | column_t | column_id, |
| unique_ptr< DistinctStatistics > | distinct_stats ) |
Sets statistics of a physical column within the table.
| unique_ptr< StorageLockKey > duckdb::DataTable::GetCheckpointLock | ( | ) |
Obtains a lock during a checkpoint operation that prevents other threads from reading this table.
| void duckdb::DataTable::Checkpoint | ( | TableDataWriter & | writer, |
| Serializer & | serializer ) |
Checkpoint the table to the specified table data writer.

| void duckdb::DataTable::CommitDropTable | ( | ) |
| void duckdb::DataTable::CommitDropColumn | ( | const idx_t | column_index | ) |
| idx_t duckdb::DataTable::ColumnCount | ( | ) | const |
| idx_t duckdb::DataTable::GetTotalRows | ( | ) | const |
| vector< ColumnSegmentInfo > duckdb::DataTable::GetColumnSegmentInfo | ( | const QueryContext & | context | ) |
| bool duckdb::DataTable::CreateIndexScan | ( | TableScanState & | state, |
| DataChunk & | result ) |
Scans the next chunk for the CREATE INDEX operator.
| bool duckdb::DataTable::IndexNameIsUnique | ( | const string & | name | ) |
Returns true, if the index name is unique (i.e., no PK, UNIQUE, FK constraint has the same name) FIXME: This is only necessary until we treat all indexes as catalog entries, allowing to alter constraints.

| unique_ptr< ConstraintState > duckdb::DataTable::InitializeConstraintState | ( | TableCatalogEntry & | table, |
| const vector< unique_ptr< BoundConstraint > > & | bound_constraints ) |
Initialize constraint verification state.

| void duckdb::DataTable::VerifyAppendConstraints | ( | ConstraintState & | constraint_state, |
| ClientContext & | context, | ||
| DataChunk & | chunk, | ||
| optional_ptr< LocalTableStorage > | local_storage, | ||
| optional_ptr< ConflictManager > | manager ) |
Verify constraints with a chunk from the Append containing all columns of the table.


| shared_ptr< DataTableInfo > & duckdb::DataTable::GetDataTableInfo | ( | ) |
| void duckdb::DataTable::BindIndexes | ( | ClientContext & | context | ) |
| bool duckdb::DataTable::HasIndexes | ( | ) | const |
| bool duckdb::DataTable::HasUniqueIndexes | ( | ) | const |
| bool duckdb::DataTable::HasForeignKeyIndex | ( | const vector< PhysicalIndex > & | keys, |
| ForeignKeyType | type ) |
| void duckdb::DataTable::SetIndexStorageInfo | ( | vector< IndexStorageInfo > | index_storage_info | ) |
| void duckdb::DataTable::VacuumIndexes | ( | ) |
| void duckdb::DataTable::VerifyIndexBuffers | ( | ) |
| void duckdb::DataTable::CleanupAppend | ( | transaction_t | lowest_transaction, |
| idx_t | start, | ||
| idx_t | count ) |
| void duckdb::DataTable::Destroy | ( | ) |
| string duckdb::DataTable::GetTableName | ( | ) | const |
| void duckdb::DataTable::SetTableName | ( | string | new_name | ) |
| TableStorageInfo duckdb::DataTable::GetStorageInfo | ( | ) |
| idx_t duckdb::DataTable::GetRowGroupSize | ( | ) | const |
| void duckdb::DataTable::VerifyUniqueIndexes | ( | TableIndexList & | indexes, |
| optional_ptr< LocalTableStorage > | storage, | ||
| DataChunk & | chunk, | ||
| optional_ptr< ConflictManager > | manager ) |
Verify any unique indexes using optional delete indexes in the local storage.

| void duckdb::DataTable::AddIndex | ( | const ColumnList & | columns, |
| const vector< LogicalIndex > & | column_indexes, | ||
| const IndexConstraintType | type, | ||
| IndexStorageInfo | index_info ) |
AddIndex initializes an index and adds it to the table's index list. It is either empty, or initialized via its index storage information.

| void duckdb::DataTable::AddIndex | ( | unique_ptr< Index > | index | ) |
AddIndex moves an index to this table's index list.
| vector< PartitionStatistics > duckdb::DataTable::GetPartitionStats | ( | ClientContext & | context | ) |
Returns a list of the partition stats.
|
private |
Verify the new added constraints against current persistent&local data.


|
private |
Verify constraints with a chunk from the Update containing only the specified column_ids.


|
private |
Verify constraints with a chunk from the Delete containing all columns of the table.

|
private |
|
private |
Rebuild all indexes after vacuuming changed rowid's (used with vacuum_rebuild_indexes setting).


|
private |
|
private |
|
private |