-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
[C++] Hash aggregate function that returns value from first row in group #29593
Comments
Antoine Pitrou / @pitrou: |
Weston Pace / @westonpace: Do we want to consider a name other than |
Dhruv Vats / @dhruv9vats: SELECT country, SUM(customerID) FROM db_table GROUP BY country from a supposed sales table So here instead sum of all tuples in a group, we just want to return a single tuple from the different groups/country? And, it seems which tuple (like either the first or a specific one) to return is yet to be finalised, right? Also is there a PR or an existing kernel that has a similar boilerplate code to what this will have? (That'll save a disproportionate time going through all the abstractions). |
David Li / @lidavidm: All hash_ kernels ("hash aggregate kernels") are in |
Ian Cook / @ianmcook: |
David Li / @lidavidm: |
David Li / @lidavidm: |
Ian Cook / @ianmcook: |
It would be nice to have a hash aggregate function that returns the first value of a column within each hash group.
If row order within groups is non-deterministic, then effectively this would return one arbitrary value. This is a very computationally cheap operation.
This can be quite useful when querying a non-normalized table. For example if you have a table with a
country
column and also acountry_abbr
column and you want to group by either/both of those columns but return the values from both columns, you could dobut it would be more efficient to do
because then the engine does not need to scan all the values of the
country_abbr
column.Reporter: Ian Cook / @ianmcook
Assignee: Dhruv Vats / @dhruv9vats
Related issues:
PRs and other links:
Note: This issue was originally created as ARROW-13993. Please see the migration documentation for further details.
The text was updated successfully, but these errors were encountered: