Package org.apache.pig.backend.hadoop.executionengine.physicalLayer

Examples of org.apache.pig.backend.hadoop.executionengine.physicalLayer.Result


    }

    @Override
    public Result getNext(Boolean bool) throws ExecException {
        byte status;
        Result left, right;

        switch (operandType) {
        case DataType.BYTEARRAY: {
            Result r = accumChild(null, dummyDBA);
            if (r != null) {
                return r;
            }
            left = lhs.getNext(dummyDBA);
            right = rhs.getNext(dummyDBA);
            return doComparison(left, right);
                            }

        case DataType.DOUBLE: {
            Result r = accumChild(null, dummyDouble);
            if (r != null) {
                return r;
            }
            left = lhs.getNext(dummyDouble);
            right = rhs.getNext(dummyDouble);
            return doComparison(left, right);
                            }

        case DataType.FLOAT: {
            Result r = accumChild(null, dummyFloat);
            if (r != null) {
                return r;
            }
            left = lhs.getNext(dummyFloat);
            right = rhs.getNext(dummyFloat);
            return doComparison(left, right);
                            }

        case DataType.INTEGER: {
            Result r = accumChild(null, dummyInt);
            if (r != null) {
                return r;
            }
            left = lhs.getNext(dummyInt);
            right = rhs.getNext(dummyInt);
            return doComparison(left, right);
                            }

        case DataType.LONG: {
            Result r = accumChild(null, dummyLong);
            if (r != null) {
                return r;
            }
            left = lhs.getNext(dummyLong);
            right = rhs.getNext(dummyLong);
            return doComparison(left, right);
                            }

        case DataType.CHARARRAY: {
            Result r = accumChild(null, dummyString);
            if (r != null) {
                return r;
            }
            left = lhs.getNext(dummyString);
            right = rhs.getNext(dummyString);
View Full Code Here


        return "Or" + "[" + DataType.findTypeName(resultType) + "]" +" - " + mKey.toString();
    }

    @Override
    public Result getNext(Boolean b) throws ExecException {
        Result r = accumChild(null, dummyBool);
        if (r != null) {
            return r;
        }
       
        Result left;
        left = lhs.getNext(dummyBool);
        // pass on ERROR and EOP
        if(left.returnStatus != POStatus.STATUS_OK && left.returnStatus != POStatus.STATUS_NULL) {
            return left;
        }
       
        // truth table for OR
        // t = true, n = null, f = false
        //    OR   t n f
        // 1) t    t t t
        // 2) n    t n n
        // 3) f    t n f
       
        // Short circuit. if lhs is true, return true - ROW 1 above is handled with this
        if (left.result != null && ((Boolean)left.result).booleanValue()) return left;
       
        Result right = rhs.getNext(dummyBool);
        // pass on ERROR and EOP
        if(right.returnStatus != POStatus.STATUS_OK && right.returnStatus != POStatus.STATUS_NULL) {
            return right;
        }
       
View Full Code Here

    }

    @Override
    public Result getNext(Boolean bool) throws ExecException {
        byte status;
        Result left, right;

        switch (operandType) {
        case DataType.BYTEARRAY: {
            Result r = accumChild(null, dummyDBA);
            if (r != null) {
                return r;
            }
            left = lhs.getNext(dummyDBA);
            right = rhs.getNext(dummyDBA);
            return doComparison(left, right);
                            }

        case DataType.DOUBLE: {
            Result r = accumChild(null, dummyDouble);
            if (r != null) {
                return r;
            }
            left = lhs.getNext(dummyDouble);
            right = rhs.getNext(dummyDouble);
            return doComparison(left, right);
                            }

        case DataType.FLOAT: {
            Result r = accumChild(null, dummyFloat);
            if (r != null) {
                return r;
            }
            left = lhs.getNext(dummyFloat);
            right = rhs.getNext(dummyFloat);
            return doComparison(left, right);
                            }

        case DataType.INTEGER: {
            Result r = accumChild(null, dummyInt);
            if (r != null) {
                return r;
            }
            left = lhs.getNext(dummyInt);
            right = rhs.getNext(dummyInt);
            return doComparison(left, right);
                            }

        case DataType.LONG: {
            Result r = accumChild(null, dummyLong);
            if (r != null) {
                return r;
            }
            left = lhs.getNext(dummyLong);
            right = rhs.getNext(dummyLong);
            return doComparison(left, right);
                            }

        case DataType.CHARARRAY: {
            Result r = accumChild(null, dummyString);
            if (r != null) {
                return r;
            }
            left = lhs.getNext(dummyString);
            right = rhs.getNext(dummyString);
            return doComparison(left, right);
                            }
        case DataType.TUPLE: {
            Result r = accumChild(null, dummyTuple);
            if (r != null) {
                return r;
            }
            left = lhs.getNext(dummyTuple);
            right = rhs.getNext(dummyTuple);
            return doComparison(left, right);
                            }
       
        case DataType.MAP: {
            Result r = accumChild(null, dummyMap);
            if (r != null) {
                return r;
            }
            left = lhs.getNext(dummyMap);
            right = rhs.getNext(dummyMap);
View Full Code Here

        sendEmptyBagOnEOP = true;
    }
   
    @Override
    public Result getNext(DataBag db) throws ExecException {
        Result input = processInputBag();
       
        // if this is called during accumulation, it is ok to have an empty bag
        // we need to send STATUS_OK so that the UDF can be called.
        if (isAccumulative()) {
            reset();
        }
       
        if(input.returnStatus!=POStatus.STATUS_OK) {
            if(input.returnStatus == POStatus.STATUS_EOP && sendEmptyBagOnEOP)  {
                // we received an EOP from the predecessor
                // since the successor in the pipeline is
                // expecting a bag, send an empty bag
                input.result = new NonSpillableDataBag();
                input.returnStatus = POStatus.STATUS_OK;
                // we should send EOP the next time we are called
                // if the foreach in which this operator is present
                // calls this.getNext(bag) with new inputs then
                // this flag will be reset in this.reset()
            } else {
                // since we are sending down some result (empty bag or otherwise)
                // we should not be sending an empty bag on EOP any more UNLESS
                // we are processing new inputs (see reset())
                sendEmptyBagOnEOP = false;
                return input;
            }
        }
        Result r = consumeInputBag(input);
        // since we are sending down some result (empty bag or otherwise)
        // we should not be sending an empty bag on EOP any more UNLESS
        // we are processing new inputs (see reset())
        sendEmptyBagOnEOP = false;
        return(r);
View Full Code Here

        ((RegexInit)this.impl).setConstExpr(rhsConstant);
    }

    @Override
    public Result getNext(Boolean bool) throws ExecException {
        Result r = accumChild(null, dummyString);
        if (r != null) {
            return r;
        }
       
        Result left, right;

        left = lhs.getNext(dummyString);
        right = rhs.getNext(dummyString);

        if (trueRef == null) initializeRefs();
View Full Code Here

    }

    @Override
    public Result getNext(Boolean b) throws ExecException {
       
        Result res = null;
        switch(operandType) {
        case DataType.BYTEARRAY:
            res = expr.getNext(dummyDBA);
            if(res.returnStatus == POStatus.STATUS_OK) {
                if (res.result == null) {
View Full Code Here

    }

    @Override
    public Result getNext(Boolean bool) throws ExecException {
        byte status;
        Result left, right;

        switch (operandType) {
        case DataType.BYTEARRAY: {
            Result r = accumChild(null, dummyDBA);
            if (r != null) {
                return r;
            }
            left = lhs.getNext(dummyDBA);
            right = rhs.getNext(dummyDBA);
            return doComparison(left, right);
                            }

        case DataType.DOUBLE: {
            Result r = accumChild(null, dummyDouble);
            if (r != null) {
                return r;
            }
            left = lhs.getNext(dummyDouble);
            right = rhs.getNext(dummyDouble);
            return doComparison(left, right);
                            }

        case DataType.FLOAT: {
            Result r = accumChild(null, dummyFloat);
            if (r != null) {
                return r;
            }
            left = lhs.getNext(dummyFloat);
            right = rhs.getNext(dummyFloat);
            return doComparison(left, right);
                            }

        case DataType.INTEGER: {
            Result r = accumChild(null, dummyInt);
            if (r != null) {
                return r;
            }
            left = lhs.getNext(dummyInt);
            right = rhs.getNext(dummyInt);
            return doComparison(left, right);
                            }

        case DataType.LONG: {
            Result r = accumChild(null, dummyLong);
            if (r != null) {
                return r;
            }
            left = lhs.getNext(dummyLong);
            right = rhs.getNext(dummyLong);
            return doComparison(left, right);
                            }

        case DataType.CHARARRAY: {
            Result r = accumChild(null, dummyString);
            if (r != null) {
                return r;
            }
            left = lhs.getNext(dummyString);
            right = rhs.getNext(dummyString);
            return doComparison(left, right);
                            }

        case DataType.TUPLE: {
            Result r = accumChild(null, dummyTuple);
            if (r != null) {
                return r;
            }
            left = lhs.getNext(dummyTuple);
            right = rhs.getNext(dummyTuple);
            return doComparison(left, right);
                            }
       
        case DataType.MAP: {
            Result r = accumChild(null, dummyMap);
            if (r != null) {
                return r;
            }
            left = lhs.getNext(dummyMap);
            right = rhs.getNext(dummyMap);
View Full Code Here

        return func;
    }
   
    @Override
    public Result getNext(Integer i) throws ExecException {
        Result result = new Result();

        result.result = func.compare(t1, t2);
        result.returnStatus = (t1 != null && t2 != null) ? POStatus.STATUS_OK
                : POStatus.STATUS_ERR;
        // the two attached tuples are used up now. So we set the
View Full Code Here

        return result;

    }
   
    private Result getNext() {
        Result res = null;
        log.error("getNext being called with non-integer");
        return res;
    }
View Full Code Here

     * column
     * @return next value.
     * @throws ExecException
     */
    public Result getNext() throws ExecException{
        Result res = processInput();
        Tuple inpValue = (Tuple)res.result;

        Object ret;
        if(res.returnStatus != POStatus.STATUS_OK){
            return res;
View Full Code Here

TOP

Related Classes of org.apache.pig.backend.hadoop.executionengine.physicalLayer.Result

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.