Package org.apache.pig.newplan.logical.relational

Examples of org.apache.pig.newplan.logical.relational.LOForEach


        private List<LogicalExpressionPlan> expPlansToInsertIdentity = new ArrayList<LogicalExpressionPlan>();
       
        @Override
        public boolean check(OperatorPlan matched) throws FrontendException {
           
            LOForEach foreach = (LOForEach)matched.getSources().get(0);
            LOGenerate gen = (LOGenerate)foreach.getInnerPlan().getSinks().get(0);
           
            List<LogicalExpressionPlan> expPlans = gen.getOutputPlans();
            boolean[] flattens = gen.getFlattenFlags();
           
            List<Long> uidSeen = new ArrayList<Long>();
View Full Code Here


        LOStore op = new LOStore( plan, fileSpec );
        return buildOp( loc, op, alias, inputAlias, null );
    }
   
    LOForEach createForeachOp() {
        return new LOForEach( plan );
    }
View Full Code Here

            input = new LOInnerLoad( innerPlan, foreach, projExpr.getColNum() );
            input.setLocation( projExpr.getLocation() );
        }
       
        LogicalPlan lp = new LogicalPlan(); // f's inner plan
        LOForEach f = new LOForEach( innerPlan );
        f.setInnerPlan( lp );
        f.setLocation( loc );
        LOGenerate gen = new LOGenerate( lp );
        boolean[] flatten = new boolean[exprPlans.size()];
       
        List<Operator> innerLoads = new ArrayList<Operator>( exprPlans.size() );
        for( LogicalExpressionPlan plan : exprPlans ) {
View Full Code Here

        "store d into 'output';";

        LogicalPlan newLogicalPlan = migrateAndOptimizePlan( query );
       
        Operator store = newLogicalPlan.getSinks().get( 0 );
        LOForEach foreach = (LOForEach)newLogicalPlan.getPredecessors(store).get(0);
        Assert.assertTrue(foreach.getSchema().getField(1).alias.equals("q1"));
        Assert.assertTrue(foreach.getSchema().getField(2).alias.equals("q2"));
    }
View Full Code Here

    // plan with groupby plan.
    private String convertCubeToFGPlan(SourceLocation loc, LOCube op, String inputAlias,
      List<String> operations, MultiMap<Integer, LogicalExpressionPlan> expressionPlans)
      throws FrontendException {

  LOForEach foreach = new LOForEach(plan);
  LOCogroup groupby = new LOCogroup(plan);
  LogicalPlan innerPlan = new LogicalPlan();
  LogicalRelationalOperator gen = new LOGenerate(innerPlan);

  injectForeachOperator(loc, op, foreach);

  // Get all column attributes from the input relation.
  // Create ProjectExpression for all columns. Based on the
  // dimensions specified by the user, specified columns will be attached
  // to CubeDimension/RollupDimension UDF and rest will be pushed down
  List<Operator> inpOpers = foreach.getPlan().getPredecessors(foreach);
  List<LogicalExpressionPlan> allExprPlan = new ArrayList<LogicalExpressionPlan>();
  for (Operator oper : inpOpers) {
      LogicalSchema schema = new LogicalSchema();
      schema = ((LogicalRelationalOperator) oper).getSchema();
View Full Code Here

    public static String newOperatorKey(String scope) {
        return new OperatorKey( scope, getNextId(scope)).toString();
    }

    LOForEach createForeachOp() {
        return new LOForEach( plan );
    }
View Full Code Here

            }
        }
    }

    static LOForEach createNestedForeachOp(LogicalPlan plan) {
      return new LOForEach(plan);
    }
View Full Code Here

            input = new LOInnerLoad( innerPlan, foreach, projExpr.getColNum() );
            input.setLocation( projExpr.getLocation() );
        }

        LogicalPlan lp = new LogicalPlan(); // f's inner plan
        LOForEach f = new LOForEach( innerPlan );
        f.setInnerPlan( lp );
        f.setLocation( loc );
        LOGenerate gen = new LOGenerate( lp );
        boolean[] flatten = new boolean[exprPlans.size()];

        List<Operator> innerLoads = new ArrayList<Operator>( exprPlans.size() );
        for( LogicalExpressionPlan plan : exprPlans ) {
View Full Code Here

            + "F = LIMIT D C.total/8;"
            + "store F into 'output';";
        LogicalPlan newLogicalPlan = Util.buildLp(pigServer, query);;
        optimizePlan(newLogicalPlan);
        LOStore store = (LOStore)newLogicalPlan.getSinks().get(0);
        LOForEach foreach1 = (LOForEach)newLogicalPlan.getPredecessors(store).get(0);
        LOForEach foreach2 = (LOForEach)newLogicalPlan.getPredecessors(foreach1).get(0);
        LOLimit limit = (LOLimit)newLogicalPlan.getPredecessors(foreach2).get(0);
        Assert.assertTrue(newLogicalPlan.getSoftLinkPredecessors(limit).get(0) instanceof LOStore);
    }
View Full Code Here

    }

    @Override
    protected OperatorPlan buildPattern() {
        LogicalPlan plan = new LogicalPlan();
        LogicalRelationalOperator foreach = new LOForEach(plan);
        plan.add( foreach );
        return plan;
    }
View Full Code Here

TOP

Related Classes of org.apache.pig.newplan.logical.relational.LOForEach

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.