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

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


            LogicalExpressionPlan expPlan = genPlans.get(i);
            List<Operator> expSources = expPlan.getSinks();
           
            for (Operator expSrc : expSources) {
                if (expSrc instanceof ProjectExpression) {
                    LogicalRelationalOperator reference = ((ProjectExpression)expSrc).findReferent();
                    if (branchHeadToRemove.contains(reference)) {
                        genPlansToRemove.add(expPlan);
                    }
                }
            }
View Full Code Here


    @Override
    protected OperatorPlan buildPattern() {
        // the pattern that this rule looks for is load
        LogicalPlan plan = new LogicalPlan();
        LogicalRelationalOperator op;
        if (getOperatorClassName().equals(LOLoad.class.getName()))
            op = new LOLoad(null, null, plan, null);
        else // LOStream
            op = new LOStream(plan, null, null, null);
        plan.add(op);
View Full Code Here

    }
   
    public class TypeCastInserterTransformer extends Transformer {
        @Override
        public boolean check(OperatorPlan matched) throws FrontendException {
            LogicalRelationalOperator op = (LogicalRelationalOperator)matched.getSources().get(0);
            LogicalSchema s = op.getSchema();
            if (s == null) return false;
   
            if (op instanceof LOLoad) {
                if (((LOLoad)op).isCastInserted()) return false;
            }
View Full Code Here

            return sawOne;
        }

        @Override
        public void transform(OperatorPlan matched) throws FrontendException {
            LogicalRelationalOperator op = (LogicalRelationalOperator)matched.getSources().get(0);
            LogicalSchema s = op.getSchema();
            // For every field, build a logical plan.  If the field has a type
            // other than byte array, then the plan will be cast(project).  Else
            // it will just be project.
            LogicalPlan innerPlan = new LogicalPlan();
           
            LOForEach foreach = new LOForEach(currentPlan);
            foreach.setInnerPlan(innerPlan);
            foreach.setAlias(op.getAlias());
           
            // Insert the foreach into the plan and patch up the plan.
            Operator next = currentPlan.getSuccessors(op).get(0);
            currentPlan.insertBetween(op, foreach, next);
           
View Full Code Here

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

    }

    @Override
    protected OperatorPlan buildPattern() {
        LogicalPlan plan = new LogicalPlan();
        LogicalRelationalOperator limit = new LOLimit(plan, 0);
        plan.add(limit);
        return plan;
    }
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

            Map<Integer,Long> generatedInputUids = cg.getGeneratedInputUids();
            for( Map.Entry<Integer, Long> entry : generatedInputUids.entrySet() ) {
                Long uid = entry.getValue();
                if( output.contains(uid) ) {
                    // Hence we need to all the full schema of the bag
                    LogicalRelationalOperator pred =
                        (LogicalRelationalOperator) cg.getPlan().getPredecessors(cg).get(entry.getKey());
                    input.addAll( getAllUids( pred.getSchema() ) );
                }
            }
           
            cg.annotate(INPUTUIDS, input);
        }
View Full Code Here

        }
       
        @Override
        public void visit(LOStream stream) throws FrontendException {
            // Every field is required
            LogicalRelationalOperator pred = (LogicalRelationalOperator)plan.getPredecessors(stream).get(0);

            Set<Long> input = getAllUids(pred.getSchema());

            stream.annotate(INPUTUIDS, input);
        }
View Full Code Here

           
            Set<Long> input = (Set<Long>)gen.getAnnotation(INPUTUIDS);
           
            // Make sure at least one column will retain
            if (input.isEmpty()) {
                LogicalRelationalOperator pred = (LogicalRelationalOperator)plan.getPredecessors(foreach).get(0);
                if (pred.getSchema()!=null)
                    input.add(pred.getSchema().getField(0).uid);
            }
            foreach.annotate(INPUTUIDS, input);
        }
View Full Code Here

TOP

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

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.