Unary minus not supported in FOREACH expressions
------------------------------------------------

                 Key: PIG-387
                 URL: https://issues.apache.org/jira/browse/PIG-387
             Project: Pig
          Issue Type: Bug
          Components: grunt
    Affects Versions: 0.1.0
            Reporter: Ted Dunning


Grunt parser broken with respect to unary minus.

This script provides an example.


log = LOAD 'tutorial/data/excite-small.log' USING PigStorage('\t') as (ip, 
date, query);

t1 = GROUP log by ip;
describe t1;

counts = FOREACH t1 {
   cnt = COUNT(log);
   -- unary minus fails
   neg = -cnt;
   -- prefixing to make the negation a subtraction works
   -- neg = 0-cnt;
   GENERATE group as ip, cnt as cnt, neg as key;
}
describe counts;

sorted = ORDER counts by key;
describe sorted;
dump sorted;



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to