title: return constant numbers over partition
body: <p>I have the following table:</p>
  <pre><code>data = [(1, &quot;user_1&quot;, 'foo.com'), (2, &quot;user_1&quot;, 'foo.com'), (3, &quot;user_1&quot;, 'bar.com'), (4, &quot;user_1&quot;, 'foo.com')]
  schema = ['event_actions_order', 'user_name', 'website']
  
  df = spark.createDataFrame(data, schema=schema)
  df.show()
  
  +-------------------+---------+---------+
  |event_actions_order|user_name| website |
  +-------------------+---------+---------+
  |                  1|  user_1 | foo.com |
  |                  2|  user_1 | foo.com |
  |                  3|  user_1 | bar.com |
  |                  4|  user_1 | foo.com |
  +-------------------+---------+---------+
  </code></pre>
  <p>I want to be able to have a session number identifier each time a user move from one website to another website. I tried this:</p>
  <pre><code>w = Window.partitionBy('website').orderBy('event_actions_order')
  
  df.select('event_actions_order', 'user_name', 'website').withColumn('test', row_number().over(w)).orderBy('event_actions_order').show()
  
  +-------------------+---------+-------+----+
  |event_actions_order|user_name|website|test|
  +-------------------+---------+-------+----+
  |                  1|   user_1|foo.com|   1|
  |                  2|   user_1|foo.com|   2|
  |                  3|   user_1|bar.com|   1|
  |                  4|   user_1|foo.com|   3|
  +-------------------+---------+-------+----+
  </code></pre>
  <p>but this is the output I'd like to have:</p>
  <pre><code>+-------------------+---------+-------+----+
  |event_actions_order|user_name|website|test|
  +-------------------+---------+-------+----+
  |                  1|   user_1|foo.com|   1|
  |                  2|   user_1|foo.com|   1|
  |                  3|   user_1|bar.com|   2|
  |                  4|   user_1|foo.com|   3|
  +-------------------+---------+-------+----+
  </code></pre>
  <p>How can I achieve this?</p>