我在 Spark 中有以下代码:
rdd
.map(processFunction(_))
.saveToCassandra("keyspace", "tableName")
在哪里
def processFunction(src: String): Seq[Any] =
src match {
case "a" => List(A("a", 123112, "b"), A("b", 142342, "c"))
case "b" => List(B("d", 12312, "e", "f"), B("g", 12312, "h", "i"))
}
在哪里:
case class A(entity: String, time: Long, value: String)
case class B(entity: String, time: Long, value1: String, value2: String)
saveToCassandra
期望对象集合并Seq[Any]
用作返回类型以包含两者Seq[A]
并以异常Seq[B]
中断-不是一个术语。这种行为的原因可能是什么?saveToCassandra
scala.ScalaReflectionException: <none>