Pig
  1. Pig
  2. PIG-2119

DuplicateForEachColumnRewrite makes assumptions about the position of LOGGenerate in the plan

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.9.0, 0.9.1
    • Fix Version/s: 0.9.2, 0.10.0, 0.11
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      The input:

      grunt> cat b.txt
      a       11
      b       3
      c       10
      a       12
      b       10
      c       15
      

      The script:

      a = load 'b.txt' AS (id:chararray, num:int);
      b = group a by id;
      c = foreach b { 
        d = order a by num DESC;
        n = COUNT(a);
        e = limit d 1;
        generate n;
      }
      

      The exception:

      Caused by: java.lang.ClassCastException: org.apache.pig.newplan.logical.relational.LOLimit cannot be cast to org.apache.pig.newplan.logical.relational.LOGenerate
              at org.apache.pig.newplan.logical.rules.DuplicateForEachColumnRewrite$DuplicateForEachColumnRewriteTransformer.check(DuplicateForEachColumnRewrite.java:87)
              at org.apache.pig.newplan.optimizer.PlanOptimizer.optimize(PlanOptimizer.java:108)
      
      

      I know the script is a bit pointless, but I was just testing and modifying the script bit by bit.
      If I remove the limit in any case I get the same exception but with LOSort.

      The problem, I think, is that the rule assumes there is only 1 sink in the nested block and that this sink is a LOGenerate.

        Activity

        Gianmarco De Francisci Morales created issue -
        Olga Natkovich made changes -
        Field Original Value New Value
        Fix Version/s 0.10 [ 12316246 ]
        Daniel Dai made changes -
        Attachment PIG-2119-1.patch [ 12501122 ]
        Daniel Dai made changes -
        Assignee Daniel Dai [ daijy ]
        Daniel Dai made changes -
        Attachment PIG-2119-1.patch [ 12501122 ]
        Daniel Dai made changes -
        Attachment PIG-2119-1.patch [ 12501123 ]
        Daniel Dai made changes -
        Attachment PIG-2119-1.patch [ 12501123 ]
        Daniel Dai made changes -
        Attachment PIG-2119-1.patch [ 12501124 ]
        Thejas M Nair made changes -
        Affects Version/s 0.9.0 [ 12315191 ]
        Affects Version/s 0.9.1 [ 12317343 ]
        Daniel Dai made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Hadoop Flags Reviewed [ 10343 ]
        Fix Version/s 0.11 [ 12318878 ]
        Resolution Fixed [ 1 ]
        Daniel Dai made changes -
        Fix Version/s 0.9.2 [ 12318248 ]
        Daniel Dai made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Daniel Dai
            Reporter:
            Gianmarco De Francisci Morales
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development