You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Adam Kramer (JIRA)" <ji...@apache.org> on 2009/11/17 12:12:39 UTC

[jira] Created: (HIVE-937) CONCAT UDF for GROUP BY

CONCAT UDF for GROUP BY
-----------------------

                 Key: HIVE-937
                 URL: https://issues.apache.org/jira/browse/HIVE-937
             Project: Hadoop Hive
          Issue Type: New Feature
            Reporter: Adam Kramer


It would be nice to have a UDF like CONCAT for GROUP BY.

For example,

SELECT user, CONCAT(post) AS posts
FROM tablename
GROUP BY user

...which would return all of the posts concatenated together, separated by a single whitespace. So if the table was like this:

user\tpost
1\tHi there this is my first post
1\tpost number two
2\tI'm a different user!

then the above code would return
user\tposts
1\tHi there this is my first post post number two
2\tI'm a different user!

Alternate form:
CONCAT(string text, string separator) which would put the separator between each block of text.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HIVE-937) CONCAT UDF for GROUP BY

Posted by "Namit Jain (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-937?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12778936#action_12778936 ] 

Namit Jain commented on HIVE-937:
---------------------------------

@Adam,

this is already supported, look at concat_ws which takes in a separator as the first argument.
Let us know if it does not suffice for you.

> CONCAT UDF for GROUP BY
> -----------------------
>
>                 Key: HIVE-937
>                 URL: https://issues.apache.org/jira/browse/HIVE-937
>             Project: Hadoop Hive
>          Issue Type: New Feature
>            Reporter: Adam Kramer
>
> It would be nice to have a UDF like CONCAT for GROUP BY.
> For example,
> SELECT user, CONCAT(post) AS posts
> FROM tablename
> GROUP BY user
> ...which would return all of the posts concatenated together, separated by a single whitespace. So if the table was like this:
> user\tpost
> 1\tHi there this is my first post
> 1\tpost number two
> 2\tI'm a different user!
> then the above code would return
> user\tposts
> 1\tHi there this is my first post post number two
> 2\tI'm a different user!
> Alternate form:
> CONCAT(string text, string separator) which would put the separator between each block of text.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HIVE-937) CONCAT UDF for GROUP BY

Posted by "Adam Kramer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-937?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12779059#action_12779059 ] 

Adam Kramer commented on HIVE-937:
----------------------------------

Hi Namit,

Where should I take a look at it? It is not documented at http://wiki.apache.org/hadoop/Hive/LanguageManual/UDF ...should I be looking somewhere else for functions? I tried it, though, and it seems to do what I want! Thanks.

> CONCAT UDF for GROUP BY
> -----------------------
>
>                 Key: HIVE-937
>                 URL: https://issues.apache.org/jira/browse/HIVE-937
>             Project: Hadoop Hive
>          Issue Type: New Feature
>            Reporter: Adam Kramer
>
> It would be nice to have a UDF like CONCAT for GROUP BY.
> For example,
> SELECT user, CONCAT(post) AS posts
> FROM tablename
> GROUP BY user
> ...which would return all of the posts concatenated together, separated by a single whitespace. So if the table was like this:
> user\tpost
> 1\tHi there this is my first post
> 1\tpost number two
> 2\tI'm a different user!
> then the above code would return
> user\tposts
> 1\tHi there this is my first post post number two
> 2\tI'm a different user!
> Alternate form:
> CONCAT(string text, string separator) which would put the separator between each block of text.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (HIVE-937) CONCAT UDF for GROUP BY

Posted by "Adam Kramer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HIVE-937?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Adam Kramer resolved HIVE-937.
------------------------------

    Resolution: Duplicate

> CONCAT UDF for GROUP BY
> -----------------------
>
>                 Key: HIVE-937
>                 URL: https://issues.apache.org/jira/browse/HIVE-937
>             Project: Hadoop Hive
>          Issue Type: New Feature
>            Reporter: Adam Kramer
>
> It would be nice to have a UDF like CONCAT for GROUP BY.
> For example,
> SELECT user, CONCAT(post) AS posts
> FROM tablename
> GROUP BY user
> ...which would return all of the posts concatenated together, separated by a single whitespace. So if the table was like this:
> user\tpost
> 1\tHi there this is my first post
> 1\tpost number two
> 2\tI'm a different user!
> then the above code would return
> user\tposts
> 1\tHi there this is my first post post number two
> 2\tI'm a different user!
> Alternate form:
> CONCAT(string text, string separator) which would put the separator between each block of text.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.