title: java - Joining 2 Spark dataframes, getting result as list
body: <p>I am trying to join 2 dataframes, but I would like to have the result as a list of rows of the right dataframe (<code>dDf</code> in the example below) in a column of the left dataframe (<code>cDf</code> in the example). </p>
  
  <p>I made it work with one column, but having <strong>issues adding more columns</strong>. </p>
  
  <pre><code>    Seq&lt;String&gt; joinColumns = new Set2&lt;&gt;("c1", "c2").toSeq();
      Dataset&lt;Row&gt; allDf = cDf.join(dDf, joinColumns, "inner");
      allDf.printSchema();
      allDf.show();
  
      Dataset&lt;Row&gt; aggDf = allDf
              .groupBy(cDf.col("c1"), cDf.col("c2"))
              .agg(collect_list(col("c50")));
      aggDf.show();
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>+--------+-------+---------------------------+
  |c1      |c2     |collect_list(c50)          |
  +--------+-------+---------------------------+
  |    3744|1160242|         [6, 5, 4, 3, 2, 1]|
  |    3739|1150097|                        [1]|
  |    3780|1159902|            [5, 4, 3, 2, 1]|
  |     132|1200743|               [4, 3, 2, 1]|
  |    3778|1183204|                        [1]|
  |    3766|1132709|                        [1]|
  |    3835|1146169|                        [1]|
  +--------+-------+---------------------------+
  </code></pre>
  
  <p>Also, is there a way to do something like:</p>
  
  <pre><code>    Dataset&lt;Row&gt; aggDf = allDf
              .groupBy(cDf.col("*"))
              .agg(collect_list(col("c50")));
  </code></pre>