无法在Pig中加载Avro模式 [英] Can't load avro schema in pig

查看:131
本文介绍了无法在Pig中加载Avro模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Avro架构,并且正在将具有该架构的数据写入AvroSequenceFileOutputFormat.我查看了文件,可以确认该模式已在其中读取.我叫这个函数

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(); 

它给我错误信息

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.

推荐答案

在黑暗中拍摄,但是一旦从猪生成的Avro数据文件中解析架构,就遇到了麻烦.事实证明,Avro的股票文件解析器在模式之前的少量标头中阻塞了一些随机的前导字符.

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.

这篇关于无法在Pig中加载Avro模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆