Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for nested records #1

Closed
junmipan opened this issue Apr 15, 2016 · 4 comments
Closed

support for nested records #1

junmipan opened this issue Apr 15, 2016 · 4 comments

Comments

@junmipan
Copy link

Great to see this tool in the making. Would you consider adding support for nested records?
For example, the following schema contains a nested record.
{
"type": "record",
"name": "OuterRecord",
"namespace": "...",
"doc": "Schema containing record type",
"fields": [
{
"name": "nested-record",
"type": {
"type": "record",
"name": "NestedRecord",
"doc": "...",
"fields": [
{
"name": "some-attribute",
"type": "string"
}
]
}
}
]
}

@actgardner
Copy link
Owner

I made some changes, nested record definitions should work now. Let me know if you have any more issues!

@junmipan
Copy link
Author

Wow! That is a lightning fast resolution. Thanks, Alan. Great work!

A few more items for you to consider:

  1. enum
  2. non string type union members (primitive & complex types)
  3. This could be a bit demanding. Allow multiple schema (files) as input. And allow latter to reference former as type. Generate each in its own Go file. You might have figured where this came from (the Apache avro-tools for Java :-)

Ex.

  1. {
    "namespace" : "...",
    "name" : "Priority",
    "doc" : "...",
    "type" : "enum",
    "symbols" : [ "HIGH", "NORMAL", "LOW" ]
    }
  2. {
    "namespace" : "...",
    "name": "tags",
    "doc" : "...",
    "type": [
    "null",
    {
    "type": "map",
    "values": "string"
    }
    ]
    }

@actgardner
Copy link
Owner

  1. I've added support for enumerations now, they should work.
  2. All types can be members of unions right now - I need to add some integration tests for unions of non-primitive types, but everything should work.
  3. This is a pretty big chunk of work, but it's on the roadmap (after deserializing). I made a new issue to cover this request.

I'm going to close this issue since the original problem is resolved - feel free to open new issues for other feature requests or bugs!

@actgardner
Copy link
Owner

@junmipan Just so you know, all of the suggestions you made have been implemented.

actgardner pushed a commit that referenced this issue Jan 9, 2017
* Update ToPublicName to be go-idiomatic

* Make generated code package name a flag.

* Update readme with new flag.
anekdoti pushed a commit to anekdoti/gogen-avro that referenced this issue Sep 13, 2024
…quest actgardner#1)

Bugfix/missing array or map field in reader schema

Approved-by: Tomas Fabian
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants