【问题标题】:Avro4S : Could not find implicit value for parameter builderAvro4S:找不到参数生成器的隐式值
【发布时间】:2016-02-20 07:13:53
【问题描述】:

我正在使用 avro4s

https://github.com/sksamuel/avro4s

我写了这段代码

implicit val schema = AvroSchema[SalesRecord]
val output = AvroOutputStream[SalesRecord](new File(outputLocation))
output.write(salesList)
output.flush
output.close

但是我得到一个编译时错误

could not find implicit value for parameter builder: shapeless.Lazy[....]
Not enough arguments for method apply 

【问题讨论】:

  • 当我在对象应用工厂方法后忘记了 () 时,有时会遇到类似的错误。也许你的第一行应该是:AvroSchema[SalesRecord]() ?

标签: scala avro4s


【解决方案1】:

在 1.2.x 中存在一个错误,其中一个案例类中的私有 val 导致了您在此处看到的错误。这已在 1.3.0 中修复,应该可以解决您的问题。

(如果不是私人 val,您需要发布您的 SalesRecord 对象以供我们查看,我将使用解决方案更新此答案)。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-08-29
    • 2017-02-02
    • 2016-01-17
    • 2013-04-12
    • 1970-01-01
    • 2011-10-17
    • 2016-03-31
    • 2015-01-27
    相关资源
    最近更新 更多