|
| | ConflictManager (const VerifyExistenceType lookup_type, const idx_t chunk_size, optional_ptr< ConflictInfo > conflict_info=nullptr) |
| bool | AddHit (const idx_t index_in_chunk, const row_t row_id) |
| | Returns true, if we need to throw, otherwise, adds the hit and returns false.
|
| bool | AddSecondHit (const idx_t index_in_chunk, const row_t row_id) |
| | Returns true, if we need to throw, otherwise, adds the second hit and returns false.
|
| bool | AddNull (const idx_t index_in_chunk) |
| | Returns true, if we need to throw, otherwise, adds the NULL and returns false.
|
| optional_idx | GetFirstInvalidIndex (const idx_t count, const bool negate=false) |
| | Returns the index of the first (in)valid row, if any.
|
| void | FinalizeGlobal (DuckTransaction &transaction, DataTable &table) |
| | Finalizes a global conflict manager.
|
| void | FinalizeLocal (DataTable &table, LocalStorage &storage) |
| | Finalizes a local conflict manager.
|
| void | FinishLookup () |
| | Determines if we are finished registering conflicts.
|
| const ConflictInfo & | GetConflictInfo () const |
| | Get the conflict information.
|
| void | SetMode (const ConflictManagerMode mode_p) |
| | Sets the mode of the conflict manager.
|
| void | AddIndex (BoundIndex &index, optional_ptr< BoundIndex > delete_index) |
| | Adds an index and its respective delete_index.
|
| bool | IndexMatches (BoundIndex &index) |
| | Returns true, if the index is in this conflict manager.
|
| const vector< reference< BoundIndex > > & | MatchingIndexes () const |
| | Returns a reference to the matching indexes.
|
| const vector< optional_ptr< BoundIndex > > & | MatchingDeleteIndexes () const |
| | Returns a reference to the matching delete indexes.
|
| VerifyExistenceType | GetVerifyExistenceType () const |
| | Returns the existence verification type.
|
| bool | HasConflicts () const |
| | Returns true, if there are any conflicts, else false.
|
| idx_t | ConflictCount () const |
| | Returns the number of conflicts.
|
| Vector & | GetRowIds () |
| SelectionVector & | GetInvertedSel () const |
| idx_t | GetFirstIndex () const |
| | Returns the first index in a chunk with a conflict.
|
| ValidityArray & | GetFirstValidity () |
| | Returns the validity array of the first conflict data.
|
|
| bool | IsConflict (LookupResultType type) |
| | Returns true, if we register a conflict for the lookup type.
|
| bool | AddHit (const idx_t index_in_chunk, const std::function< void()> &callback) |
| | Adds a hit to the conflicts.
|
| void | Finalize (const std::function< bool(const row_t row_id)> &callback) |
| | Determine visible row ID for each index with two possible row IDs.
|
| bool | ShouldThrow (const idx_t index_in_chunk) const |
| | Returns true, if the conflict manager should throw an exception, else false.
|
| bool | IgnoreNulls () const |
| | Returns true, if we ignore NULLs, else false.
|
| ConflictData & | GetConflictData (const idx_t i) |
| void | AddRowId (const idx_t index_in_chunk, const row_t row_id) |
| | Adds a row ID to the primary conflict data.
|
| void | AddSecondRowId (const idx_t index_in_chunk, const row_t row_id) |
| | Adds a row ID to the secondary conflict data.
|
|
|
VerifyExistenceType | verify_existence_type |
| | The type of constraint verification for which we're using the conflict manager.
|
|
idx_t | chunk_size |
| | The count of the data chunk for which we've created the conflict manager.
|
|
optional_ptr< ConflictInfo > | conflict_info |
| | Optional information to match indexes to the conflict target.
|
|
ConflictManagerMode | mode |
| | The mode of the conflict manager.
|
|
vector< reference< BoundIndex > > | matching_indexes |
| | Indexes matching the conflict target.
|
|
vector< optional_ptr< BoundIndex > > | matching_delete_indexes |
| | Delete indexes matching the conflict target.
|
|
case_insensitive_set_t | index_names |
| | All matching indexes by their name (unique identifier).
|
|
unordered_set< idx_t > | conflict_rows |
| | Registers all conflicting rows in a data chunk.
|
|
bool | finished = false |
| | True, if we can skip recording any further conflicts.
|
| array< ConflictData, 2 > | conflict_data |
The conflict manager tracks conflicts during constraint verification. It decides when/if to throw, and records conflicts to be used later in case of ON CONFLICT DO. The conflict manager operates on a per-chunk basis, i.e., we construct a new conflict manager per incoming chunk. On conflict manager can gather conflicts across multiple indexes, if they match the ON CONFLICT DO target.