Skip to content

Commit 832bbb4

Browse files
chore: Update vendored sources to duckdb/duckdb@9cba6a2 (#578)
Add serialization for bitstring_agg function (duckdb/duckdb#14654) Co-authored-by: krlmlr <[email protected]>
1 parent 6e31df0 commit 832bbb4

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed

src/duckdb/src/core_functions/aggregate/distributive/bitstring_agg.cpp

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
#include "duckdb/execution/expression_executor.hpp"
99
#include "duckdb/common/types/cast_helpers.hpp"
1010
#include "duckdb/common/operator/subtract.hpp"
11+
#include "duckdb/common/serializer/deserializer.hpp"
12+
#include "duckdb/common/serializer/serializer.hpp"
1113

1214
namespace duckdb {
1315

@@ -43,6 +45,21 @@ struct BitstringAggBindData : public FunctionData {
4345
}
4446
return false;
4547
}
48+
49+
static void Serialize(Serializer &serializer, const optional_ptr<FunctionData> bind_data_p,
50+
const AggregateFunction &) {
51+
auto &bind_data = bind_data_p->Cast<BitstringAggBindData>();
52+
serializer.WriteProperty(100, "min", bind_data.min);
53+
serializer.WriteProperty(101, "max", bind_data.max);
54+
}
55+
56+
static unique_ptr<FunctionData> Deserialize(Deserializer &deserializer, AggregateFunction &) {
57+
Value min;
58+
Value max;
59+
deserializer.ReadProperty(100, "min", min);
60+
deserializer.ReadProperty(101, "max", max);
61+
return make_uniq<BitstringAggBindData>(min, max);
62+
}
4663
};
4764

4865
struct BitStringAggOperation {
@@ -247,7 +264,9 @@ static void BindBitString(AggregateFunctionSet &bitstring_agg, const LogicalType
247264
auto function =
248265
AggregateFunction::UnaryAggregateDestructor<BitAggState<TYPE>, TYPE, string_t, BitStringAggOperation>(
249266
type, LogicalType::BIT);
250-
function.bind = BindBitstringAgg; // create new a 'BitstringAggBindData'
267+
function.bind = BindBitstringAgg; // create new a 'BitstringAggBindData'
268+
function.serialize = BitstringAggBindData::Serialize;
269+
function.deserialize = BitstringAggBindData::Deserialize;
251270
function.statistics = BitstringPropagateStats; // stores min and max from column stats in BitstringAggBindData
252271
bitstring_agg.AddFunction(function); // uses the BitstringAggBindData to access statistics for creating bitstring
253272
function.arguments = {type, type, type};

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 "3-dev154"
2+
#define DUCKDB_PATCH_VERSION "3-dev156"
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.3-dev154"
11+
#define DUCKDB_VERSION "v1.1.3-dev156"
1212
#endif
1313
#ifndef DUCKDB_SOURCE_ID
14-
#define DUCKDB_SOURCE_ID "c6c08d4c1b"
14+
#define DUCKDB_SOURCE_ID "9cba6a2a03"
1515
#endif
1616
#include "duckdb/function/table/system_functions.hpp"
1717
#include "duckdb/main/database.hpp"

0 commit comments

Comments
 (0)