avrohugger | Generate Scala case class definitions from Avro schemas | Serialization library
kandi X-RAY | avrohugger Summary
kandi X-RAY | avrohugger Summary
[Join the chat at
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of avrohugger
avrohugger Key Features
avrohugger Examples and Code Snippets
Community Discussions
Trending Discussions on avrohugger
QUESTION
I am using https://github.com/julianpeeters/avrohugger sbt plugin to generate Scala case classes for Avro .avsc
files. How can I use the same plugin in a Gradle project?
ANSWER
Answered 2018-Nov-25 at 06:59I ended up using the avrohugger-tools
library in Gradle to autogenerate Scala case classes whenever my schemas were updated. Your mileage may vary, but this finally worked for me:
build.gradle.kts
QUESTION
I'm creating a new project in sbt, and I'm having a hard time getting avro files to generate. I'm using avrohugger in my sbt plugins:
...ANSWER
Answered 2017-Dec-11 at 21:41After some digging, this was a few different issues.
First was that (avroSpecificSourceDirectory in Compile) := new java.io.File("src/main/resources/avro")
is not the full namespace, and that actually made a difference. I was using my.cool.namespace
because my folder was incorrect and also had the .
's in it. Remaking the folder structure to match the expected namespace, and changing this to slashes, helped it find the files it needed.
I was able to remove the namespace mapping, since my avro definitions didn't need it, and I didn't need the output folder because the default is fine.
Finally, I fixed which generator was being used in the compile step, and used the specific record generator throughout the build file.
So now, the relevant and completed build.sbt
part looks like this:
QUESTION
I am working on a flat schema, there is no nested type inside, and it has more than 254 fields.
Goal: What I want to do is to automatically convert this kind of schema to a flat case class by the specific generator
Issue: a parameter list's length cannot exceed 254 in JVM
What I tried => use the plugins sbt-avrohugger and sbt-avro4s, but they didn't work so well.
Q: Is there a way to achieve the goal?
...ANSWER
Answered 2017-Nov-26 at 03:30this is fix in avro 1.8.1
https://issues.apache.org/jira/browse/AVRO-1642
if is possible use avro 1.8.1 or higher, it will solve your issue
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install avrohugger
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page