I am newbie to scala and I migrate some code from scala 2.12 to 13. I have the following code
override def transformSchema(schema: StructType): StructType = {
StructType(schema.fields ++ this.getOutputCols.map[StructField, Array[StructField]]( col => StructField(col, StringType)))
}
I face the following error error:
wrong number of type parameters for method map: [B](f: String => B)(implicit ct: scala.reflect.ClassTag[B]): Array[B]
[ERROR] StructType(schema.fields ++ this.getOutputCols.map[StructField, Array[StructField]]( col => StructField(col, StringType)))
Can you explain why scala 2.13 has this problem, I dont find something related to the documentation The map method tries to convert the array and it should be ok
2.13 was a rewrite of the collections - see https://docs.scala-lang.org/overviews/core/collections-migration-213.html.
In your case in particular the issue is exactly as error says:
.map.mapso in 2.13 it should be