1

I am trying to call collect() over a Dataframe in Scala 2.12. Instead of returning an Array[Row], it returns me this - [Long.apache.spark.sql.Row;@58131fc

1 Answers1

2

It's annoying, but on the JVM, in both Java and Scala, that's just how the toString method on arrays works. Instead of seeing the contents, you get a cryptic thing beginning with e.g. [L:

scala 2.12.10> Array("foo").toString
res0: String = [Ljava.lang.String;@8bffb8b

So it appears to me that you do in fact have an Array[Row].

See also Why does the toString method in java not seem to work for an array

Seth Tisue
  • 29,985
  • 11
  • 82
  • 149