Mongo-Hadoop PIG command to load BSON document (Using hortonworks hadoop in Windows)

92 views
Skip to first unread message

LM Heah

unread,
Jul 5, 2014, 3:11:40 AM7/5/14
to mongod...@googlegroups.com
Hi Team,

Need your help to enlighten me.

How do I set file path for the BSON file in PIG ?

I failed to load BSON file by using the following command, I put the BSON file in the BIN folder.e.g. C:\hdp\pig-0.12.1.2.1.1.0-1621\bin

Here is my test PIG Command:-

raw = LOAD 'MyBSONFile.bson' using com.mongodb.hadoop.pig.BSONLoader;
raw_limited = LIMIT raw 10;
dump raw_limited; 

And the error log I get:-
Pig Stack Trace
---------------
ERROR 1066: Unable to open iterator for alias raw_limited
org.apache.pig.impl.logicalLayer.FrontendException: ERROR 1066: Unable to open iterator for alias raw_limited
at org.apache.pig.PigServer.openIterator(PigServer.java:882)
at org.apache.pig.tools.grunt.GruntParser.processDump(GruntParser.java:774)
at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:372)
at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:198)
at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:173)
at org.apache.pig.tools.grunt.Grunt.run(Grunt.java:69)
at org.apache.pig.Main.run(Main.java:541)
at org.apache.pig.Main.main(Main.java:156)
Caused by: java.io.IOException: Couldn't retrieve job.
at org.apache.pig.PigServer.store(PigServer.java:946)
at org.apache.pig.PigServer.openIterator(PigServer.java:857)
... 7 more
================================================================================

Any idea?
Cheers.

Will Berkeley

unread,
Jul 17, 2014, 11:52:05 AM7/17/14
to mongod...@googlegroups.com
Hi. Try loading the BSON file onto HDFS and referring to it by URI. If you're still having trouble you may also want to try posting this question on StackOverflow with the [mongodb] and [pig] tags to reach a broader community that may have relevant experience.

-Will
Reply all
Reply to author
Forward
0 new messages