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

Order by only allows ordering on columns, not expressions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 0.7.0
    • None
    • None
    • None

    Description

      Currently the following Pig Latin will fail:

      A = LOAD '/Users/gates/test/data/studenttab10' as (name, age, gpa);
      B = order A by (int)age;
      dump B;
      

      with an error message

      ERROR 1000: Error during parsing. Encountered " "int" "int "" at line 2, column 17.
      Was expecting one of:
          <IDENTIFIER> ...
          <DOLLARVAR> ...
      

      The issue is because Pig expects a column not an expression for Order By. If the cast is removed, the script passes. Order by should take an expression for its key, just as group, join, etc. do.

      Attachments

        Issue Links

          Activity

            People

              xuefuz Xuefu Zhang
              gates Alan Gates
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: