简体   繁体   English

Avro4S:找不到参数生成器的隐式值

[英]Avro4S : Could not find implicit value for parameter builder

I am using avro4s 我正在使用avro4s

https://github.com/sksamuel/avro4s https://github.com/sksamuel/avro4s

I wrote this code 我写了这段代码

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

But I get a compile time error 但是我得到一个编译时错误

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

There was a bug in 1.2.x with private vals in a case class which caused the error you've seen here. 在1.2.x中,case类中有一个私有val的错误导致您在这里看到的错误。 That's fixed in 1.3.0 and should solve your problem. 该问题已在1.3.0中修复,应该可以解决您的问题。

(If it's not private vals, you'd need to post up your SalesRecord object for us to take a look at and I'll update this answer with a solution). (如果不是私有值,则需要发布SalesRecord对象,以供我们查看,我将用解决方案更新此答案)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM