You can have expressions in the argument to ABS. The query worked for me.
Are the columns in your data tab delimited ? (the default delim for PigStorage). It looks like in your case the expression got evaluated to null.

But it is certainly a bug that NPE was thrown from ABS, instead of returning a null value. Can you please open a jira ?

Thanks,
Thejas


On 7/8/11 7:27 AM, Shubham Chopra wrote:
Hi,

Consider the following script:

a = load 'a' as (x:chararray, y:double);
b = foreach a generate *, ABS(y - 2*y) as test;
dump b;

Are functions like (y-2*y) not supported inside ABS? The weird thing is that
it does not throw a compilation error, so I am guessing they are. Instead,
it barfs out a NPE when the job executes in hadoop.

File 'a' has data like the following
A  1
B  2

I am using pig-0.9. Is this expected behaviour?

Thanks,
Shubham.


Reply via email to