无法在猪中加载 avro 架构 [英] Can't load avro schema in pig

查看:21
本文介绍了无法在猪中加载 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.

推荐答案

在黑暗中拍摄,但有一次我在从 Pig 生成的 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.

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

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