I have a parameterized Generic type, where the generic type is from Case classes I defined separately.
These are
case class TypeA(user_id: String, device_id: String) extends Serializable case class TypeB(user_id: String, device_id: String, org_id: String, app_name: String) extends Serializable I use a Map function to read in the datasets, based on the Generic type schema
val res = this.readHandlersMap.map(s => s._1 match { case "a" => { (s._1, s._2.read[TypeA]((Encoders.product[TypeA].schema)).asInstanceOf[Dataset[TypeA]]) } case "b" => { (s._1, s._2.read[TypeB]((Encoders.product[TypeB].schema)).asInstanceOf[Dataset[TypeB]]) } }); After checking the output of res, I get that it is of type
Map[String, Dataset[_ >: TypeA with TypeB <: Serializable with Product]] I don't get the meaning of this type. What do the _>: and withs do in this type? And when I try to declare res as of type Dataset[Serializable], I get an error. What will this type be if I add a TypeC?