I want to produce a daily cumulative count of unique visitors to a website, and pyspark countDistinct native function doesn't work inside a moving/growing window

For the following data:

```
+---+----+
|day|user|
+---+----+
|  1|   A|
|  2|   B|
|  3|   A|
|  4|   C|
|  5|   C|
|  5|   B|
+---+----+

```

would expect the result:

```
+---+---------+
|day|cum_count|
+---+---------+
|  1|        1| -> [A]
|  2|        2| -> [A,B]
|  3|        2| -> [A,B]
|  4|        3| -> [A,B,C]
|  5|        3| -> [A,B,C]
+---+---------+

```

PS: The original data is huge and can't be dumped to pandas