avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicolas Ranc <rnc.nico...@gmail.com>
Subject Decode avro binary file genericaly
Date Wed, 24 Aug 2016 06:35:01 GMT
Hello, i'm seeking advices on how decode (in a generic way) the data in an
avro binary file. Avro files are composed with schema and data at the end.
For exemple, if i have this avro file (attachment), i want to decode (and
put on my screen) the data, using theses functions : decodeString(),
decodeInt()... (it depend of which type is )

I tried something like :
    avro::DataFileReaderBase decode("test.bin");
    decode.init();

    std::cout<<decode.hasMore()<<std::endl; //0 = false
    while(decode.hasMore()){
       std::cout<<decode.decoder().decodeString()<<std::endl;
       std::cout<<decode.decoder().decodeDouble()<<std::endl;
    }
    decode.close();

When i do this, i always have a segmentation fault or nothing.

Thanks,
Nicolas

Mime
View raw message