Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Over clarification in Piggy Bank

Over clarification in Piggy Bank

Contributor

How to apply rows between unbounded preceding and unbounded following in Pig?

Currently, I am using below code calculate the cumulative sum:

A = load 'T' AS (si:chararray, i:int, d:long, f:float, s:chararray);
 C = foreach (group A by si) {
     Aord = order A by d;
     generate flatten(Stitch(Aord, Over(Aord.f, 'sum(float)')));
 }
 D = foreach C generate s, $5;This is equivalent to the SQL statement
select s, sum(f) over (partition by si order by d) from T;

I know I need to modify the Over(Aord.f, 'sum(float)' clause but not sure what exactly I need to do?

1 REPLY 1
Highlighted

Re: Over clarification in Piggy Bank

Contributor

Hi Experts

Any Input on my clarifications?

Don't have an account?
Coming from Hortonworks? Activate your account here