You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Ted Dunning (JIRA)" <ji...@apache.org> on 2008/08/21 20:42:44 UTC
[jira] Created: (PIG-387) Unary minus not supported in FOREACH
expressions
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.