Skip to content
This repository has been archived by the owner on Jan 12, 2022. It is now read-only.

Support for "map" type? #16

Closed
sutram opened this issue Jun 6, 2015 · 10 comments
Closed

Support for "map" type? #16

sutram opened this issue Jun 6, 2015 · 10 comments

Comments

@sutram
Copy link

sutram commented Jun 6, 2015

Is this something that you are planning to add?
Thanks.

@julianpeeters
Copy link
Owner

Yes, however the timeframe for completion is uncertain. Likely within one or two months. Pull requests welcome.

@sutram
Copy link
Author

sutram commented Jun 8, 2015

Ok, no problem. Can you point me to the area of code that I need to look at?

@julianpeeters
Copy link
Owner

Sure. If you'd like to take a look, I've made a branch with a handful of Map tests and AvroRecord will need to be updated for them to pass.

Avro takes in a ClassDef, reads its set of fields, and emits a ClassDef with new members based on those fields. Specifically, the methods generateNewCtors, generateSchema, generateNewMethods need to know what to generate when they are passed a set of fields that contains a map.

For example, when AvroRecord tries to make zero-arg constructor, it needs a default value for each field, but currently doesn't know what default to use when the field is a Map.

@julianpeeters
Copy link
Owner

I'm going to start on this feature, so if by chance there has been any progress here, please share any scraps. :)

@sutram
Copy link
Author

sutram commented Jun 19, 2015

Unfortunately, I've been extra busy recently so I haven't done much. Sorry.

@julianpeeters
Copy link
Owner

No worries at all.

Maps are now supported for Scala 2.11, with release version 0.9.0.

Support for Maps in 2.10 will come as well.

@sutram
Copy link
Author

sutram commented Jun 23, 2015

This works great! Looking forward to the port to 2.10.

Thanks,
Sutram

@julianpeeters
Copy link
Owner

Good to hear.

You can try with 2.10 by using release version 0.4.1, should be syncing with maven central in a couple hours.

@sutram
Copy link
Author

sutram commented Jun 25, 2015

I verified that the 2.10 version works as well!

@julianpeeters
Copy link
Owner

OK great, thanks for the report. Happy Avro-ing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants