Skip to content

Commit

Permalink
Avoid writing warning data to disk for rel batch insert
Browse files Browse the repository at this point in the history
  • Loading branch information
royi-luo committed Feb 12, 2025
1 parent 25be8c3 commit 6ab993c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/include/storage/store/csr_chunked_node_group.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ class ChunkedCSRNodeGroup final : public ChunkedNodeGroup {

void flush(FileHandle& dataFH) override;

// this does not override ChunkedNodeGroup::merge() since clang-tidy analyzer seems to struggle
// with detecting the std::move of the header in that case
void mergeChunkedCSRGroup(ChunkedCSRNodeGroup& base,
const std::vector<common::column_id_t>& columnsToMergeInto);

private:
ChunkedCSRHeader csrHeader;
};
Expand Down
4 changes: 3 additions & 1 deletion src/processor/operator/persistent/rel_batch_insert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,10 @@ static void appendNewChunkedGroup(MemoryManager& mm, transaction::Transaction* t
// in the node group)
relTable.pushInsertInfo(transaction, direction, nodeGroup, chunkedGroup.getNumRows(), source);
if (isNewNodeGroup) {
ChunkedCSRNodeGroup sliceToWriteToDisk{chunkedGroup, columnIDs};
auto flushedChunkedGroup =
chunkedGroup.flushAsNewChunkedNodeGroup(transaction, *relTable.getDataFH());
sliceToWriteToDisk.flushAsNewChunkedNodeGroup(transaction, *relTable.getDataFH());
chunkedGroup.mergeChunkedCSRGroup(sliceToWriteToDisk, columnIDs);

// If there are deleted columns that haven't been vaccumed yet
// we need to add extra columns to the chunked group
Expand Down
6 changes: 6 additions & 0 deletions src/storage/store/csr_chunked_node_group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,12 @@ void ChunkedCSRNodeGroup::flush(FileHandle& dataFH) {
}
}

void ChunkedCSRNodeGroup::mergeChunkedCSRGroup(ChunkedCSRNodeGroup& base,
const std::vector<common::column_id_t>& columnsToMergeInto) {
ChunkedNodeGroup::merge(base, columnsToMergeInto);
csrHeader = std::move(base.csrHeader);
}

void ChunkedCSRNodeGroup::scanCSRHeader(MemoryManager& memoryManager,
CSRNodeGroupCheckpointState& csrState) const {
if (!csrState.oldHeader) {
Expand Down

0 comments on commit 6ab993c

Please sign in to comment.