Getting error starting HCatalog

A = LOAD 'eventnew.txt' USING HCatalogLoader(); 

2015-07-08 19: 56: 34,875 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1070: Failed to resolve HCatalogLoader using import: [, java.lang., Org.apache. pig.builtin., org.apache.pig.impl.builtin.] Details in the log file: /home/KS5023833/pig_1436364102374.log

Then i tried

  A = LOAD 'xyz' USING org.apache.hive.hcatalog.pig.HCatLoader(); 

This also does not work.

1070: Failed to resolve org.apache.hive.hcatalog.pig.HCatLoader using import: [, java.lang., Org.apache.pig.builtin., Org.apache.pig.impl.builtin.]

What is the problem? I am new to Hadoop.

+5
source share
3 answers

As pointed out by GoBrewers14, you must start the pigs with -useHCatalog. If you are using a Pig script, then the alternative is to locate the HCatalog ATM and add the REGISTER statement with the bank outline at the top of your script

Example:

REGISTER /home/user/Installations/hive-0.11.0-bin/hcatalog/share/hcatalog/hcatalog-core-0.11.0.jar;

Of course, your path / version may be different.

+4
source

Now you can start the pig shell using the command to use HCatalog -

 pig -useHCatalog grunt> a = load 'table' using org.apache.hive.hcatalog.pig.HCatLoader(); 
0
source

I ran into the same problem, fixed it as follows: Run the pigs using the -useHCatalog option.

pig -useHCatalog

then try: A = LOAD 'eventnew.txt' USING HCatalogLoader ();

0
source

All Articles