简体   繁体   English

如何使用Avro C ++库读取具有字节模式的Avro文件

[英]How to read avro file with bytes schema using Avro C++ library

I have a avro file that doesn't have a JSON schema. 我有一个没有JSON模式的avro文件。 All it has is a single field called "bytes" and the value is just binary representation of some object which I can decode. 它只有一个称为“字节”的字段,值只是我可以解码的某些对象的二进制表示。 The first few bytes of the avro looks like; avro的前几个字节看起来像;

bash-4.1$ hexdump -c ped.avro -n 32
0000000   O   b   j 001 002 026   a   v   r   o   .   s   c   h   e   m
0000010   a 016   "   b   y   t   e   s   "  \0   [ 346   Q 266 266 207

Anyone familiar with Avro C or Avro C++ libraries, can answer how to read these bytes field? 任何熟悉Avro C或Avro C ++库的人都可以回答如何读取这些字节字段?

Avro C: http://avro.apache.org/docs/1.7.7/api/c/index.html Avro C++: http://avro.apache.org/docs/1.7.5/api/cpp/html/ Avro C: http//avro.apache.org/docs/1.7.7/api/c/index.html Avro C ++: http//avro.apache.org/docs/1.7.5/api/cpp/html /

I don't believe there is any way to read AVRO data with the AVRO C or C++ libraries if you have no schema. 如果您没有架构,我认为无法使用AVRO C或C ++库读取AVRO数据。 AVRO is always supposed to have a schema and without it there are any number of possible schemas that could fit the data. AVRO始终应该有一个架构,没有它,就会有任何数量的可能适合数据的架构。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM