1
votes

Hi I just setup the Hortonworks Sandbox on VirtualBox on Windows 7. I got everything up and running and started the pig tutorial. I want to run this simple table load pig script:

-- Get all IBM stocks
a = LOAD 'default.nyse_stocks' USING org.apache.hive.hcatalog.pig.HCatLoader();
b = filter a by stock_symbol == 'IBM';
dump b;

I get this error:

Failed to parse: Pig script failed to parse: 
<file script.pig, line 2, column 37> pig script failed to validate: org.apache.pig.backend.executionengine.ExecException: ERROR 1070: Could not resolve org.apache.hive.hcatalog.pig.HCatLoader using imports: [, java.lang., org.apache.pig.builtin., org.apache.pig.impl.builtin.]

Not sure want to do. Fairly new to Hadoop. Thanks

3
Can you try with "pig -useHCatalog" option ? - Sivasakthi Jayaraman
try to register hcatalog-core jar file - vishnu viswanath
I tried the "pig -useHCatalog" option but still got the same error message. - Travis Payne
So I used this. link . When I tried to run the -useHCatalog option with an ssh session it did not work but it completely worked on hue. Thanks for the responses. - Travis Payne

3 Answers

2
votes

If anyone runs into this problem, like me, after working through the Hortonworks HDP 2.4 tutorials, the answer is:

   1. Open the script in the Pig view in Ambari
   2. Below the query editor, there are 'Arguments'
   3. Choose +Add, then type in -useHCatalog
0
votes

copy the jar file name hcatalog*.jar to the path “<%HADOOP_HOME>\bin\share\hcatalog"

0
votes

The use of 'Arguments' (answer by beeks) works, by need to be careful with the case: -useHCatalog, not -useHcatalog.