-1

I am trying to implement the collect_list function is Spark.SQL. The way to do it in PySpark via a dataframe is available here

I am trying to do the same thing via a SQL query.

thebluephantom
  • 16,458
  • 8
  • 40
  • 83
chatuur
  • 1,207
  • 13
  • 20

1 Answers1

1

It has little to do with pyspark or Spark with Scala.

Try this:

SELECT c1, collect_list(struct(c2, c3)) FROM tempview/table GROUP BY c1

or a variation based on your requirements.

thebluephantom
  • 16,458
  • 8
  • 40
  • 83