duckdb 0.8.2-dev3007.0 → 0.8.2-dev3055.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/duckdb/src/function/aggregate/sorted_aggregate_function.cpp +3 -2
- package/src/duckdb/src/function/table/version/pragma_version.cpp +2 -2
- package/src/duckdb/src/include/duckdb/main/extension_util.hpp +4 -0
- package/src/duckdb/src/main/extension/extension_util.cpp +16 -0
package/package.json
CHANGED
@@ -468,11 +468,12 @@ struct SortedAggregateFunction {
|
|
468
468
|
|
469
469
|
// These are all simple updates, so use it if available
|
470
470
|
if (simple_update) {
|
471
|
-
simple_update(sliced.data.data(), aggr_bind_info,
|
471
|
+
simple_update(sliced.data.data(), aggr_bind_info, sliced.data.size(), agg_state.data(),
|
472
|
+
sliced.size());
|
472
473
|
} else {
|
473
474
|
// We are only updating a constant state
|
474
475
|
agg_state_vec.SetVectorType(VectorType::CONSTANT_VECTOR);
|
475
|
-
update(sliced.data.data(), aggr_bind_info,
|
476
|
+
update(sliced.data.data(), aggr_bind_info, sliced.data.size(), agg_state_vec, sliced.size());
|
476
477
|
}
|
477
478
|
|
478
479
|
consumed += input_count;
|
@@ -1,8 +1,8 @@
|
|
1
1
|
#ifndef DUCKDB_VERSION
|
2
|
-
#define DUCKDB_VERSION "0.8.2-
|
2
|
+
#define DUCKDB_VERSION "0.8.2-dev3055"
|
3
3
|
#endif
|
4
4
|
#ifndef DUCKDB_SOURCE_ID
|
5
|
-
#define DUCKDB_SOURCE_ID "
|
5
|
+
#define DUCKDB_SOURCE_ID "b105af71bb"
|
6
6
|
#endif
|
7
7
|
#include "duckdb/function/table/system_functions.hpp"
|
8
8
|
#include "duckdb/main/database.hpp"
|
@@ -23,6 +23,10 @@ public:
|
|
23
23
|
DUCKDB_API static void RegisterFunction(DatabaseInstance &db, ScalarFunction function);
|
24
24
|
//! Register a new scalar function set - throw an exception if the function already exists
|
25
25
|
DUCKDB_API static void RegisterFunction(DatabaseInstance &db, ScalarFunctionSet function);
|
26
|
+
//! Register a new aggregate function - throw an exception if the function already exists
|
27
|
+
DUCKDB_API static void RegisterFunction(DatabaseInstance &db, AggregateFunction function);
|
28
|
+
//! Register a new aggregate function set - throw an exception if the function already exists
|
29
|
+
DUCKDB_API static void RegisterFunction(DatabaseInstance &db, AggregateFunctionSet function);
|
26
30
|
//! Register a new table function - throw an exception if the function already exists
|
27
31
|
DUCKDB_API static void RegisterFunction(DatabaseInstance &db, TableFunction function);
|
28
32
|
//! Register a new table function set - throw an exception if the function already exists
|
@@ -1,5 +1,6 @@
|
|
1
1
|
#include "duckdb/main/extension_util.hpp"
|
2
2
|
#include "duckdb/function/scalar_function.hpp"
|
3
|
+
#include "duckdb/parser/parsed_data/create_aggregate_function_info.hpp"
|
3
4
|
#include "duckdb/parser/parsed_data/create_type_info.hpp"
|
4
5
|
#include "duckdb/parser/parsed_data/create_copy_function_info.hpp"
|
5
6
|
#include "duckdb/parser/parsed_data/create_pragma_function_info.hpp"
|
@@ -26,6 +27,21 @@ void ExtensionUtil::RegisterFunction(DatabaseInstance &db, ScalarFunction functi
|
|
26
27
|
RegisterFunction(db, std::move(set));
|
27
28
|
}
|
28
29
|
|
30
|
+
void ExtensionUtil::RegisterFunction(DatabaseInstance &db, AggregateFunction function) {
|
31
|
+
D_ASSERT(!function.name.empty());
|
32
|
+
AggregateFunctionSet set(function.name);
|
33
|
+
set.AddFunction(std::move(function));
|
34
|
+
RegisterFunction(db, std::move(set));
|
35
|
+
}
|
36
|
+
|
37
|
+
void ExtensionUtil::RegisterFunction(DatabaseInstance &db, AggregateFunctionSet set) {
|
38
|
+
D_ASSERT(!set.name.empty());
|
39
|
+
CreateAggregateFunctionInfo info(std::move(set));
|
40
|
+
auto &system_catalog = Catalog::GetSystemCatalog(db);
|
41
|
+
auto data = CatalogTransaction::GetSystemTransaction(db);
|
42
|
+
system_catalog.CreateFunction(data, info);
|
43
|
+
}
|
44
|
+
|
29
45
|
void ExtensionUtil::RegisterFunction(DatabaseInstance &db, TableFunction function) {
|
30
46
|
D_ASSERT(!function.name.empty());
|
31
47
|
TableFunctionSet set(function.name);
|