This repository was archived by the owner on May 12, 2021. It is now read-only.
TAJO-2160: Implement string_agg function.#1029
Closed
combineads wants to merge 1 commit intoapache:masterfrom
Closed
TAJO-2160: Implement string_agg function.#1029combineads wants to merge 1 commit intoapache:masterfrom
combineads wants to merge 1 commit intoapache:masterfrom
Conversation
| } | ||
|
|
||
| message StringAggProto { | ||
| required string value = 1; |
Member
There was a problem hiding this comment.
IMO, this proto is unnecessary define. the StringAgg is only to aggregate a value.
What do you think about that?
Member
There was a problem hiding this comment.
Oops. I’m wrong. delimiter should send to context for merge phase.
Contributor
Author
There was a problem hiding this comment.
It needs to keep the second parameter, delimiter, in the merge method of StringAgg when the second stages execute to merge the result of fisrt stage of StringAgg.
Contributor
|
This patch looks good to me. @jinossy do you have more comments? |
Member
|
@jihoonson |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I'll implement to concatenate the strings of a field within a group by query.
I have a table:
ID COMPANY_ID EMPLOYEE
1 1 Anna
2 1 Bill
3 2 Carol
4 2 Dave
and I wanted to group by company_id to get something like:
SELECT company_id, string_agg(employee, ', ')
FROM mytable
GROUP BY company_id;
COMPANY_ID EMPLOYEE
1 Anna, Bill
2 Carol, Dave
PostgreSQL supports string_agg function.
http://www.postgresql.org/docs/current/static/functions-aggregate.html#FUNCTIONS-AGGREGATE-TABLE
Thank you.