【发布时间】:2016-07-13 07:35:45
【问题描述】:
我在运行与转换 RDD 时 protobuf 字段序列化相关的 spark 作业时看到错误。
com.esotericsoftware.kryo.KryoException: java.lang.UnsupportedOperationException 序列化跟踪: otherAuthors_ (com.thomsonreuters.kraken.medusa.dbor.proto.Book$DBBooks)
这个时候好像产生了错误:
val booksPerTier: Iterable[(TimeTier, RDD[DBBooks])] = allTiers.map {
tier => (tier, books.filter(b => isInTier(endOfInterval, tier, b) && !isBookPublished(o)).mapPartitions( it =>
it.map{ord =>
(ord.getAuthor, ord.getPublisherName, getGenre(ord.getSourceCountry))}))
}
val averagesPerAuthor = booksPerTier.flatMap { case (tier, opt) =>
opt.map(o => (tier, o._1, PublisherCompanyComparison, o._3)).countByValue()
}
val averagesPerPublisher = booksPerTier.flatMap { case (tier, opt) =>
opt.map(o => (tier, o._1, PublisherComparison(o._2), o._3)).countByValue()
}
该字段是protobuf中指定的列表,如下所示:
otherAuthors_ = java.util.Collections.emptyList()
如您所见,代码实际上并未使用 Book Protobuf 中的该字段,尽管它仍在通过网络传输。
有人对此有什么建议吗?
【问题讨论】:
标签: scala apache-spark kryo