avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Quinn Slack (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AVRO-1105) Scala API for Avro
Date Tue, 12 Mar 2013 00:03:15 GMT

    [ https://issues.apache.org/jira/browse/AVRO-1105?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13599510#comment-13599510
] 

Quinn Slack commented on AVRO-1105:
-----------------------------------

Thanks for the feedback, John and Scott. I improved the API a little bit by having it serialize
into case classes (eliminating the MutableRecords entirely). It is still very, very rough.
I'd like to find others who are interested in using and maintaining it before investing more
time into it.

https://github.com/sqs/avro/tree/scala-codegen/lang/scala

Sample codegenned file: 
https://github.com/sqs/avro/blob/scala-codegen/lang/scala/src/test/scala/org/apache/avro/scala/test/generated/scala/Animal.scala
(the original schema is at the bottom)

Here are some more possible improvements for the schema-first approach:

* Make it truly immutable. Right now, the codegenned case classes have "var" fields (because
of the way Avro deserialization works).
* When Scala 2.11 is getting nearer, it would be great to make this use type macros and completely
eliminate codegen.
* Use lenses to simplify updating nested values.
* Make union type fields easier to assign (without union case class indirection), in addition
to John's suggestion about making it a sealed trait.
* Per John's suggestion, make it easy to generate pimps so users can add methods to codegenned
classes.
* Create an sbt plugin to automatically run codegen when the AVDL/AVPR changes (a Makefile
has sufficed for us so far).

If anybody else would like to contribute, I am happy to assist.
                
> Scala API for Avro
> ------------------
>
>                 Key: AVRO-1105
>                 URL: https://issues.apache.org/jira/browse/AVRO-1105
>             Project: Avro
>          Issue Type: New Feature
>            Reporter: Christophe Taton
>         Attachments: avro-scala.patch
>
>
> Umbrella issue.
> Goal is to provide Scala friendly APIs for Avro records and protocols (RPCs).
> Related project: http://code.google.com/p/avro-scala-compiler-plugin/ looks dead (no
change since Sep 2010).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message