title: Sparksql Pyspark crossJoin over dimension / for a specific window
body: <p>This is my data frame</p>
  
  <pre><code>df = spark.createDataFrame([("A", "2018-01-05"), ("A", "2018-02-10"), ("B", "2018-08-11"), ("B", "2018-09-11")], ("ID", "date"))
  </code></pre>
  
  <p>I'd like to transform it so it looks like this:</p>
  
  <pre><code>+---+----------+----------+
  | ID|     date1|     date2|
  +---+----------+----------+
  |  A|2018-01-05|2018-02-10|
  |  A|2018-02-10|2018-01-05|
  |  A|2018-01-05|2018-01-05|
  |  A|2018-02-10|2018-02-10|
  |  B|2018-08-11|2018-09-11|
  |  B|2018-09-11|2018-08-11|
  |  B|2018-08-11|2018-08-11|
  |  B|2018-09-11|2018-09-11|
  +---+----------+----------+
  </code></pre>
  
  <p>So basically I need to do a crossJoin but only for the values associated with a specific ID. Is this possible? Any ideas? Maybe through a window function?</p>