I saved an Array[String] to a Parquet file from Spark.
To read it I use:
row.getAs[Array[String]]("result")
But get:
java.lang.ClassCastException: scala.collection.mutable.WrappedArray$ofRef cannot be cast to [Ljava.lang.String;
Here is the result of printSchema():
root
|-- result: array (nullable = true)
| |-- element: string (containsNull = true)
How should the getAs() be modified?
row.getAs[Seq[String]]("result")work?row.getAs[scala.collection.mutable.WrappedArray[String]]("result"). @Reactormonk I think you should make it an answer.SeqandWrappedArraywork. Do you see any reason to use one over the other? More interested about performance than usage.WrappedArray).