Skip to content

Commit 9cf2102

Browse files
duckdblabs-botgithub-actions[bot]
authored andcommitted
Update vendored DuckDB sources to de5283b5b9
1 parent b055b3f commit 9cf2102

4 files changed

Lines changed: 19 additions & 4 deletions

File tree

src/duckdb/src/catalog/catalog_search_path.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ void CatalogSearchPath::SetPathsInternal(vector<CatalogSearchEntry> new_paths) {
283283
this->set_paths = std::move(new_paths);
284284

285285
paths.clear();
286-
paths.reserve(set_paths.size() + 3);
286+
paths.reserve(set_paths.size() + 4);
287287
paths.emplace_back(TEMP_CATALOG, DEFAULT_SCHEMA);
288288
for (auto &path : set_paths) {
289289
paths.push_back(path);

src/duckdb/src/common/radix_partitioning.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ struct ComputePartitionIndicesFunctor {
9090
UnaryExecutor::Execute<hash_t, hash_t>(hashes, partition_indices, append_count,
9191
[&](hash_t hash) { return CONSTANTS::ApplyMask(hash); });
9292
} else {
93+
partition_indices.SetVectorType(VectorType::FLAT_VECTOR);
9394
// We could just slice the "hashes" vector and use the UnaryExecutor
9495
// But slicing a dictionary vector causes SelectionData to be allocated
9596
// Instead, we just directly compute the partition indices using the selection vectors
@@ -230,6 +231,7 @@ void RadixPartitionedTupleData::ComputePartitionIndices(Vector &row_locations, i
230231
utility_vector = make_uniq<Vector>(LogicalType::HASH);
231232
}
232233
Vector &intermediate = *utility_vector;
234+
intermediate.SetVectorType(VectorType::FLAT_VECTOR);
233235
partitions[0]->Gather(row_locations, *FlatVector::IncrementalSelectionVector(), count, hash_col_idx, intermediate,
234236
*FlatVector::IncrementalSelectionVector(), nullptr);
235237
RadixBitsSwitch<ComputePartitionIndicesFunctor, void>(radix_bits, intermediate, partition_indices, count,

src/duckdb/src/execution/radix_partitioned_hashtable.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,8 @@ void RadixPartitionedHashTable::Sink(ExecutionContext &context, DataChunk &chunk
561561

562562
void RadixPartitionedHashTable::Combine(ExecutionContext &context, GlobalSinkState &gstate_p,
563563
LocalSinkState &lstate_p) const {
564+
// There is some defensive programming in here to try to avoid spurious issues
565+
// See duckdblabs/duckdb-internal#6818 for more information
564566
auto &gstate = gstate_p.Cast<RadixHTGlobalSinkState>();
565567
auto &lstate = lstate_p.Cast<RadixHTLocalSinkState>();
566568
if (!lstate.ht) {
@@ -584,17 +586,28 @@ void RadixPartitionedHashTable::Combine(ExecutionContext &context, GlobalSinkSta
584586
}
585587

586588
auto guard = gstate.Lock();
589+
if (gstate.finalized) {
590+
throw InternalException("RadixPartitionedHashTable: Combine called after Finalize!");
591+
}
592+
587593
if (gstate.uncombined_data) {
588594
gstate.uncombined_data->Combine(*lstate.abandoned_data);
589595
} else {
590596
gstate.uncombined_data = std::move(lstate.abandoned_data);
591597
}
592598
gstate.stored_allocators.emplace_back(ht.GetAggregateAllocator());
593599
gstate.stored_allocators_size += gstate.stored_allocators.back()->AllocationSize();
600+
601+
// Eagerly destroy the HT
602+
lstate.ht.reset();
594603
}
595604

596605
void RadixPartitionedHashTable::Finalize(ClientContext &context, GlobalSinkState &gstate_p) const {
597606
auto &gstate = gstate_p.Cast<RadixHTGlobalSinkState>();
607+
auto guard = gstate.Lock();
608+
if (gstate.finalized) {
609+
throw InternalException("RadixPartitionedHashTable: Finalize called again!");
610+
}
598611

599612
if (gstate.uncombined_data) {
600613
auto &uncombined_data = *gstate.uncombined_data;

src/duckdb/src/function/table/version/pragma_version.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#ifndef DUCKDB_PATCH_VERSION
2-
#define DUCKDB_PATCH_VERSION "4-dev110"
2+
#define DUCKDB_PATCH_VERSION "4-dev116"
33
#endif
44
#ifndef DUCKDB_MINOR_VERSION
55
#define DUCKDB_MINOR_VERSION 4
@@ -8,10 +8,10 @@
88
#define DUCKDB_MAJOR_VERSION 1
99
#endif
1010
#ifndef DUCKDB_VERSION
11-
#define DUCKDB_VERSION "v1.4.4-dev110"
11+
#define DUCKDB_VERSION "v1.4.4-dev116"
1212
#endif
1313
#ifndef DUCKDB_SOURCE_ID
14-
#define DUCKDB_SOURCE_ID "0761d5cc7a"
14+
#define DUCKDB_SOURCE_ID "de5283b5b9"
1515
#endif
1616
#include "duckdb/function/table/system_functions.hpp"
1717
#include "duckdb/main/database.hpp"

0 commit comments

Comments
 (0)