Pig
  1. Pig
  2. PIG-2595

BinCond only works inside parentheses

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 0.14.0
    • Component/s: None
    • Labels:
      None

      Description

      Not sure if we have a Jira for this before. This script does not work:

      a = load '/user/pig/tests/data/singlefile/studenttab10k' using PigStorage() as (name, age:int, gpa:double, instate:chararray);
      b = foreach a generate name, instate=='true'?gpa:gpa+1;
      dump b;
      

      If we put bincond into parentheses, it works

      a = load '/user/pig/tests/data/singlefile/studenttab10k' using PigStorage() as (name, age:int, gpa:double, instate:chararray);
      b = foreach a generate name, (instate=='true'?gpa:gpa+1);
      dump b;
      

      Exception:
      ERROR 1200: <file 40.pig, line 2, column 36> mismatched input '==' expecting SEMI_COLON

      org.apache.pig.impl.logicalLayer.FrontendException: ERROR 1000: Error during parsing. <file 40.pig, line 2, column 36> mismatched input '==' expecting SEMI_COLON
      at org.apache.pig.PigServer$Graph.parseQuery(PigServer.java:1598)
      at org.apache.pig.PigServer$Graph.registerQuery(PigServer.java:1541)
      at org.apache.pig.PigServer.registerQuery(PigServer.java:541)
      at org.apache.pig.tools.grunt.GruntParser.processPig(GruntParser.java:945)
      at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:392)
      at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:190)
      at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:166)
      at org.apache.pig.tools.grunt.Grunt.exec(Grunt.java:84)
      at org.apache.pig.Main.run(Main.java:599)
      at org.apache.pig.Main.main(Main.java:153)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.apache.hadoop.util.RunJar.main(RunJar.java:156)
      Caused by: Failed to parse: <file 40.pig, line 2, column 36> mismatched input '==' expecting SEMI_COLON
      at org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:226)
      at org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:168)
      at org.apache.pig.PigServer$Graph.parseQuery(PigServer.java:1590)
      ... 14 more

        Activity

        Daniel Dai created issue -
        Hide
        Olga Natkovich added a comment -

        Moving to 12 since no work has been done and the ticket is unassigned

        Show
        Olga Natkovich added a comment - Moving to 12 since no work has been done and the ticket is unassigned
        Olga Natkovich made changes -
        Field Original Value New Value
        Fix Version/s 0.12 [ 12323380 ]
        Fix Version/s 0.11 [ 12318878 ]
        Daniel Dai made changes -
        Fix Version/s 0.13.0 [ 12324971 ]
        Fix Version/s 0.12.0 [ 12323380 ]
        Sergey Svinarchuk made changes -
        Assignee Sergey Svinarchuk [ ssvinarchukhorton ]
        Sergey Svinarchuk made changes -
        Assignee Sergey Svinarchuk [ ssvinarchukhorton ]
        Daniel Dai made changes -
        Fix Version/s 0.14.0 [ 12326954 ]
        Fix Version/s 0.13.0 [ 12324971 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Daniel Dai
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:

              Development