Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Avro >> mail # user >> avro_value_t or avro_datum_t

Copy link to this message
avro_value_t or avro_datum_t
To best of my knowledge use of avro_datum_t is discouraged. So I was trying
following code

//Assume path variable to be having proper value and proper exception
handling in place

avro_value_t data;
avro_file_reader_t fileReader;

result = avro_file_reader(path, &fileReader);
result = avro_file_reader_read_value(fileReader, &data);

This above call leads to "segmentation fault"

 avro_datum_t d_data;
 avro_file_reader_t fileReader;
 result = avro_file_reader(path, &fileReader);
 result = avro_file_reader_read(fileReader, NULL, &d_data);
 avro_datum_as_value(&data, d_data);

This works absolutely fine.
Am I missing anything in part A?