You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Jonathan Coveney (JIRA)" <ji...@apache.org> on 2012/12/19 00:24:13 UTC

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

    [ https://issues.apache.org/jira/browse/PIG-2353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13535441#comment-13535441 ] 

Jonathan Coveney commented on PIG-2353:
---------------------------------------

Did this make rank a reserved keyword? We may need to document this as a non-backwards compatible change if it is, as many scripts use "rank" as a column name. Example:

{code}
A = load 'thing';
B = FOREACH (GROUP A all) GENERATE MIN(A.rank);
{code}

Of all the errors you'd expect, I wasn't expecting this one:


2012-12-18 23:18:36,142 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1200: <line 2, column 38>  mismatched input '(' expecting SEMI_COLON
Details at logfile: /var/log/pig/pig_1355872714665.log

I culled this example from a larger script, and it looks like removing rank as a column name fixed it. Is this a known issue? I think we can refine the parser to work with rank in that position, but I thought it would be worth asking.
                
> 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