Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-4572

Conversion of Pig Latin scripts that contain RANK and FILTER operators fails

    XMLWordPrintableJSON

Details

    Description

      The alias used for RANK is not proper and that causing parameter not found error during conversion.

      A = LOAD 'scott.EMP' as (EMPNO:int, ENAME:chararray,
          JOB:chararray, MGR:int, HIREDATE:datetime, SAL:bigdecimal,
          COMM:bigdecimal, DEPTNO:int);
      B = FOREACH A GENERATE EMPNO, JOB, DEPTNO;
      C = RANK B;
      D = FILTER C by ($0 > 1);
       
          java.lang.IllegalArgumentException: field [rank_B] not found; input fields are: [rank_C, EMPNO, JOB, DEPTNO]
              at org.apache.calcite.piglet.PigRelExVisitor.visit(PigRelExVisitor.java:220)
              at org.apache.pig.newplan.logical.expression.ProjectExpression.accept(ProjectExpression.java:215)
              at org.apache.calcite.piglet.PigRelExWalker.postOrderWalk(PigRelExWalker.java:76)
              at org.apache.calcite.piglet.PigRelExWalker.postOrderWalk(PigRelExWalker.java:73)
              at org.apache.calcite.piglet.PigRelExWalker.walk(PigRelExWalker.java:58)
              at org.apache.calcite.piglet.PigRelExVisitor.translate(PigRelExVisitor.java:123)
              at org.apache.calcite.piglet.PigRelExVisitor.translatePigEx(PigRelExVisitor.java:142)
              at org.apache.calcite.piglet.PigRelExVisitor.translatePigEx(PigRelExVisitor.java:157)
              at org.apache.calcite.piglet.PigRelOpVisitor.visit(PigRelOpVisitor.java:175)
              at org.apache.pig.newplan.logical.relational.LOFilter.accept(LOFilter.java:79)
              at org.apache.calcite.piglet.PigRelOpWalker.postOrderWalk(PigRelOpWalker.java:84)
              at org.apache.calcite.piglet.PigRelOpWalker.walk(PigRelOpWalker.java:62)
              at org.apache.calcite.piglet.PigRelOpVisitor.translate(PigRelOpVisitor.java:133)
              at org.apache.calcite.piglet.PigConverter.pigPlan2Rel(PigConverter.java:198)
              at org.apache.calcite.piglet.PigConverter.pigQuery2Rel(PigConverter.java:157)
              at org.apache.calcite.test.PigRelOpTest$Fluent.assertRel(PigRelOpTest.java:76)
              at org.apache.calcite.test.PigRelOpTest$Fluent.assertRel(PigRelOpTest.java:90)
              at org.apache.calcite.test.PigRelOpTest$Fluent.access$000(PigRelOpTest.java:64)
              at org.apache.calcite.test.PigRelOpTest.testRankAndFilter(PigRelOpTest.java:1628) 

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              maheshk114 mahesh kumar behera
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m