Skip to content

Commit 97ece9c

Browse files
committed
feat: Add support for upcoming DuckDB 1.2
Changed function description generation. Indicates the aggregate functions use a legacy destructor. Changed GitHub action to build using main
1 parent 6735f3e commit 97ece9c

File tree

5 files changed

+527
-171
lines changed

5 files changed

+527
-171
lines changed

.github/workflows/MainDistributionPipeline.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@ concurrency:
1212
cancel-in-progress: true
1313

1414
jobs:
15-
# duckdb-next-build:
16-
# name: Build extension binaries
17-
# uses: duckdb/extension-ci-tools/.github/workflows/_extension_distribution.yml@main
18-
# with:
19-
# duckdb_version: main
20-
# ci_tools_version: main
21-
# extension_name: datasketches
22-
23-
duckdb-stable-build:
15+
duckdb-next-build:
2416
name: Build extension binaries
25-
uses: duckdb/extension-ci-tools/.github/workflows/_extension_distribution.yml@v1.1.3
17+
uses: duckdb/extension-ci-tools/.github/workflows/_extension_distribution.yml@main
2618
with:
27-
duckdb_version: v1.1.3
28-
ci_tools_version: v1.1.3
29-
extension_name: datasketches
19+
duckdb_version: main
20+
ci_tools_version: main
21+
extension_name: datasketches
22+
23+
# duckdb-stable-build:
24+
# name: Build extension binaries
25+
# uses: duckdb/extension-ci-tools/.github/workflows/_extension_distribution.yml@v1.1.3
26+
# with:
27+
# duckdb_version: v1.1.3
28+
# ci_tools_version: v1.1.3
29+
# extension_name: datasketches

codegen/generated.cpp.j2

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -616,13 +616,13 @@ static inline void DS{{sketch_type}}{{unary_function.name}}(DataChunk &args, Exp
616616
{% endif %}
617617
{
618618
{% if sketch_type == "HLL" %}
619-
return AggregateFunction::UnaryAggregateDestructor<DS{{sketch_type}}State, string_t, string_t, DSHLLMergeOperation<DS{{sketch_type}}BindData>>(
619+
return AggregateFunction::UnaryAggregateDestructor<DS{{sketch_type}}State, string_t, string_t, DSHLLMergeOperation<DS{{sketch_type}}BindData>, AggregateDestructorType::LEGACY>(
620620
result_type, result_type);
621621
{% elif sketch_type == "CPC" %}
622-
return AggregateFunction::UnaryAggregateDestructor<DS{{sketch_type}}State, string_t, string_t, DSCPCMergeOperation<DS{{sketch_type}}BindData>>(
622+
return AggregateFunction::UnaryAggregateDestructor<DS{{sketch_type}}State, string_t, string_t, DSCPCMergeOperation<DS{{sketch_type}}BindData>, AggregateDestructorType::LEGACY>(
623623
result_type, result_type);
624624
{% else %}
625-
return AggregateFunction::UnaryAggregateDestructor<DS{{sketch_type}}State<T>, string_t, string_t, DSQuantilesMergeOperation<DS{{sketch_type}}BindData>>(
625+
return AggregateFunction::UnaryAggregateDestructor<DS{{sketch_type}}State<T>, string_t, string_t, DSQuantilesMergeOperation<DS{{sketch_type}}BindData>, AggregateDestructorType::LEGACY>(
626626
result_type, result_type);
627627
{% endif %}
628628
}
@@ -633,13 +633,13 @@ static inline void DS{{sketch_type}}{{unary_function.name}}(DataChunk &args, Exp
633633
auto static DS{{sketch_type}}CreateAggregate(const LogicalType &type, const LogicalType &result_type) -> AggregateFunction
634634
{
635635
{% if sketch_type == 'HLL' %}
636-
return AggregateFunction::UnaryAggregateDestructor<DS{{sketch_type}}State, T, string_t, DSHLLCreateOperation<DS{{sketch_type}}BindData>>(
636+
return AggregateFunction::UnaryAggregateDestructor<DS{{sketch_type}}State, T, string_t, DSHLLCreateOperation<DS{{sketch_type}}BindData>, AggregateDestructorType::LEGACY>(
637637
type, result_type);
638638
{% elif sketch_type == 'CPC' %}
639-
return AggregateFunction::UnaryAggregateDestructor<DS{{sketch_type}}State, T, string_t, DSCPCCreateOperation<DS{{sketch_type}}BindData>>(
639+
return AggregateFunction::UnaryAggregateDestructor<DS{{sketch_type}}State, T, string_t, DSCPCCreateOperation<DS{{sketch_type}}BindData>, AggregateDestructorType::LEGACY>(
640640
type, result_type);
641641
{% else %}
642-
return AggregateFunction::UnaryAggregateDestructor<DS{{sketch_type}}State<T>, T, string_t, DSQuantilesCreateOperation<DS{{sketch_type}}BindData>>(
642+
return AggregateFunction::UnaryAggregateDestructor<DS{{sketch_type}}State<T>, T, string_t, DSQuantilesCreateOperation<DS{{sketch_type}}BindData>, AggregateDestructorType::LEGACY>(
643643
type, result_type);
644644
{% endif %}
645645
}
@@ -675,8 +675,13 @@ static inline void DS{{sketch_type}}{{unary_function.name}}(DataChunk &args, Exp
675675
{% endif %}
676676

677677
CreateScalarFunctionInfo info(std::move(fs));
678-
info.description = "{{unary_function.description}}";
679-
info.example = "{{unary_function.example}}";
678+
679+
{
680+
FunctionDescription desc;
681+
desc.description = "{{unary_function.description}}";
682+
desc.examples.push_back("{{unary_function.example}}");
683+
info.descriptions.push_back(desc);
684+
}
680685

681686
system_catalog.CreateFunction(data, info);
682687

@@ -713,8 +718,15 @@ static inline void DS{{sketch_type}}{{unary_function.name}}(DataChunk &args, Exp
713718
{% endif %}
714719
{%- endfor %}
715720
CreateAggregateFunctionInfo sketch_info(sketch);
716-
sketch_info.description = "Creates a sketch_{{sketch_type|lower}} data sketch by aggregating values or by aggregating other {{sketch_type}} data sketches";
717-
sketch_info.example = "datasketch_{{sketch_type|lower}}(k, data)";
721+
722+
723+
{
724+
FunctionDescription desc;
725+
desc.description = "Creates a sketch_{{sketch_type|lower}} data sketch by aggregating values or by aggregating other {{sketch_type}} data sketches";
726+
desc.examples.push_back("datasketch_{{sketch_type|lower}}(k, data)");
727+
sketch_info.descriptions.push_back(desc);
728+
}
729+
718730
system_catalog.CreateFunction(data, sketch_info);
719731
}
720732

@@ -728,8 +740,14 @@ static inline void DS{{sketch_type}}{{unary_function.name}}(DataChunk &args, Exp
728740
fun.arguments.insert(fun.arguments.begin(), {{cpp_type_mapping[sketch_k_cpp_type[sketch_type]]}});
729741
sketch.AddFunction(fun);
730742
CreateAggregateFunctionInfo sketch_info(sketch);
731-
sketch_info.description = "Creates a sketch_{{sketch_type}} data sketch by aggregating other {{sketch_type}} data sketches";
732-
sketch_info.comment = "datasketch_{{sketch_type|lower}}_union(k, data)";
743+
744+
{
745+
FunctionDescription desc;
746+
desc.description = "Creates a sketch_{{sketch_type}} data sketch by aggregating other {{sketch_type}} data sketches";
747+
desc.examples.push_back("datasketch_{{sketch_type|lower}}_union(k, data)");
748+
sketch_info.descriptions.push_back(desc);
749+
}
750+
733751
system_catalog.CreateFunction(data, sketch_info);
734752
}
735753
{% endif %}

duckdb

Submodule duckdb updated 2851 files

0 commit comments

Comments
 (0)