Package org.apache.pig.newplan.logical.expression

Examples of org.apache.pig.newplan.logical.expression.BinaryExpression


    // we will visit the leaf and it will recursively walk the plan
    LogicalExpression leaf = (LogicalExpression)plan.getSources().get( 0 );
    // if the leaf is a unary operator it should be a FilterFunc in
    // which case we don't try to extract partition filter conditions
    if(leaf instanceof BinaryExpression) {
      BinaryExpression binExpr = (BinaryExpression)leaf;
      visit( binExpr );
      replaceChild( binExpr );
      // if the entire expression is to be removed, then the above
      // replaceChild will not set sawKey to false (sawKey is set to
      // false only in replaceChild()
View Full Code Here


            return new Expression.Column(fieldName);
        } else {
      if( !( op instanceof BinaryExpression ) ) {
        throwException();
      }
      BinaryExpression binOp = (BinaryExpression)op;
      if(binOp instanceof AddExpression) {
        return getExpression( binOp, OpType.OP_PLUS );
      } else if(binOp instanceof SubtractExpression) {
        return getExpression(binOp, OpType.OP_MINUS);
      } else if(binOp instanceof MultiplyExpression) {
View Full Code Here

        // if the leaf is a unary operator it should be a FilterFunc in
        // which case we don't try to extract partition filter conditions
        if(leaf instanceof BinaryExpression) {
            // recursively traverse the tree bottom up
            // checkPushdown returns KeyState which is pair of LogicalExpression
            BinaryExpression binExpr = (BinaryExpression)leaf;
            KeyState finale = checkPushDown(binExpr);
            this.filterExpr = finale.filterExpr;
            this.pushdownExpr = getExpression(finale.pushdownExpr);
        }
    }
View Full Code Here

        } else {
            if( !( op instanceof BinaryExpression ) ) {
                LOG.error("Unsupported conversion of LogicalExpression to Expression: " + op.getName());
                throw new FrontendException("Unsupported conversion of LogicalExpression to Expression: " + op.getName());
            }
            BinaryExpression binOp = (BinaryExpression)op;
            if(binOp instanceof AddExpression) {
                return getExpression( binOp, OpType.OP_PLUS );
            } else if(binOp instanceof SubtractExpression) {
                return getExpression(binOp, OpType.OP_MINUS);
            } else if(binOp instanceof MultiplyExpression) {
View Full Code Here

        // if the leaf is a unary operator it should be a FilterFunc in
        // which case we don't try to extract partition filter conditions
        if(leaf instanceof BinaryExpression) {
            // recursively traverse the tree bottom up
            // checkPushdown returns KeyState which is pair of LogicalExpression
            BinaryExpression binExpr = (BinaryExpression)leaf;
            KeyState finale = checkPushDown(binExpr);
            this.filterExpr = finale.filterExpr;
            this.pushdownExpr = getExpression(finale.pushdownExpr);
        }
    }
View Full Code Here

        } else if (op instanceof ProjectExpression) {
            ProjectExpression projExpr = (ProjectExpression)op;
            String fieldName = projExpr.getFieldSchema().alias;
            return new Expression.Column(fieldName);
        } else if(op instanceof BinaryExpression) {
            BinaryExpression binOp = (BinaryExpression)op;
            if(binOp instanceof AddExpression) {
                return getExpression( binOp, OpType.OP_PLUS );
            } else if(binOp instanceof SubtractExpression) {
                return getExpression(binOp, OpType.OP_MINUS);
            } else if(binOp instanceof MultiplyExpression) {
View Full Code Here

        // if the leaf is a unary operator it should be a FilterFunc in
        // which case we don't try to extract partition filter conditions
        if(leaf instanceof BinaryExpression) {
            // recursively traverse the tree bottom up
            // checkPushdown returns KeyState which is pair of LogicalExpression
            BinaryExpression binExpr = (BinaryExpression)leaf;
            KeyState finale = checkPushDown(binExpr);
            this.filterExpr = finale.filterExpr;
            this.pushdownExpr = getExpression(finale.pushdownExpr);
        }
    }
View Full Code Here

        } else {
            if( !( op instanceof BinaryExpression ) ) {
                LOG.error("Unsupported conversion of LogicalExpression to Expression: " + op.getName());
                throw new FrontendException("Unsupported conversion of LogicalExpression to Expression: " + op.getName());
            }
            BinaryExpression binOp = (BinaryExpression)op;
            if(binOp instanceof AddExpression) {
                return getExpression( binOp, OpType.OP_PLUS );
            } else if(binOp instanceof SubtractExpression) {
                return getExpression(binOp, OpType.OP_MINUS);
            } else if(binOp instanceof MultiplyExpression) {
View Full Code Here

        // we will visit the leaf and it will recursively walk the plan
        LogicalExpression leaf = (LogicalExpression)plan.getSources().get( 0 );
        // if the leaf is a unary operator it should be a FilterFunc in
        // which case we don't try to extract partition filter conditions
        if(leaf instanceof BinaryExpression) {
            BinaryExpression binExpr = (BinaryExpression)leaf;
            visit( binExpr );
            replaceChild( binExpr );
            // if the entire expression is to be removed, then the above
            // replaceChild will not set sawKey to false (sawKey is set to
            // false only in replaceChild()
View Full Code Here

        } else {
            if( !( op instanceof BinaryExpression ) ) {
                logInternalErrorAndSetFlag();
                return null;
            }
            BinaryExpression binOp = (BinaryExpression)op;
            if(binOp instanceof AddExpression) {
                return getExpression( binOp, OpType.OP_PLUS );
            } else if(binOp instanceof SubtractExpression) {
                return getExpression(binOp, OpType.OP_MINUS);
            } else if(binOp instanceof MultiplyExpression) {
View Full Code Here

TOP

Related Classes of org.apache.pig.newplan.logical.expression.BinaryExpression

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.