Я не могу прочитать файл JSON с помощью ElephantBird и Pig. Я хочу знать, где я делаю ошибку.Ошибка чтения JSON с использованием elephantbird - PIG
данных:
{ "nrcpts": "1",
"src": "[email protected]",
"sendmailid": "p6D0r0u1006229",
"relay": "app03.example.com",
"classnumber": "0",
"msgid": "WARQZCXAEMSSVWPPOOYZXR
[email protected]",
"pid": "6229",
"month": "Jul",
"time": "20:53:00",
"day": "12",
"mailserver": "mail5",
"size": "57395"
}
Код:
json1 = load '/user/hdetl/funnel/uetsample.dat' using com.twitter.elephantbird.pig.load.JsonLoader();
dat = FOREACH json1 GENERATE $0#'mailserver' AS mailserver;
dump dat;
Ошибка:
Input(s):
Failed to read data from "/user/hdetl/funnel/uetsample.dat"
detailed error :
Pig Stack Trace
---------------
ERROR 2997: Unable to recreate exception from backed error: Error: in
org.apache.pig.impl.logicalLayer.FrontendException: ERROR 1066: Unable to open iterator for alias dat. Backend error : Unable to recreate exception from back
ed error: Error: in
at org.apache.pig.PigServer.openIterator(PigServer.java:891)
at org.apache.pig.tools.grunt.GruntParser.processDump(GruntParser.java:655)
at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:303)
at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:188)
at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:164)
at org.apache.pig.tools.grunt.Grunt.run(Grunt.java:69)
at org.apache.pig.Main.run(Main.java:495)
at org.apache.pig.Main.main(Main.java:111)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.hadoop.util.RunJar.main(RunJar.java:186)
Caused by: org.apache.pig.backend.executionengine.ExecException: ERROR 2997: Unable to recreate exception from backed error: Error: in
at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.Launcher.getErrorMessages(Launcher.java:221)
at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.Launcher.getStats(Launcher.java:151)
at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MapReduceLauncher.launchPig(MapReduceLauncher.java:344)
at org.apache.pig.PigServer.launchPlan(PigServer.java:1314)
at org.apache.pig.PigServer.executeCompiledLogicalPlan(PigServer.java:1299)
at org.apache.pig.PigServer.storeEx(PigServer.java:996)
at org.apache.pig.PigServer.store(PigServer.java:963)
at org.apache.pig.PigServer.openIterator(PigServer.java:876)
экспорт JAVA_HOME =/USR/Java/jdk1.6.0_22 экспорт PIG_CLASSPATH =/и т.д./Hadoop/конф экспорт PATH = $ PATH: /local/hdetl/pig-0.9.2/bin REGISTER /local/hdetl/funnel/pig-jars/json-simple-1.1.jar; РЕГИСТРАЦИЯ /local/hdetl/funnel/pig-jars/google-collect-1.0.jar; РЕГИСТРАЦИЯ// loc/ – Bharathi
В чем ваш вопрос? –
Я не могу прочитать файл JSON с помощью слона и PIG. Я хочу знать, где ошибка. – Bharathi