[
https://issues.apache.org/jira/browse/PIG-296?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14020721#comment-14020721
]
Philip (flip) Kromer commented on PIG-296:
------------------------------------------
closeable: this is now implemented in the piggybank Over UDF
> UDF for cumulative statistics
> -----------------------------
>
> Key: PIG-296
> URL: https://issues.apache.org/jira/browse/PIG-296
> Project: Pig
> Issue Type: Improvement
> Reporter: Ajay Garg
> Priority: Minor
> Attachments: cumulative.patch, newCumulative.patch
>
>
> udf for computive cumulative sum, row, rank, dense rank.
> To use
> A = load 'data' using PigStorage as ( query, freq );
> B = group A all;
> C = foreach B {
> Ordered = order A by freq using numeric.OrderDescending;
> generate
> statistics.CUMULATIVE_COLUMN(Ordered, 1) as -- Pig starts with 0th
> column, this refers to the column freq by offset
> ( query, freq, freq_cumulative_sum, freq_row, freq_rank,
> freq_dense_rank );
> };
> D = foreach C generate FLATTEN(A);
--
This message was sent by Atlassian JIRA
(v6.2#6252)