title: How to print <String, Array[]> as a flat pair?
body: <h2>Setup:</h2>
  
  <p>I have data about customers and their favorite Top 10 TV shows. So far, I am able to get this data in a <code>JavaRDD&lt;Tuple2&lt;String, Shows[]&gt;&gt;</code>. I am able to print it and check if it is as expected, it is. </p>
  
  <h2>Objective:</h2>
  
  <p>Now, I need to print this data to a file, in the following format:</p>
  
  <pre><code>Customer_1 Fav_TV_Show_1
  Customer_1 Fav_TV_Show_2
  Customer_1 Fav_TV_Show_3
  Customer_1 Fav_TV_Show_4
  Customer_2 Fav_TV_Show_1
  Customer_2 Fav_TV_Show_2
  Customer_2 Fav_TV_Show_3
  Customer_2 Fav_TV_Show_4
  Customer_3 Fav_TV_Show_1
  Customer_3 Fav_TV_Show_2
  Customer_3 Fav_TV_Show_3
  Customer_3 Fav_TV_Show_4
  </code></pre>
  
  <h2>Problem:</h2>
  
  <p>I don't know how to do that. So far, I have tried this:</p>
  
  <pre><code>// Need a flat pair back
  JavaPairRDD&lt;String, Shows&gt; resultPairs = result.mapToPair(
          new PairFunction&lt;Tuple2&lt;String,Shows[]&gt;, String, Shows&gt;() {
              public Tuple2&lt;String, Shows&gt; call(Tuple2&lt;String, Shows[]&gt; t) {
  
                  // But this won't work as I have to return multiple &lt;Customer - Show&gt; pairs
                  }
              });
  }
  </code></pre>
  
  <p>Any help is much appreciated.</p>