Coder Social home page Coder Social logo

Serialize array of strings? about go-avro HOT 4 CLOSED

elodina avatar elodina commented on June 2, 2024
Serialize array of strings?

from go-avro.

Comments (4)

serejja avatar serejja commented on June 2, 2024

Hi @kartiksura, can you please attach some code that didn't work for you?
Thanks

from go-avro.

kartiksura avatar kartiksura commented on June 2, 2024

http://play.golang.org/p/JKHtzR-szQ
I refered to the schema from the following article:
http://technicaltidbit.blogspot.in/2013/02/avro-tips.html

from go-avro.

serejja avatar serejja commented on June 2, 2024

Ok so SpecificDatumWriter does not yet implement complex types writing, only GenericDatumWriter does at the moment. This will probably be one of the next things to be implemented, hopefully will find time to do it this week.

And one thing more, your schema is incorrect a bit, the type in messages field should not be a JSON array for Avro arrays (only union types should be arrays), so the schema for this field should look like this:

{ "name": "messages", "type": { "type": "array", "name": "messagestype", "items": { "name": "message", "type": "string" } } }

You may open a separate issue for SpecificDatumWriter complex types so we definitely focus on that and don't forget.

Thanks

from go-avro.

serejja avatar serejja commented on June 2, 2024

Hi @kartiksura, I got this fixed in #22, your code should now work fine assuming you fixed the schema

from go-avro.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.