This, this, and this, did not solve my problem. They all are making their own UDFs. I want to use a built-in UDF. Any built-in UDF. I get the same or similar error for every UDF I have tried.
FOO = LOAD 'filepath/data.csv'
USING PigStorage(',')
AS (name:string, age:int, kilograms:double);
BAR = FOREACH FOO GENERATE $0, $1, $2, kilograms*2.2 AS pounds;
This works as expected, basically creating the same relation as FOO but with an extra column that has KG converted to LBS.
But if I want to use something like get the log scale of kilograms, like this:
BAR2 = FOREACH FOO GENERATE $0, $1, $2, log(kilograms) AS logscaleKG;
I get the following error (or similar):
ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1070: Could not resolve log using imports: [, java.lang., org.apache.pig.builtin., org.apache.pig.impl.builtin.]
No UDF seems to work inside a FOREACH GENERATE.