Package org.apache.pig.experimental.logical.relational

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


            ((LogicalRelationalOperator)newPlan.getPredecessors(cogroup).get(1)).getSchema();
       
        Set<Long> uids = getAllUids(loadSchema);
        uids.addAll( getAllUids( load2Schema ) );
       
        LogicalRelationalOperator op = (LogicalRelationalOperator)
            newPlan.getSuccessors( newPlan.getSources().get(0) ).get(0);
        assertEquals( LOCogroup.class, op.getClass() );
        LogicalSchema schema = op.getSchema();
       
        assertEquals( 3, schema.size() );
        assertEquals( DataType.TUPLE, schema.getField(0).type );
        assertEquals( false, uids.contains( schema.getField(0).uid ) );
        assertEquals( 0, schema.getField(0).alias.compareTo("group") );
View Full Code Here


                    return;
                }
               
                // get column numbers from input uids
                Set<Long> input = (Set<Long>)foreach.getAnnotation(ColumnPruneHelper.INPUTUIDS);
                LogicalRelationalOperator op = (LogicalRelationalOperator)foreach.getPlan().getPredecessors(foreach).get(0);
                Set<Integer> cols = columnHelper.getColumns(op.getSchema(), input);
               
                LogicalPlan innerPlan = foreach.getInnerPlan();
                LOGenerate gen = (LOGenerate)innerPlan.getSinks().get(0);
                           
                // clean up the predecessors of LOGenerate
View Full Code Here

    @Override
    protected OperatorPlan buildPattern() {
        // the pattern that this rule looks for
        // is foreach -> filter
        LogicalPlan plan = new LogicalPlan();
        LogicalRelationalOperator foreach = new LOForEach(plan);
        LogicalRelationalOperator filter = new LOFilter(plan);
       
        plan.add(foreach);
        plan.add(filter);
        plan.connect(foreach, filter);
View Full Code Here


                // See if the previous operators have uids from project
                List<Operator> preds = currentPlan.getPredecessors(foreach);           
                for(int j=0; j< preds.size(); j++) {
                    LogicalRelationalOperator logRelOp = (LogicalRelationalOperator)preds.get(j);
                    if (hasAll( logRelOp, uids) ) {
                        forEachPred = (LogicalRelationalOperator) preds.get(j);
                        return true;
                    }
                }
View Full Code Here

            // Get the uid for this projection.  It must match the uid of the
            // value it is projecting.
            long myUid = p.getUid();
           
            // Find the operator this projection references
            LogicalRelationalOperator pred = p.findReferent(currentOp);
           
            // Get the schema for this operator and search it for the matching uid
            int match = -1;
            LogicalSchema schema = pred.getSchema();
            List<LogicalSchema.LogicalFieldSchema> fields = schema.getFields();
            for (int i = 0; i < fields.size(); i++) {
                if (fields.get(i).uid == myUid) {
                    match = i;
                    break;
View Full Code Here

    @Override
    protected OperatorPlan buildPattern() {       
        // the pattern that this rule looks for
        // is filter
        LogicalPlan plan = new LogicalPlan();     
        LogicalRelationalOperator op2 = new LOFilter(plan);
        plan.add(op2);
       
        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 boolean check(OperatorPlan matched) throws IOException {
            Iterator<Operator> iter = matched.getOperators();
            while(iter.hasNext()) {
                LogicalRelationalOperator op = (LogicalRelationalOperator)iter.next();
                if (shouldAdd(op)) {
                    opForAdd = op;
                    return true;
                }
            }
View Full Code Here

    @Override
    protected OperatorPlan buildPattern() {       
        // the pattern that this rule looks for
        // is filter operator
        LogicalPlan plan = new LogicalPlan();
        LogicalRelationalOperator op = new LOFilter(plan);
        plan.add(op);       
       
        return plan;
    }
View Full Code Here

        return col<0;
    }
   
    @Override
    public void setUid(LogicalRelationalOperator currentOp) throws IOException {
        LogicalRelationalOperator referent = findReferent(currentOp);
       
        LogicalSchema schema = referent.getSchema();
        if (schema != null && !isProjectStar()) {
            uid = schema.getField(col).uid;
        } else {
            // If the schema of referent is null, or this is to project the whole tuple,
            // we kindof create a uid so we
View Full Code Here

TOP

Related Classes of org.apache.pig.experimental.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.