Skip to content

Commit

Permalink
Merge pull request #26 from carlopi/apply_patches
Browse files Browse the repository at this point in the history
Apply duckdb's patches
  • Loading branch information
Maxxen authored Aug 25, 2024
2 parents a5da2f9 + cde430c commit 3e192f2
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion duckdb
Submodule duckdb updated 727 files
8 changes: 6 additions & 2 deletions src/hnsw/hnsw_index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -490,15 +490,15 @@ void HNSWIndex::PersistToDisk() {
is_dirty = false;
}

IndexStorageInfo HNSWIndex::GetStorageInfo(const bool get_buffers) {
IndexStorageInfo HNSWIndex::GetStorageInfo(const case_insensitive_map_t<Value> &options, const bool to_wal) {

PersistToDisk();

IndexStorageInfo info;
info.name = name;
info.root = root_block_ptr.Get();

if (!get_buffers) {
if (!to_wal) {
// use the partial block manager to serialize all allocator data
auto &block_manager = table_io_manager.GetIndexBlockManager();
PartialBlockManager partial_block_manager(block_manager, PartialBlockType::FULL_CHECKPOINT);
Expand Down Expand Up @@ -532,6 +532,10 @@ string HNSWIndex::VerifyAndToString(IndexLock &state, const bool only_verify) {
throw NotImplementedException("HNSWIndex::VerifyAndToString() not implemented");
}

void HNSWIndex::VerifyAllocations(IndexLock &state) {
throw NotImplementedException("HNSWIndex::VerifyAllocations() not implemented");
}

//------------------------------------------------------------------------------
// Register Index Type
//------------------------------------------------------------------------------
Expand Down
5 changes: 4 additions & 1 deletion src/hnsw/hnsw_index_physical_create.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ PhysicalCreateHNSWIndex::PhysicalCreateHNSWIndex(LogicalOperator &op, TableCatal
//-------------------------------------------------------------
class CreateHNSWIndexGlobalState final : public GlobalSinkState {
public:
CreateHNSWIndexGlobalState(const PhysicalOperator &op_p) : op(op_p) {}

const PhysicalOperator &op;
//! Global index to be added to the table
unique_ptr<HNSWIndex> global_index;

Expand All @@ -51,7 +54,7 @@ class CreateHNSWIndexGlobalState final : public GlobalSinkState {
};

unique_ptr<GlobalSinkState> PhysicalCreateHNSWIndex::GetGlobalSinkState(ClientContext &context) const {
auto gstate = make_uniq<CreateHNSWIndexGlobalState>();
auto gstate = make_uniq<CreateHNSWIndexGlobalState>(*this);

vector<LogicalType> data_types = {unbound_expressions[0]->return_type, LogicalType::ROW_TYPE};
gstate->collection = make_uniq<ColumnDataCollection>(BufferManager::GetBufferManager(context), data_types);
Expand Down
6 changes: 4 additions & 2 deletions src/include/hnsw/hnsw_index.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class HNSWIndex : public BoundIndex {
//! Insert a chunk of entries into the index
ErrorData Insert(IndexLock &lock, DataChunk &data, Vector &row_ids) override;

IndexStorageInfo GetStorageInfo(const bool get_buffers) override;
IndexStorageInfo GetStorageInfo(const case_insensitive_map_t<Value> &options, const bool to_wal) override;
idx_t GetInMemorySize(IndexLock &state) override;

//! Merge another index into this index. The lock obtained from InitializeLock must be held, and the other
Expand All @@ -85,8 +85,10 @@ class HNSWIndex : public BoundIndex {
//! Performs constraint checking for a chunk of input data
void CheckConstraintsForChunk(DataChunk &input, ConflictManager &conflict_manager) override;

//! Returns the string representation of the HNSWIndex, or only traverses and verifies the index
//! Returns the string representation of the HNSWIndex, or only traverses and verifies the index.
string VerifyAndToString(IndexLock &state, const bool only_verify) override;
//! Ensures that the node allocation counts match the node counts.
void VerifyAllocations(IndexLock &state) override;

string GetConstraintViolationMessage(VerifyExistenceType verify_type, idx_t failed_index,
DataChunk &input) override {
Expand Down

0 comments on commit 3e192f2

Please sign in to comment.