From 9f5e2bb3697d06c8c692b90e9988dd8eab0b2e47 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 8 Jan 2025 16:01:12 +0000 Subject: [PATCH] vendor: Update vendored sources to duckdb/duckdb@dcb9627543af52e4322de464003259a6b0e7fdb4 (#980) [Dev] Fix an unnecessary copy in Dictionary compression (duckdb/duckdb#15594) Co-authored-by: krlmlr --- src/duckdb/src/function/table/version/pragma_version.cpp | 6 +++--- .../duckdb/storage/compression/dictionary/compression.hpp | 1 - .../src/storage/compression/dictionary/compression.cpp | 7 ++++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/duckdb/src/function/table/version/pragma_version.cpp b/src/duckdb/src/function/table/version/pragma_version.cpp index 4641dd23e..5a680f9c6 100644 --- a/src/duckdb/src/function/table/version/pragma_version.cpp +++ b/src/duckdb/src/function/table/version/pragma_version.cpp @@ -1,5 +1,5 @@ #ifndef DUCKDB_PATCH_VERSION -#define DUCKDB_PATCH_VERSION "4-dev4159" +#define DUCKDB_PATCH_VERSION "4-dev4161" #endif #ifndef DUCKDB_MINOR_VERSION #define DUCKDB_MINOR_VERSION 1 @@ -8,10 +8,10 @@ #define DUCKDB_MAJOR_VERSION 1 #endif #ifndef DUCKDB_VERSION -#define DUCKDB_VERSION "v1.1.4-dev4159" +#define DUCKDB_VERSION "v1.1.4-dev4161" #endif #ifndef DUCKDB_SOURCE_ID -#define DUCKDB_SOURCE_ID "69dff93d1a" +#define DUCKDB_SOURCE_ID "dcb9627543" #endif #include "duckdb/function/table/system_functions.hpp" #include "duckdb/main/database.hpp" diff --git a/src/duckdb/src/include/duckdb/storage/compression/dictionary/compression.hpp b/src/duckdb/src/include/duckdb/storage/compression/dictionary/compression.hpp index b0f29dc59..09f1f44bd 100644 --- a/src/duckdb/src/include/duckdb/storage/compression/dictionary/compression.hpp +++ b/src/duckdb/src/include/duckdb/storage/compression/dictionary/compression.hpp @@ -47,7 +47,6 @@ struct DictionaryCompressionCompressState : public DictionaryCompressionState { data_ptr_t current_end_ptr; // Buffers and map for current segment - StringHeap heap; string_map_t current_string_map; vector index_buffer; vector selection_buffer; diff --git a/src/duckdb/src/storage/compression/dictionary/compression.cpp b/src/duckdb/src/storage/compression/dictionary/compression.cpp index 064697fc7..64a3db402 100644 --- a/src/duckdb/src/storage/compression/dictionary/compression.cpp +++ b/src/duckdb/src/storage/compression/dictionary/compression.cpp @@ -6,8 +6,7 @@ namespace duckdb { DictionaryCompressionCompressState::DictionaryCompressionCompressState(ColumnDataCheckpointData &checkpoint_data_p, const CompressionInfo &info) : DictionaryCompressionState(info), checkpoint_data(checkpoint_data_p), - function(checkpoint_data.GetCompressionFunction(CompressionType::COMPRESSION_DICTIONARY)), - heap(BufferAllocator::Get(checkpoint_data.GetDatabase())) { + function(checkpoint_data.GetCompressionFunction(CompressionType::COMPRESSION_DICTIONARY)) { CreateEmptySegment(checkpoint_data.GetRowGroup().start); } @@ -72,7 +71,9 @@ void DictionaryCompressionCompressState::AddNewString(string_t str) { if (str.IsInlined()) { current_string_map.insert({str, index_buffer.size() - 1}); } else { - current_string_map.insert({heap.AddBlob(str), index_buffer.size() - 1}); + string_t dictionary_string((const char *)dict_pos, UnsafeNumericCast(str.GetSize())); // NOLINT + D_ASSERT(!dictionary_string.IsInlined()); + current_string_map.insert({dictionary_string, index_buffer.size() - 1}); } DictionaryCompression::SetDictionary(*current_segment, current_handle, current_dictionary);