<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Hive-  Convert all values for a column to a comma separated string. in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Hive-Convert-all-values-for-a-column-to-a-comma-separated/m-p/233204#M195032</link>
    <description>&lt;P&gt;You can use the collect_set  UDAF function in hive.&lt;/P&gt;&lt;PRE&gt;select name, collect_set(city) from people group by name;&lt;/PRE&gt;&lt;P&gt;collect_Set will remove all duplicates.&lt;/P&gt;&lt;P&gt;If you need the duplicates then you must use "collect_list".&lt;/P&gt;&lt;P&gt;&lt;A href="https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF#LanguageManualUDF-Built-inAggregateFunctions%28UDAF%29"&gt;Read here for official documentation and details.&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 25 Aug 2017 03:38:44 GMT</pubDate>
    <dc:creator>dineshc</dc:creator>
    <dc:date>2017-08-25T03:38:44Z</dc:date>
    <item>
      <title>Hive-  Convert all values for a column to a comma separated string.</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hive-Convert-all-values-for-a-column-to-a-comma-separated/m-p/233203#M195031</link>
      <description>&lt;PRE&gt;Select name, city from people;&lt;/PRE&gt;&lt;P&gt;The above query results:&lt;/P&gt;&lt;P&gt;jon           Atlanta&lt;/P&gt;&lt;P&gt;jon           Newyork&lt;/P&gt;&lt;P&gt;snow        LA&lt;/P&gt;&lt;P&gt;snow        DC&lt;/P&gt;&lt;P&gt;But i want the result as a single row as follows:&lt;/P&gt;&lt;P&gt;jon                Atlanta,Newyork&lt;/P&gt;&lt;P&gt;snow            LA,DC&lt;/P&gt;</description>
      <pubDate>Fri, 25 Aug 2017 03:28:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hive-Convert-all-values-for-a-column-to-a-comma-separated/m-p/233203#M195031</guid>
      <dc:creator>rmy1712</dc:creator>
      <dc:date>2017-08-25T03:28:30Z</dc:date>
    </item>
    <item>
      <title>Re: Hive-  Convert all values for a column to a comma separated string.</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hive-Convert-all-values-for-a-column-to-a-comma-separated/m-p/233204#M195032</link>
      <description>&lt;P&gt;You can use the collect_set  UDAF function in hive.&lt;/P&gt;&lt;PRE&gt;select name, collect_set(city) from people group by name;&lt;/PRE&gt;&lt;P&gt;collect_Set will remove all duplicates.&lt;/P&gt;&lt;P&gt;If you need the duplicates then you must use "collect_list".&lt;/P&gt;&lt;P&gt;&lt;A href="https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF#LanguageManualUDF-Built-inAggregateFunctions%28UDAF%29"&gt;Read here for official documentation and details.&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Aug 2017 03:38:44 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hive-Convert-all-values-for-a-column-to-a-comma-separated/m-p/233204#M195032</guid>
      <dc:creator>dineshc</dc:creator>
      <dc:date>2017-08-25T03:38:44Z</dc:date>
    </item>
    <item>
      <title>Re: Hive-  Convert all values for a column to a comma separated string.</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Hive-Convert-all-values-for-a-column-to-a-comma-separated/m-p/233205#M195033</link>
      <description>&lt;P&gt;Thank you..!! &lt;/P&gt;&lt;P&gt;It worked.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Aug 2017 05:12:19 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Hive-Convert-all-values-for-a-column-to-a-comma-separated/m-p/233205#M195033</guid>
      <dc:creator>rmy1712</dc:creator>
      <dc:date>2017-08-25T05:12:19Z</dc:date>
    </item>
  </channel>
</rss>

