title: PySpark group by collect_list over a window
body: <p>I have a data frame with multiple columns. I'm trying to aggregate few columns using collect_list grouped on id, over a window function. I'm trying some thing like this:</p>
  
  <pre><code>exprs = [(collect_list(x).over(window)).alias(f"{x}_list") for x in cols]
  df = df.groupBy('id').agg(*exprs)
  </code></pre>
  
  <p>I'm getting the below error:</p>
  
  <blockquote>
    <p>expression is neither present in the group by, nor is it an aggregate function. Add to group by or wrap in first() (or first_value) if you don't care which value you get</p>
  </blockquote>
  
  <p>If I do the same for a single column, instead of for multiple columns it is working.</p>