Examples of LogicalRelationalOperator


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

            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

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

    @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

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

    }

    @Override
    protected OperatorPlan buildPattern() {
        LogicalPlan plan = new LogicalPlan();
        LogicalRelationalOperator limit = new LOLimit(plan, 0);
        plan.add(limit);
        return plan;
    }
View Full Code Here

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

    }

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

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

            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

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

        }
       
        @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

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

           
            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

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

                if (op instanceof ProjectExpression) {
                    if (!((ProjectExpression)op).isProjectStar()) {
                        long uid = ((ProjectExpression)op).getFieldSchema().uid;
                        uids.add(uid);
                    } else {
                        LogicalRelationalOperator ref = ((ProjectExpression)op).findReferent();
                        LogicalSchema s = ref.getSchema();
                        if (s == null) {
                            throw new SchemaNotDefinedException("Schema not defined for " + ref.getAlias());
                        }
                        for(LogicalFieldSchema f: s.getFields()) {
                            uids.add(f.uid);
                        }
                    }
View Full Code Here

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

            // if this is a ReadScalars udf for scalar operation, use the
            // FieldSchema corresponding to this position in input
            List<Operator> args = plan.getSuccessors(this);
            if(args != null && args.size() > 0 ){
                int pos = (Integer)((ConstantExpression)args.get(0)).getValue();
                LogicalRelationalOperator inp = (LogicalRelationalOperator)implicitReferencedOperator;

                if( inp.getSchema() != null){
                    LogicalFieldSchema inpFs = inp.getSchema().getField(pos);
                    fieldSchema = new LogicalFieldSchema(inpFs);
                    //  fieldSchema.alias = "ReadScalars_" + fieldSchema.alias;
                }else{
                    fieldSchema = new LogicalFieldSchema(null, null, DataType.BYTEARRAY);
                }
View Full Code Here

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

    }

    @Override
    protected OperatorPlan buildPattern() {       
        LogicalPlan plan = new LogicalPlan();
        LogicalRelationalOperator op1 = new LOFilter(plan);
        plan.add( op1 );
       
        return plan;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.