问题
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