Skip to content

Aggregates: accumulate columnar#6839

Merged
gatesn merged 2 commits intodevelopfrom
ngates/aggregate-constant
Mar 9, 2026
Merged

Aggregates: accumulate columnar#6839
gatesn merged 2 commits intodevelopfrom
ngates/aggregate-constant

Conversation

@gatesn
Copy link
Contributor

@gatesn gatesn commented Mar 7, 2026

Changes the AggregateFnVTable::accumulate to take columnar instead of canonical. Might as well make the function define the optimized path over constants the same way we do for scalar functions.

Copy link
Contributor Author

gatesn commented Mar 7, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@gatesn gatesn changed the title Change API to accept Columnar Aggregates: accumulate columnar Mar 7, 2026
@gatesn gatesn added the changelog/chore A trivial change label Mar 7, 2026 — with Graphite App
@gatesn gatesn removed the changelog/chore A trivial change label Mar 7, 2026
@gatesn gatesn added the changelog/feature A new feature label Mar 7, 2026 — with Graphite App
@gatesn gatesn marked this pull request as ready for review March 7, 2026 02:06
@codspeed-hq
Copy link

codspeed-hq bot commented Mar 7, 2026

Merging this PR will not alter performance

✅ 1000 untouched benchmarks
⏩ 1466 skipped benchmarks1


Comparing ngates/aggregate-constant (13d889e) with develop (0e50f08)

Open in CodSpeed

Footnotes

  1. 1466 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@gatesn gatesn force-pushed the ngates/aggregate-constant branch from 7d210b8 to 68eabe7 Compare March 7, 2026 02:16
@gatesn gatesn requested a review from robert3005 March 7, 2026 02:18
@gatesn gatesn changed the base branch from ngates/aggregate-pushdown to graphite-base/6839 March 9, 2026 01:43
Signed-off-by: Nicholas Gates <nick@nickgates.com>
@gatesn gatesn force-pushed the graphite-base/6839 branch from 6f1e7a3 to 0e50f08 Compare March 9, 2026 01:44
@gatesn gatesn force-pushed the ngates/aggregate-constant branch from 331c227 to f8f016d Compare March 9, 2026 01:44
@graphite-app graphite-app bot changed the base branch from graphite-base/6839 to develop March 9, 2026 01:45
Signed-off-by: Nicholas Gates <nick@nickgates.com>
@gatesn gatesn force-pushed the ngates/aggregate-constant branch from f8f016d to 13d889e Compare March 9, 2026 01:45
@joseph-isaacs
Copy link
Contributor

The reason we have columnar for scalar fns is for constant folding/reduction, do we have a similar thing here?

@gatesn
Copy link
Contributor Author

gatesn commented Mar 9, 2026

It just forces the aggregate function to also define its operation over scalars. Instead of requiring everyone to register an additional kernel for ConstantArray.

Same as for ScalarFn, it just makes it harder to do the wrong thing.

@joseph-isaacs
Copy link
Contributor

My preference is for another kernel

/// Accumulate a constant array into the sum state.
/// Computes `scalar * len` and adds to the accumulator.
/// Returns Ok(true) if saturated (overflow), Ok(false) if not.
fn accumulate_constant(inner: &mut SumState, c: &ConstantArray) -> VortexResult<bool> {
Copy link
Contributor

Choose a reason for hiding this comment

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

This really can just be a kernel

Copy link
Contributor

@joseph-isaacs joseph-isaacs left a comment

Choose a reason for hiding this comment

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

I would do this as a kernel to reduce the complexity of implementing a new aggregation!

@gatesn gatesn merged commit 000e896 into develop Mar 9, 2026
92 of 94 checks passed
Copy link
Contributor Author

gatesn commented Mar 9, 2026

Merge activity

@gatesn gatesn deleted the ngates/aggregate-constant branch March 9, 2026 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/feature A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants