title: Implement `collect_list` via Spark SQL
body: <p>I am trying to implement the <code>collect_list</code> function is Spark.SQL.
  The way to do it in PySpark via a dataframe is available <a href="https://stackoverflow.com/a/38063180/3573203">here</a></p>
  
  <p>I am trying to do the same thing via a SQL query. </p>