Somehow if I use grunt shell to execute a pig script, it works fine but if I try java mode, it shows “Failed to create DataStorage” error somehow.
- Grunt mode command is “pig -x mapreduce test1.pig”
- Java mode command is “java -cp $PIGDIR/pig-0.9.2.jar:$HADOOP_CONF_DIR test1.pig”
I am wondering what’s wrong with my Java command syntax (or any configuration issue?)
It looks like your’re trying to run a pig script directly from java, which probably wont work. You’ll need to embed your script in a complied java class and run that if you don’t want to use grunt. This link should explain what to do:
Embedding Pig In Java Programs
Also, see this for more info on run modes.