Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

colexec: support all aggregate functions #43561

Open
3 of 14 tasks
yuzefovich opened this issue Dec 26, 2019 · 1 comment
Open
3 of 14 tasks

colexec: support all aggregate functions #43561

yuzefovich opened this issue Dec 26, 2019 · 1 comment
Labels
C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) meta-issue Contains a list of several other issues. T-sql-queries SQL Queries Team

Comments

@yuzefovich
Copy link
Member

yuzefovich commented Dec 26, 2019

The following aggregate functions are unsupported in the vectorized engine:

Note that for some functions we first will need to add the support for the types (tracked in #42043).

Jira issue: CRDB-5276

@yuzefovich yuzefovich added C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) meta-issue Contains a list of several other issues. labels Dec 26, 2019
craig bot pushed a commit that referenced this issue Jul 12, 2020
51148: colexec: implement function concat_agg for vectorized engine r=yuzefovich a=yongyanglai

This PR contains implementation of vectorized aggregate function "concat_agg".
Related: #43561

Release note (sql change): vectorized engine now support aggregate function "concat_agg"

Co-authored-by: Yongyang Lai <[email protected]>
craig bot pushed a commit that referenced this issue Aug 12, 2020
52174: colexec: add default aggregate function r=yuzefovich a=yuzefovich

Depends on #51337.
Depends on #52315.

**colexec: add default aggregate function**

This commit introduces "default" aggregate function which is an adapter
from `tree.AggregateFunc` to `colexec.aggregateFunc`. It works as
follows:
- the aggregator (either hash or ordered) is responsible for converting
all necessary vectors to `tree.Datum` columns before calling `Compute`
(this allows us to share the conversion between multiple functions if
they happened to take in the same columns and between multiple groups in
case of the hash aggregator)
- the default aggregate function populates "arguments" to be passed into
the wrapped `tree.AggregateFunc` and adds them
- when the new group is encountered, the result so far is flushed and
the wrapped `tree.AggregateFunc` is reset.

One detail is that these wrapped `tree.AggregateFunc`s need to be
closed, and currently that responsibility lies with the alloc object
that is creating them. In the future, we might want to shift the
responsibility to the aggregators.

Addresses: #43561.

Release note: None

**colexec: clean up hash aggregate functions**

Hash aggregate function always have non-nil `sel`, and this commit
removes the code generation for nil `sel` case (meaning it removes the
dead code). It also templates out nulls vs no-nulls cases in `bool_and`
and `bool_or` aggregates.

Release note: None

Co-authored-by: Yahor Yuzefovich <[email protected]>
@jlinder jlinder added the T-sql-queries SQL Queries Team label Jun 16, 2021
@github-actions
Copy link

We have marked this issue as stale because it has been inactive for
18 months. If this issue is still relevant, removing the stale label
or adding a comment will keep it active. Otherwise, we'll close it in
10 days to keep the issue queue tidy. Thank you for your contribution
to CockroachDB!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) meta-issue Contains a list of several other issues. T-sql-queries SQL Queries Team
Projects
Status: Backlog
Development

No branches or pull requests

2 participants