<?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 Spark Scala - Remove rows that have columns with same value in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-Scala-Remove-rows-that-have-columns-with-same-value/m-p/137035#M39779</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I've this data in a textfile:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;How can I using Spark and programming Scala can identify the rows that have the number repetead in same row? And how can I delete it? In this case I want to remove the third row...&lt;/P&gt;&lt;P&gt;Mnay thanks!&lt;/P&gt;</description>
    <pubDate>Tue, 06 Sep 2016 15:49:41 GMT</pubDate>
    <dc:creator>Stewart12586</dc:creator>
    <dc:date>2016-09-06T15:49:41Z</dc:date>
    <item>
      <title>Spark Scala - Remove rows that have columns with same value</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-Scala-Remove-rows-that-have-columns-with-same-value/m-p/137035#M39779</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I've this data in a textfile:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;How can I using Spark and programming Scala can identify the rows that have the number repetead in same row? And how can I delete it? In this case I want to remove the third row...&lt;/P&gt;&lt;P&gt;Mnay thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2016 15:49:41 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-Scala-Remove-rows-that-have-columns-with-same-value/m-p/137035#M39779</guid>
      <dc:creator>Stewart12586</dc:creator>
      <dc:date>2016-09-06T15:49:41Z</dc:date>
    </item>
    <item>
      <title>Re: Spark Scala - Remove rows that have columns with same value</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-Scala-Remove-rows-that-have-columns-with-same-value/m-p/137036#M39780</link>
      <description>&lt;PRE&gt;scala&amp;gt; val a = sc.textFile("/user/.../path/to/your/file").map(x =&amp;gt; x.split("\t")).filter(x =&amp;gt; x(0) != x(1))
scala&amp;gt; a.take(4)
res2: Array[Array[String]] = Array(Array(1, 4), Array(2, 5), Array(1, 5))
&lt;/PRE&gt;&lt;P&gt;Try the snippet above, just insert the path to your file on hdfs.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2016 16:46:50 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Spark-Scala-Remove-rows-that-have-columns-with-same-value/m-p/137036#M39780</guid>
      <dc:creator>pminovic</dc:creator>
      <dc:date>2016-09-06T16:46:50Z</dc:date>
    </item>
  </channel>
</rss>

