<?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: Scala Flatten multi valued column into rows in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Scala-Flatten-multi-valued-column-into-rows/m-p/194818#M65562</link>
    <description>&lt;P&gt;this is the code i came up with, is there a better approach?&lt;/P&gt;&lt;PRE&gt;val ds = filteredDF.as[(Integer, String, String, String, String, Double, Integer)]
var df = ds.flatMap { 
  case (x1, x2, x3, x4, x5, x6, x7) =&amp;gt; x3.split(",").map((x1, x2, _, x4, x5, x6, x7))
}.toDF
&lt;/PRE&gt;</description>
    <pubDate>Thu, 27 Jul 2017 04:57:57 GMT</pubDate>
    <dc:creator>afdebbas</dc:creator>
    <dc:date>2017-07-27T04:57:57Z</dc:date>
    <item>
      <title>Scala Flatten multi valued column into rows</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Scala-Flatten-multi-valued-column-into-rows/m-p/194817#M65561</link>
      <description>&lt;P&gt;I am working with scala and i have a dataframe with one of its columns containing several values delimited by a comma. How can i turn these rows&lt;/P&gt;&lt;P&gt;["1", "x,y,z,", "A"]&lt;/P&gt;&lt;P&gt;["2", "x,y", "B"]&lt;/P&gt;&lt;P&gt;into&lt;/P&gt;&lt;P&gt;["1", "x,", "A"]&lt;/P&gt;&lt;P&gt;["1", "y,", "A"]&lt;/P&gt;&lt;P&gt;["1", "z", "A"]&lt;/P&gt;&lt;P&gt;["2", "x", "B"]&lt;/P&gt;&lt;P&gt;["2", "y", "B"]&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2017 01:33:07 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Scala-Flatten-multi-valued-column-into-rows/m-p/194817#M65561</guid>
      <dc:creator>afdebbas</dc:creator>
      <dc:date>2017-07-27T01:33:07Z</dc:date>
    </item>
    <item>
      <title>Re: Scala Flatten multi valued column into rows</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Scala-Flatten-multi-valued-column-into-rows/m-p/194818#M65562</link>
      <description>&lt;P&gt;this is the code i came up with, is there a better approach?&lt;/P&gt;&lt;PRE&gt;val ds = filteredDF.as[(Integer, String, String, String, String, Double, Integer)]
var df = ds.flatMap { 
  case (x1, x2, x3, x4, x5, x6, x7) =&amp;gt; x3.split(",").map((x1, x2, _, x4, x5, x6, x7))
}.toDF
&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Jul 2017 04:57:57 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Scala-Flatten-multi-valued-column-into-rows/m-p/194818#M65562</guid>
      <dc:creator>afdebbas</dc:creator>
      <dc:date>2017-07-27T04:57:57Z</dc:date>
    </item>
  </channel>
</rss>

