[英]Spark : No Encoder found for java.util.UUID
I have a case class that contains a type field UUID.我有一个包含类型字段 UUID 的案例 class。 I use anorm to parse a Postgres table and I want to transform the list to a Dataset.我使用 anorm 解析 Postgres 表,我想将列表转换为数据集。
When I create the Dataset, I have this error No Encoder found for java.util.UUID
创建数据集时,出现此错误No Encoder found for java.util.UUID
def encoder[T: Encoder] = implicitly[Encoder[T]]
val parser = Macro.namedParser[Vehicle]
val result = SQL(s"SELECT * FROM $tableName").as(parser.*)
spark.createDataset(result)(encoder[Vehicle])
How can I manage this error?我该如何管理这个错误?
Thanks for your help.谢谢你的帮助。
There are no encoder for UUID in spark 2. you should use String instead. spark 2 中没有 UUID 编码器。您应该使用 String 代替。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.