Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Error while loading a hive data table in pig

Re: Error while loading a hive data table in pig

Guru

Your output looks fine. I don't see any errors. What is your question?

Re: Error while loading a hive data table in pig

Mentor

@Rich Raposa

  1. ls: cannot access /usr/lib/hive-0.13.1-bin/lib/slf4j-api-*.jar:No such file or directory
  2. ls: cannot access /usr/lib/hive-0.13.1-bin/hcatalog//share/hcatalog/hcatalog-core-*.jar: No such file or directory
  3. ls: cannot access /usr/lib/hive-0.13.1-bin/hcatalog//share/hcatalog/hcatalog-*.jar: No such file or directory
  4. ls: cannot access /usr/lib/hive-0.13.1-bin/hcatalog//share/hcatalog/hcatalog-pig-adapter-*.jar: No such file or directory

Re: Error while loading a hive data table in pig

Guru

Those have no effect on the script. There is no error happening here. He just needs to keep going and finish writing the Pig script. Everything will work fine.

Re: Error while loading a hive data table in pig

Guru

I will reiterate my answer. I see this every day. There is no error and his code is working - it just doesn't do anything but load data from a Hive table. Try adding a DUMP command and I bet it will work fine.

Re: Error while loading a hive data table in pig

Mentor

@Rich Raposa I just tested your theory in reverse as I don't have access to 0.13.

grunt> A1 = load 'sample_07' Using org.apache.hive.hcatalog.pig.HCatLoader();
grunt> A1 = load 'sample_07' Using org.apache.hcatalog.pig.HCatLoader();
2016-03-03 02:57:27,918 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1070: Could not resolve org.apache.hcatalog.pig.HCatLoader using imports: [, java.lang., org.apache.pig.builtin., org.apache.pig.impl.builtin.]
Details at logfile: /root/pig_1456973814016.log

on first line I use the proper package and it does not fail even though I don't have a dump statement.

on second line, I use the incorrect path and it fails right away with the same error as his only in Hive 1.2.1 package includes hive in the name and in 0.13 it doesn't.

Re: Error while loading a hive data table in pig

Guru

@Gurjinder Singh - If you really want to test my theory, then add the following command and run it again:

grunt> A1 = load 'sample_07' Using org.apache.hive.hcatalog.pig.HCatLoader();
grunt> DUMP A1;

My theory is that you do not have an error and your code is running fine - it just doesn't do anything.

Re: Error while loading a hive data table in pig

New Contributor

@Artem

Still same error:

grunt> A = load 'gurjinder.empl' using org.apache.hcatalog.pig.HCatLoader(); 2016-03-03 21:52:49,038 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1070: Could not resolve org.apache.hcatalog.pig.HCatLoader using imports: [, java.lang., org.apache.pig.builtin., org.apache.pig.impl.builtin.] Details at logfile: /home/edureka/pig_1457022011095.log

Highlighted

Re: Error while loading a hive data table in pig

Mentor

can you list all your jars for hcatalog, this is what mine looks like, I wonder if you're missing some jars.

hive-hcatalog-core-1.2.1.2.3.2.0-2950.jar         hive-hcatalog-server-extensions-1.2.1.2.3.2.0-2950.jar
hive-hcatalog-core.jar                            hive-hcatalog-server-extensions.jar
hive-hcatalog-pig-adapter-1.2.1.2.3.2.0-2950.jar  hive-hcatalog-streaming-1.2.1.2.3.2.0-2950.jar
hive-hcatalog-pig-adapter.jar                     hive-hcatalog-streaming.jar

Re: Error while loading a hive data table in pig

Guru

@Gurjinder Singh - you are killin' me, man! Will you please just try my advice? I am telling you - your code will work fine if you would just run it:

grunt> A1 = load 'gurjinder.empl' Using org.apache.hive.hcatalog.pig.HCatLoader();
grunt> DUMP A1;
Don't have an account?
Coming from Hortonworks? Activate your account here