pig-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chandra Prakash Bhagtani (JIRA)" <j...@apache.org>
Subject [jira] [Created] (PIG-4723) Piggybank Over "last_value" UDF not working as expected.
Date Sun, 01 Nov 2015 06:54:27 GMT
Chandra Prakash Bhagtani created PIG-4723:
---------------------------------------------

             Summary: Piggybank Over "last_value" UDF not working as expected. 
                 Key: PIG-4723
                 URL: https://issues.apache.org/jira/browse/PIG-4723
             Project: Pig
          Issue Type: Bug
          Components: piggybank
            Reporter: Chandra Prakash Bhagtani
            Assignee: Chandra Prakash Bhagtani


Sample input:
2014    20150801        REGISTERED
2014    20150802        NOTREGISTERED
2015    20150801        REGISTERED
2015    20150802        NOTREGISTERED

Pig Script:

A = load 'check_last_val_string.data' as (year:int,registered_date:chararray,prop:chararray);
B = group A by year;
C = FOREACH B {
        order1 = ORDER A by registered_date;
        generate flatten(Stitch(order1,Over(order1.prop,'last_value')));
        };
dump C;

Output:
(2014,20150801,REGISTERED,REGISTERED)
(2014,20150802,NOTREGISTERED,NOTREGISTERED)
(2015,20150801,REGISTERED,REGISTERED)
(2015,20150802,NOTREGISTERED,NOTREGISTERED)


Expected Output:

(2014,20150801,REGISTERED,NOTREGISTERED)
(2014,20150802,NOTREGISTERED,NOTREGISTERED)
(2015,20150801,REGISTERED,NOTREGISTERED)
(2015,20150802,NOTREGISTERED,NOTREGISTERED)




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message