<?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 reduceByKey(_ ++ _) in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/reduceByKey/m-p/43630#M37126</link>
    <description>&lt;P&gt;rdd.map(kv =&amp;gt; (kv._1, new Set[String]() + kv._2)) .reduceByKey(_ ++ _)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the above code, what is (kv._1, new Set[String]() + kv._2)) and reduceByKey(_ ++ _).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know reduceByKey(_+_), but not (_++_).. Please let me know if someone knows this..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Mon, 08 Aug 2016 02:25:32 GMT</pubDate>
    <dc:creator>jee1</dc:creator>
    <dc:date>2016-08-08T02:25:32Z</dc:date>
    <item>
      <title>reduceByKey(_ ++ _)</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/reduceByKey/m-p/43630#M37126</link>
      <description>&lt;P&gt;rdd.map(kv =&amp;gt; (kv._1, new Set[String]() + kv._2)) .reduceByKey(_ ++ _)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the above code, what is (kv._1, new Set[String]() + kv._2)) and reduceByKey(_ ++ _).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know reduceByKey(_+_), but not (_++_).. Please let me know if someone knows this..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2016 02:25:32 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/reduceByKey/m-p/43630#M37126</guid>
      <dc:creator>jee1</dc:creator>
      <dc:date>2016-08-08T02:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: reduceByKey(_ ++ _)</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/reduceByKey/m-p/43633#M37127</link>
      <description>&lt;P&gt;The first operation makes each value into a set containing that single value. ++ just adds collections together, combining elements of both sets. This is trying to build up a set of all values for each key. It can be written more simply as "groupByKey" really. Even this code could be more compact and efficient.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2016 05:02:33 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/reduceByKey/m-p/43633#M37127</guid>
      <dc:creator>srowen</dc:creator>
      <dc:date>2016-08-08T05:02:33Z</dc:date>
    </item>
  </channel>
</rss>

