Can't load avro schema in pig

末鹿安然 提交于 2019-12-11 19:08:15

问题


I have an avro schema, and I am writing data with that schema to an AvroSequenceFileOutputFormat. I looked in the file and can confirm that the schema is there to read. I call the function

avro = load 'part-r-00000.avro' using AvroStorage(); 

and it gives me the error message

ERROR org.apache.pig.tools.grunt.Grunt - ERROR 2245: Cannot get schema from loadFunc org.apache.pig.builtin.AvroStorage
Details at logfile: /Users/ajosephs/Code/serialization-protocol/output/pig_1391635368675.log

Does anyone know what the problem could be. I can post the log file but it basically just says it failed to parse, no specific error.


回答1:


A shot in the dark, but once I had trouble parsing the schema from a pig-generated Avro datafile. Turned out that Avro's stock file parser was choking on some random leading character in the small bit of header before the schema.



来源:https://stackoverflow.com/questions/21588911/cant-load-avro-schema-in-pig

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!