Support Questions
Find answers, ask questions, and share your expertise

Error 1070 when running Lab 3 - Pig Tutorial Script,While running Lab 3 I - Pig Risk Analysis - I get an error 1070.

New Contributor

Hi,

I get the following error when I try to run the Lab 3 - Pig tutorial

2016-09-07 20:06:51,165 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1070: Could not resolve sum using imports: [, java.lang., org.apache.pig.builtin., org.apache.pig.impl.builtin.]

,

Hi, the details of the error are:

2016-09-07 20:06:51,165 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1070: Could not resolve sum using imports: [, java.lang., org.apache.pig.builtin., org.apache.pig.impl.builtin.]

1 ACCEPTED SOLUTION

Accepted Solutions

Guru

@D Srini

You have provided the error but not the code itself. Based on the error, it looks like your code did not use SUM in caps.

SUM is a built in function of pig. It is a java static method called SUM in the package org.apache.pig.builtin which is packaged in the pig jars. Bottom line is that this function is case sensitive.

I think instead of writing

e =foreach d generate groupas driverid, SUM(c.occurance)as t_occ;

you wrote

e =foreach d generate groupas driverid, sum(c.occurance)as t_occ;

See https://pig.apache.org/docs/r0.16.0/func.html#built-in-functions to learn more about pig functions, both builtin functions (where you do not need to register them in your code because pig dynamically finds the function in the pig jars) and user-defined functions (where you create the jar and register it in the pig code).

If this was indeed the problem, let me know by accepting the answer.

View solution in original post

3 REPLIES 3

Guru

@D Srini

You have provided the error but not the code itself. Based on the error, it looks like your code did not use SUM in caps.

SUM is a built in function of pig. It is a java static method called SUM in the package org.apache.pig.builtin which is packaged in the pig jars. Bottom line is that this function is case sensitive.

I think instead of writing

e =foreach d generate groupas driverid, SUM(c.occurance)as t_occ;

you wrote

e =foreach d generate groupas driverid, sum(c.occurance)as t_occ;

See https://pig.apache.org/docs/r0.16.0/func.html#built-in-functions to learn more about pig functions, both builtin functions (where you do not need to register them in your code because pig dynamically finds the function in the pig jars) and user-defined functions (where you create the jar and register it in the pig code).

If this was indeed the problem, let me know by accepting the answer.

View solution in original post

New Contributor

That was it. Thanks.

Guru

Glad I could help 🙂