I saved Array[String] in the Parquet file from Spark.
To read this, I use:
row.getAs[Array[String]]("result")
But we 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 to change getAs() ?
scala apache-spark
Bar
source share