Package org.apache.pig.experimental.logical.expression

Examples of org.apache.pig.experimental.logical.expression.LogicalExpressionPlan


    public LOInnerLoad(OperatorPlan plan, LOForEach foreach, int colNum) {
        super("LOInnerLoad", plan);       
       
        // store column number as a ProjectExpression in a plan
        // to be able to dynamically adjust column number during optimization
        LogicalExpressionPlan exp = new LogicalExpressionPlan();
       
        // we don't care about type, so set to -1
        prj = new ProjectExpression(exp, (byte)-1, 0, colNum);
        this.foreach = foreach;
    }
View Full Code Here


       
        for( int i = 0; i < inputs.size(); i++ ) {
            ArrayList<LogicalPlan> plans =
                (ArrayList<LogicalPlan>) cg.getGroupByPlans().get(inputs.get(i));
            for( LogicalPlan plan : plans ) {
                LogicalExpressionPlan expPlan = translateExpressionPlan(plan);
                newExpressionPlans.put(Integer.valueOf(i), expPlan);
            }
        }

        org.apache.pig.experimental.logical.relational.LOCogroup newCogroup =
View Full Code Here

   
    public void visit(LOFilter filter) throws VisitorException {
        org.apache.pig.experimental.logical.relational.LOFilter newFilter = new org.apache.pig.experimental.logical.relational.LOFilter(logicalPlan);
       
        LogicalPlan filterPlan = filter.getComparisonPlan();
        LogicalExpressionPlan newFilterPlan = translateExpressionPlan(filterPlan);
     
        newFilter.setFilterPlan(newFilterPlan);
        newFilter.setAlias(filter.getAlias());
        newFilter.setRequestedParallelism(filter.getRequestedParallelism());
       
View Full Code Here

    public void visit(LOSplitOutput splitOutput) throws VisitorException {
        org.apache.pig.experimental.logical.relational.LOSplitOutput newSplitOutput =
            new org.apache.pig.experimental.logical.relational.LOSplitOutput(logicalPlan);
       
        LogicalPlan filterPlan = splitOutput.getConditionPlan();
        LogicalExpressionPlan newFilterPlan = translateExpressionPlan(filterPlan);
     
        newSplitOutput.setFilterPlan(newFilterPlan);
        newSplitOutput.setAlias(splitOutput.getAlias());
        newSplitOutput.setRequestedParallelism(splitOutput.getRequestedParallelism());
       
View Full Code Here

    @Override
    public void visitLOInnerLoad(LOInnerLoad load) throws IOException {
        // the expression in LOInnerLoad contains info relative from LOForEach
        // so use LOForeach as currentOp
        currentOp = load.getLOForEach();
        LogicalExpressionPlan exp = (LogicalExpressionPlan)load.getProjection().getPlan();
      
        LogicalExpressionVisitor v = getVisitor(exp);
        v.visit();      
    }
View Full Code Here

         * @return Set of uid
         */
        private Set<Long> getFilterProjectionUids( LOFilter filter ) {
            Set<Long> uids = new HashSet<Long>();
            if( filter != null ) {
                LogicalExpressionPlan filterPlan = filter.getFilterPlan();
                Iterator<Operator> iter = filterPlan.getOperators();           
                Operator op = null;
                while( iter.hasNext() ) {
                    op = iter.next();
                    if( op instanceof ProjectExpression ) {
                        uids.add(((ProjectExpression)op).getUid() );
View Full Code Here

        private OperatorSubPlan subPlan;

        @Override
        public boolean check(OperatorPlan matched) throws IOException {
            LOFilter filter = (LOFilter)matched.getSources().get(0);
            LogicalExpressionPlan cond = filter.getFilterPlan();
            LogicalExpression root = (LogicalExpression) cond.getSources().get(0);
            if (root instanceof AndExpression) {
                return true;
            }
           
            return false;
View Full Code Here

        public void transform(OperatorPlan matched) throws IOException {
            subPlan = new OperatorSubPlan(currentPlan);
           
            // split one LOFilter into 2 by "AND"
            LOFilter filter = (LOFilter)matched.getSources().get(0);
            LogicalExpressionPlan cond = filter.getFilterPlan();
            LogicalExpression root = (LogicalExpression) cond.getSources().get(0);
            if (!(root instanceof AndExpression)) {
                return;
            }
            LogicalExpressionPlan op1 = new LogicalExpressionPlan();
            op1.add((LogicalExpression)cond.getSuccessors(root).get(0));
            fillSubPlan(cond, op1, (LogicalExpression)cond.getSuccessors(root).get(0));
           
            LogicalExpressionPlan op2 = new LogicalExpressionPlan();
            op2.add((LogicalExpression)cond.getSuccessors(root).get(1));
            fillSubPlan(cond, op2, (LogicalExpression)cond.getSuccessors(root).get(1));
           
            filter.setFilterPlan(op1);
            LOFilter filter2 = new LOFilter((LogicalPlan)currentPlan, op2);
            currentPlan.add(filter2);
View Full Code Here

           
            // the input uids contains all the output uids and
            // projections in filter conditions
            Set<Long> input = new HashSet<Long>(output);
           
            LogicalExpressionPlan exp = filter.getFilterPlan();
            collectUids(filter, exp, input);
           
            filter.annotate(INPUTUIDS, input);
        }
View Full Code Here

            Set<Long> input = new HashSet<Long>(output);
           
            Collection<LogicalExpressionPlan> exps = join.getExpressionPlans();
            Iterator<LogicalExpressionPlan> iter = exps.iterator();
            while(iter.hasNext()) {
                LogicalExpressionPlan exp = iter.next();
                collectUids(join, exp, input);
            }
           
            join.annotate(INPUTUIDS, input);
        }
View Full Code Here

TOP

Related Classes of org.apache.pig.experimental.logical.expression.LogicalExpressionPlan

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.