avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicolas Ranc <rnc.nico...@gmail.com>
Subject Avro decoding - Access Values / Types
Date Wed, 24 Aug 2016 06:57:59 GMT
Hello,
I'm using Avro c++ and i would like to decode files : access to values and
types of each variable.

I'm doing this with a lot of condition :

//For values
Json Value::val;
   IF val.isString()
        if(val=="name")
            Add the next name in a vector ...

//For Types i do the same with a vector of vector of vector because each
type can be an array like //["int","null"]...

The problem is that i can have records with records with array... and i
think my solution doesn't work with a big file.

That's why i would like to use avro::Decode or avro::DataFileReaderBase to
access to all  values/types.

avro::DataFileReaderBase decode("test.bin");
decode.init();
decode.readerSchema().toJson(std::cout);

With this i can put on my screen the json file.
Which functions i can use now to store/acces of each names (like
first_name, last_name) / types (like string) in my file ?

Thanks,
Nicolas

Mime
View raw message