Reputation: 17151
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?
Upvotes: 14
Views: 13818