Skip to content

Commit 9785b5d

Browse files
authored
Merge pull request #90 from duckdb/upgrade-111
bump to 1.1.1
2 parents 8765850 + 59c33cc commit 9785b5d

File tree

13 files changed

+76
-25
lines changed

13 files changed

+76
-25
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/duckdb/src/common/extra_type_info.cpp

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include "duckdb/common/extra_type_info.hpp"
2-
#include "duckdb/common/extra_type_info/enum_type_info.hpp"
32
#include "duckdb/common/serializer/deserializer.hpp"
43
#include "duckdb/common/enum_util.hpp"
54
#include "duckdb/common/numeric_utils.hpp"
@@ -221,6 +220,50 @@ PhysicalType EnumTypeInfo::DictType(idx_t size) {
221220
}
222221
}
223222

223+
template <class T>
224+
struct EnumTypeInfoTemplated : public EnumTypeInfo {
225+
explicit EnumTypeInfoTemplated(Vector &values_insert_order_p, idx_t size_p)
226+
: EnumTypeInfo(values_insert_order_p, size_p) {
227+
D_ASSERT(values_insert_order_p.GetType().InternalType() == PhysicalType::VARCHAR);
228+
229+
UnifiedVectorFormat vdata;
230+
values_insert_order.ToUnifiedFormat(size_p, vdata);
231+
232+
auto data = UnifiedVectorFormat::GetData<string_t>(vdata);
233+
for (idx_t i = 0; i < size_p; i++) {
234+
auto idx = vdata.sel->get_index(i);
235+
if (!vdata.validity.RowIsValid(idx)) {
236+
throw InternalException("Attempted to create ENUM type with NULL value");
237+
}
238+
if (values.count(data[idx]) > 0) {
239+
throw InvalidInputException("Attempted to create ENUM type with duplicate value %s",
240+
data[idx].GetString());
241+
}
242+
values[data[idx]] = UnsafeNumericCast<T>(i);
243+
}
244+
}
245+
246+
static shared_ptr<EnumTypeInfoTemplated> Deserialize(Deserializer &deserializer, uint32_t size) {
247+
Vector values_insert_order(LogicalType::VARCHAR, size);
248+
auto strings = FlatVector::GetData<string_t>(values_insert_order);
249+
250+
deserializer.ReadList(201, "values", [&](Deserializer::List &list, idx_t i) {
251+
strings[i] = StringVector::AddStringOrBlob(values_insert_order, list.ReadElement<string>());
252+
});
253+
return make_shared_ptr<EnumTypeInfoTemplated>(values_insert_order, size);
254+
}
255+
256+
const string_map_t<T> &GetValues() const {
257+
return values;
258+
}
259+
260+
EnumTypeInfoTemplated(const EnumTypeInfoTemplated &) = delete;
261+
EnumTypeInfoTemplated &operator=(const EnumTypeInfoTemplated &) = delete;
262+
263+
private:
264+
string_map_t<T> values;
265+
};
266+
224267
EnumTypeInfo::EnumTypeInfo(Vector &values_insert_order_p, idx_t dict_size_p)
225268
: ExtraTypeInfo(ExtraTypeInfoType::ENUM_TYPE_INFO), values_insert_order(values_insert_order_p),
226269
dict_type(EnumDictType::VECTOR_DICT), dict_size(dict_size_p) {

src/duckdb/src/core_functions/function_list.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ static const StaticFunctionDefinition internal_functions[] = {
5252
DUCKDB_SCALAR_FUNCTION_SET(BitwiseAndFun),
5353
DUCKDB_SCALAR_FUNCTION_ALIAS(ListHasAnyFunAlias),
5454
DUCKDB_SCALAR_FUNCTION(PowOperatorFun),
55+
DUCKDB_SCALAR_FUNCTION_SET_ALIAS(ListNegativeInnerProductFunAlias),
5556
DUCKDB_SCALAR_FUNCTION_SET_ALIAS(ListDistanceFunAlias),
5657
DUCKDB_SCALAR_FUNCTION_SET(LeftShiftFun),
5758
DUCKDB_SCALAR_FUNCTION_SET_ALIAS(ListCosineDistanceFunAlias),

src/duckdb/src/execution/physical_plan/plan_comparison_join.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ void CheckForPerfectJoinOpt(LogicalComparisonJoin &op, PerfectHashJoinStats &joi
117117
if (join_state.build_range > MAX_BUILD_SIZE) {
118118
return;
119119
}
120+
if (NumericStats::Min(stats_build) <= NumericStats::Min(stats_probe) &&
121+
NumericStats::Max(stats_probe) <= NumericStats::Max(stats_build)) {
122+
join_state.is_probe_in_domain = true;
123+
}
120124
join_state.is_build_small = true;
121125
return;
122126
}

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 "2-dev27"
2+
#define DUCKDB_PATCH_VERSION "1"
33
#endif
44
#ifndef DUCKDB_MINOR_VERSION
55
#define DUCKDB_MINOR_VERSION 1
@@ -8,10 +8,10 @@
88
#define DUCKDB_MAJOR_VERSION 1
99
#endif
1010
#ifndef DUCKDB_VERSION
11-
#define DUCKDB_VERSION "v1.1.2-dev27"
11+
#define DUCKDB_VERSION "v1.1.1"
1212
#endif
1313
#ifndef DUCKDB_SOURCE_ID
14-
#define DUCKDB_SOURCE_ID "12e9777cf6"
14+
#define DUCKDB_SOURCE_ID "af39bd0dcf"
1515
#endif
1616
#include "duckdb/function/table/system_functions.hpp"
1717
#include "duckdb/main/database.hpp"

src/duckdb/src/include/duckdb/common/bitpacking.hpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,16 @@ class BitpackingPrimitives {
4141
}
4242
} else {
4343
idx_t misaligned_count = count % BITPACKING_ALGORITHM_GROUP_SIZE;
44+
T tmp_buffer[BITPACKING_ALGORITHM_GROUP_SIZE]; // TODO maybe faster on the heap?
45+
4446
count -= misaligned_count;
47+
4548
for (idx_t i = 0; i < count; i += BITPACKING_ALGORITHM_GROUP_SIZE) {
4649
PackGroup<T>(dst + (i * width) / 8, src + i, width);
4750
}
4851

49-
// The input is not aligned to BITPACKING_ALGORITHM_GROUP_SIZE.
50-
// Copy the unaligned count into a zero-initialized temporary group, and pack it.
52+
// Input was not aligned to BITPACKING_ALGORITHM_GROUP_SIZE, we need a copy
5153
if (misaligned_count) {
52-
T tmp_buffer[BITPACKING_ALGORITHM_GROUP_SIZE] = {0};
5354
memcpy(tmp_buffer, src + count, misaligned_count * sizeof(T));
5455
PackGroup<T>(dst + (count * width) / 8, tmp_buffer, width);
5556
}

src/duckdb/src/include/duckdb/core_functions/scalar/list_functions.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,12 @@ struct ListNegativeDotProductFun {
330330
static constexpr const char *Name = "list_negative_dot_product";
331331
};
332332

333+
struct ListNegativeInnerProductFunAlias {
334+
using ALIAS = ListNegativeInnerProductFun;
335+
336+
static constexpr const char *Name = "<#>";
337+
};
338+
333339
struct UnpivotListFun {
334340
static constexpr const char *Name = "unpivot_list";
335341
static constexpr const char *Parameters = "any,...";

src/duckdb/src/include/duckdb/execution/operator/join/perfect_hash_join_executor.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ struct PerfectHashJoinStats {
2626
Value probe_max;
2727
bool is_build_small = false;
2828
bool is_build_dense = false;
29+
bool is_probe_in_domain = false;
2930
idx_t build_range = 0;
3031
idx_t estimated_cardinality = 0;
3132
};

src/duckdb/src/include/duckdb/storage/table/segment_tree.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ class SegmentTree {
145145
}
146146
SegmentNode<T> node;
147147
segment->index = nodes.size();
148-
segment->next = nullptr;
149148
node.row_start = segment->start;
150149
node.node = std::move(segment);
151150
nodes.push_back(std::move(node));

src/duckdb/src/planner/table_filter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ DynamicTableFilterSet::GetFinalTableFilters(const PhysicalTableScan &scan,
5757
auto result = make_uniq<TableFilterSet>();
5858
if (existing_filters) {
5959
for (auto &entry : existing_filters->filters) {
60-
result->PushFilter(entry.first, entry.second->Copy());
60+
result->filters[entry.first] = entry.second->Copy();
6161
}
6262
}
6363
for (auto &entry : filters) {
@@ -66,7 +66,7 @@ DynamicTableFilterSet::GetFinalTableFilters(const PhysicalTableScan &scan,
6666
// skip row id filters
6767
continue;
6868
}
69-
result->PushFilter(filter.first, filter.second->Copy());
69+
result->filters[filter.first] = filter.second->Copy();
7070
}
7171
}
7272
if (result->filters.empty()) {

0 commit comments

Comments
 (0)