Skip to content

sdk: C++-ify aggregate funcs#435

Merged
malone-at-work merged 1 commit intomainfrom
maloney/issue-430/1
May 6, 2026
Merged

sdk: C++-ify aggregate funcs#435
malone-at-work merged 1 commit intomainfrom
maloney/issue-430/1

Conversation

@malone-at-work
Copy link
Copy Markdown
Member

@malone-at-work malone-at-work commented May 6, 2026

This introduces make_aggregate_func<> builder to create aggregate functions using C++ native types.

The old code is not yet removed, until we clean up vsql-cube.

@malone-at-work malone-at-work force-pushed the maloney/issue-430/1 branch from 29430c2 to 0f3be62 Compare May 6, 2026 10:38
using DeducedState =
std::remove_reference_t<std::tuple_element_t<0, Params>>;
static_assert(std::is_same_v<DeducedState, State>,
"clear: first parameter must be State& matching the "
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Params[0] is known to be a reference here only because of the templating of is_agg_result_for_state, correct?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes - that type checking was already done in make_aggregate_func. If we pulled more (e.g. add and clear) up into the the make... builder into the make signature, we would get better type checking. But this was the minimal change for now.

}

// make_func<&impl>("name")
// TODO(villagesql-beta): remove the vef_vdf_func_t exception below once all
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might want to open an issue to track the cleanup of these new todos.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I consider them covered by issue #430. Should we consider allowing TODO(villagesql-#issue_number)?

@malone-at-work malone-at-work merged commit f14a0a6 into main May 6, 2026
3 checks passed
@malone-at-work malone-at-work deleted the maloney/issue-430/1 branch May 6, 2026 13:59
@github-actions github-actions Bot locked and limited conversation to collaborators May 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants