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

Operators should not implicitly become reserved keywords

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.12.0
    • None
    • None

    Description

      As a byproduct of how ANTLR lexes things, whenever we introduce a new operator (RANK, CUBE, and any special keyword really) we are implicitly introducing a reserved word that can't be used for relations, columns, etc (unless give to us by the framework, as in the case of group).

      The following, for example, fails:

      a = load 'foo' as (x:int);
      a = foreach a generate x as rank;
      

      I'll include a patch to fix this essentially by whitelisting tokens. I currently just whitelist cube, rank, and group. We can add more as people want them? Can anyone think of reasonable ones they'd like to add?

      Attachments

        1. PIG-3122-0.patch
          25 kB
          Jonathan Coveney
        2. PIG-3122-1.patch
          12 kB
          Jonathan Coveney
        3. PIG-3122-2.patch
          11 kB
          Cheolsoo Park
        4. PIG-3122-3.patch
          11 kB
          Cheolsoo Park

        Issue Links

          Activity

            People

              jcoveney Jonathan Coveney
              jcoveney Jonathan Coveney
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: