title: Spark Dataframe cartesion product by columns
body: <p>Is there any way to do a column-wise Cartesian join in Spark?</p>
  <p>For example, given a dataframe</p>
  <pre><code>+------+------+------+
  |col_a |col_b |col_c |
  +------+------+------+
  |0     |10    |100   |
  |0     |20    |200   |
  |0     |30    |300   |
  |0     |40    |400   |
  +------+------+------+
  </code></pre>
  <p>The result is a group of dataframes</p>
  <pre><code>+------+------+
  |col_a |col_b |
  +------+------+
  |0     |10    |
  |0     |20    |
  |0     |30    |
  |0     |40    |
  +------+------+
  
  +------+------+
  |col_a |col_c |
  +------+------+
  |0     |100   |
  |0     |200   |
  |0     |300   |
  |0     |400   |
  +------+------+
  
  +------+------+
  |col_b |col_c |
  +------+------+
  |10    |100   |
  |20    |200   |
  |30    |300   |
  |40    |400   |
  +------+------+
  </code></pre>
  <p>I'm aware that it can be done in code (by creating a list of column name tuples and selecting through iteration), but I'd like to leverage spark parallelism if possible by calling the same UDF on all of them, ie. something similar to groupby().apply(). Is this possible?</p>
  <p>I'm using Spark 3.1.1 with pyspark</p>
  <p>Thanks</p>