Uploaded image for project: 'Pig'
  1. Pig
  2. PIG-2353

RANK function like in SQL

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.11
    • None
    • Hide
      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.
      Show
      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.

    Description

      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

      Attachments

        1. PIG2353.patch
          9 kB
          Jonathan Coveney
        2. PIG-2353-2
          73 kB
          Allan Avendaño
        3. PIG-2353-3.txt
          251 kB
          Allan Avendaño
        4. PIG-2353-4.txt
          286 kB
          Allan Avendaño
        5. PIG-2353-5.txt
          294 kB
          Allan Avendaño

        Issue Links

          Activity

            People

              xalan Allan Avendaño
              azaroth Gianmarco De Francisci Morales
              Votes:
              0 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: