Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      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.

        Activity

        Hide
        Namit Jain added a comment -

        @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.

        Show
        Namit Jain added a comment - @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.
        Hide
        Adam Kramer added a comment -

        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.

        Show
        Adam Kramer added a comment - 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.

          People

          • Assignee:
            Unassigned
            Reporter:
            Adam Kramer
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development