我正在尝试使用代码将JSON数据导入Pig:
Data = LOAD '/log/2015/06/07-TAG-AD.json.bz2'
USING JsonLoader('user: (ui:long, date:datetime, ua:chararray, ip:chararray, id:long, cntry:chararray, cty:chararray, x:float, y:float, gender:int, age:int), inv: (w:int, h:int, url:chararray, do:chararray, pos:int, adx:int, net: chararray, adv:int, dea:int), resp: (adv:long, oi:long, c:long, cr:long, p:double, b:double)');
DUMP Data;
但是我继续收到错误:
错误2997:无法从支持的错误重新创建异常:AttemptID:attempt_1433718762047_0074_m_000000_3信息:错误:org.codehaus.jackson.JsonParseException:意外字符('M'(代码77)):预期有效值(数字,字符串, array,object,'true','false'或'null')
我想它是来自字段user.ua字段,因为这是JSON的样子:
({ "_id" : ObjectId("5573fcdfba0947360b8f0144"), "user" : { "ui" : NumberLong("3559044716429019182"), "date" : ISODate("2015-06-07T08:12:15.047Z"), "ua" : "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36", "ip" : null, "id" : null, "cntry" : "FR", "cty" : "Toulouse", "x" : null, "y" : null, "gender" : null, "age" : null }, "inv" : { "w" : 300, "h" : 250, "url" : "http://www.ladepeche.fr/", "do" : "ladepeche.fr", "pos" : null, "adx" : 1, "net" : null, "adv" : 1, "dea" : null }, "resp" : { "adv" : NumberLong(449290), "oi" : NumberLong(1862027), "c" : NumberLong(7772668), "cr" : NumberLong(28041668), "p" : 2.518448, "b" : 2.55584 } })
chararray数据类型不应该能够识别字母“M”吗?