You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Gianmarco De Francisci Morales (JIRA)" <ji...@apache.org> on 2013/01/07 10:20:13 UTC

[jira] [Updated] (PIG-2353) RANK function like in SQL

     [ https://issues.apache.org/jira/browse/PIG-2353?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gianmarco De Francisci Morales updated PIG-2353:
------------------------------------------------

    Release Note: 
Pig includes a new RANK operator:
RANK <relation> ( BY <column> (ASC|DES)? (DENSE)? )?
This operator prepends a consecutive integer to each tuple in the relation starting from 1.
If the BY clause is present, RANK sorts the relation before ranking it, otherwise it uses the order in which it receives the relation (e.g. the order in which the relation is stored if RANK is performed right after a LOAD).
The DENSE modifier produces a dense rank, which has no gaps in it regardless of ties.

RANK is now a reserved keyword and is *not* backward compatible.
Please review your scripts to avoid usage of RANK as a relation name.

  was:
Pig includes a new RANK operator:
RANK <relation> ( BY <column> (ASC|DES)? (DENSE)? )?
This operator prepends a consecutive integer to each tuple in the relation starting from 1.
If the BY clause is present, RANK sorts the relation before ranking it, otherwise it uses the order in which it receives the relation (e.g. the order in which the relation is stored if RANK is performed right after a LOAD).
The DENSE modifier produces a dense rank, which has no gaps in it regardless of ties.



    
> RANK function like in SQL
> -------------------------
>
>                 Key: PIG-2353
>                 URL: https://issues.apache.org/jira/browse/PIG-2353
>             Project: Pig
>          Issue Type: New Feature
>            Reporter: Gianmarco De Francisci Morales
>            Assignee: Allan AvendaƱo
>              Labels: gsoc2012, mentor
>             Fix For: 0.11
>
>         Attachments: PIG-2353-2, PIG-2353-3.txt, PIG-2353-4.txt, PIG-2353-5.txt, PIG2353.patch
>
>
> Implement a function that given a (sorted) bag adds to each tuple a unique, increasing identifier without gaps, like what RANK does for SQL.
> This is a candidate project for Google summer of code 2012. More information about the program can be found at https://cwiki.apache.org/confluence/display/PIG/GSoc2012
> Functionality implemented so far, is available at https://reviews.apache.org/r/5523/diff/#index_header

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira