Getting an error on running HCatalog
Asked Answered
G

3

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

2015-07-08 19:56:34,875 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1070: Could not resolve HCatalogLoader using imports: [, java.lang., org.apache.pig.builtin., org.apache.pig.impl.builtin.] Details at logfile: /home/KS5023833/pig_1436364102374.log

Then I tried

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

This is also not working.

1070: Could not resolve org.apache.hive.hcatalog.pig.HCatLoader using imports: [, java.lang., org.apache.pig.builtin., org.apache.pig.impl.builtin.]

what is the problem? I am a novice in Hadoop.

Gustav answered 8/7, 2015 at 14:40 Comment(1)
when you launched the grunt> shell, did you type $ pig -useHCatalog ?Mum
A
4

As stated by GoBrewers14 you must start pig with -useHCatalog. If you are running a Pig script an alternative is to determine the location of the HCatalog jar and add a REGISTER statement with the path of the jar to 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.

Aureolin answered 8/7, 2015 at 19:12 Comment(1)
Trivial, but just to clarify for novices: Where you would normally just call pig you can now instead simply call pig -useHCatalog (Mind the capitalization.). So this can be used for running in the terminal, or for calling a script with pig -useHCatalog -f yourscript.pig Of course this is also required for any script containing HCatStorer.Golgi
J
1

I was facing the same issue, fixed it as following: Start pig using "-useHCatalog" option.

pig -useHCatalog

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

Jacobian answered 22/9, 2016 at 9:47 Comment(0)
F
0

You can now launch pig shell just by using command to use HCatalog-

pig -useHCatalog
grunt> a = load 'table' using org.apache.hive.hcatalog.pig.HCatLoader();
Felicle answered 25/2, 2016 at 2:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.