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

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


            // collect all uids used in the filter plan
            Set<Long> uids = collectUidFromExpPlan(filterPlan);

            if( pred instanceof LOCogroup ) {
                LOCogroup cogrp = (LOCogroup)pred;
                if( preds.size() == 1 ) {
                    if( hasAll( (LogicalRelationalOperator)preds.get( 0 ), uids )    ) {
                        // Order by is ok if all UIDs can be found from previous operator.
                        return true;
                    }
                } else if ( 1 == cogrp.getExpressionPlans().get( 0 ).size() && !containUDF( filterPlan ) ) {
                    // Optimization is possible if there is only a single key.
                    // For regular cogroup, we cannot use UIDs to determine if filter can be pushed up.
                    // But if there is no UDF, it's okay, as only UDF can take bag field as input.
                    return true;
                }
View Full Code Here


        }
        return alias;
    }

    LOCogroup createGroupOp() {
        return new LOCogroup( plan );
    }
View Full Code Here

    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);
View Full Code Here

  }

    }

    LOCogroup createGroupOp() {
        return new LOCogroup( plan );
    }
View Full Code Here

    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);
View Full Code Here

            }
        }
    }

    LOCogroup createGroupOp() {
        return new LOCogroup( plan );
    }
View Full Code Here

            // collect all uids used in the filter plan
            Set<Long> uids = collectUidFromExpPlan(filterPlan);

            if( pred instanceof LOCogroup ) {
                LOCogroup cogrp = (LOCogroup)pred;
                if( preds.size() == 1 ) {
                    if( hasAll( (LogicalRelationalOperator)preds.get( 0 ), uids )    ) {
                        // Order by is ok if all UIDs can be found from previous operator.
                        return true;
                    }
                } else if ( 1 == cogrp.getExpressionPlans().get( 0 ).size() && !containUDF( filterPlan ) ) {
                    // Optimization is possible if there is only a single key.
                    // For regular cogroup, we cannot use UIDs to determine if filter can be pushed up.
                    // But if there is no UDF, it's okay, as only UDF can take bag field as input.
                    return true;
                }
View Full Code Here

    }

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

    public class GroupAllParallelSetterTransformer extends Transformer {

        @Override
        public boolean check(OperatorPlan matched) throws FrontendException {
            LOCogroup group = (LOCogroup)matched.getSources().get(0);
            MultiMap<Integer, LogicalExpressionPlan> explPlans =
                group.getExpressionPlans();
            //check if the expression plan consist of just a ConstantExpression
            for(LogicalExpressionPlan ep : explPlans.values()){
                Iterator<Operator> op_iter = ep.getOperators();
                if(op_iter.hasNext()){
                    //return false if the ExpressionOperator is not
View Full Code Here

        public void transform(OperatorPlan plan) throws FrontendException {
            Iterator<Operator> iter = plan.getOperators();
            while (iter.hasNext()) {
                Operator op = iter.next();
                if (op instanceof LOCogroup) {
                    LOCogroup group = (LOCogroup)op;
                    if(group.getRequestedParallelism() > 1){
                        log.warn("Resetting parallism to 1 for the group/cogroup " +
                                group.getAlias() +
                        " as the group by expressions returns a constant");
                    }
                    ((LOCogroup) op).setRequestedParallelism(1);
                }
            }
View Full Code Here

TOP

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

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.