Package org.apache.phoenix.expression

Examples of org.apache.phoenix.expression.Expression.evaluate()


    }
   
    @Override
    public boolean evaluate(Tuple tuple, ImmutableBytesWritable ptr) {
        Expression child = children.get(0);
        if (!child.evaluate(tuple, ptr)) {
            return false;
        }
        if (ptr.getLength() == 0) {
            return true;
        }
View Full Code Here


    }
   
    @Override
    public boolean evaluate(Tuple tuple, ImmutableBytesWritable ptr) {
        Expression child = children.get(0);
        if (!child.evaluate(tuple, ptr)) {
            return false;
        }
        if (ptr.getLength() == 0) {
            return true;
        }
View Full Code Here

            if (postFilter != null) {
                for (Iterator<Tuple> iter = resultQueue.iterator(); iter.hasNext();) {
                    Tuple t = iter.next();
                    ImmutableBytesWritable tempPtr = new ImmutableBytesWritable();
                    try {
                        if (!postFilter.evaluate(t, tempPtr)) {
                            iter.remove();
                            continue;
                        }
                    } catch (IllegalDataException e) {
                        iter.remove();
View Full Code Here

     * Left pads a string with with the given fill expression.
     */
    @Override
    public boolean evaluate(Tuple tuple, ImmutableBytesWritable ptr) {
        Expression outputStrLenExpr = getOutputStrLenExpr();
        if (!outputStrLenExpr.evaluate(tuple, ptr)) {
            return false;
        }
        int outputStrLen = outputStrLenExpr.getDataType().getCodec().decodeInt(ptr, outputStrLenExpr.getSortOrder());
        if (outputStrLen < 0) {
            return false;
View Full Code Here

        if (outputStrLen < 0) {
            return false;
        }

        Expression strExp = getStrExpr();
        if (!strExp.evaluate(tuple, ptr)) {
            return false;
        }

        boolean isStrCharType = getStrExpr().getDataType() == PDataType.CHAR;
        boolean isFillCharType = getFillExpr().getDataType() == PDataType.CHAR;
View Full Code Here

        }

        // left pad the input string with the fill chars
        Expression fillExpr = getFillExpr();
        ImmutableBytesWritable fillPtr = new ImmutableBytesWritable();
        if (!fillExpr.evaluate(tuple, fillPtr)) {
            return false;
        }
        int fillExprLen = fillPtr.getLength();
        if (fillExprLen < 1) {
            // return if fill is empty
View Full Code Here

            for (int i = 0; i < targetColumns.size(); i++) {
                PColumn targetColumn = targetColumns.get(i);
                if (overlapViewColumns.contains(targetColumn)) {
                    Expression source = projector.getColumnProjector(i).getExpression();
                    if (source.isStateless()) {
                        source.evaluate(null, ptr);
                        if (Bytes.compareTo(ptr.get(), ptr.getOffset(), ptr.getLength(), targetColumn.getViewConstant(), 0, targetColumn.getViewConstant().length-1) == 0) {
                            continue;
                        }
                    }
                    throw new SQLExceptionInfo.Builder(
View Full Code Here

    }

    @Override
    public boolean evaluate(Tuple tuple, ImmutableBytesWritable ptr) {
        Expression arg = getChildren().get(0);
        if (!arg.evaluate(tuple, ptr)) {
            return false;
        }

        int targetOffset = ptr.getLength();
        if (targetOffset == 0) {
View Full Code Here

  }

  @Override
  public boolean evaluate(Tuple tuple, ImmutableBytesWritable ptr) {
    Expression indexExpr = children.get(1);
    if (!indexExpr.evaluate(tuple, ptr)) {
      return false;
    } else if (ptr.getLength() == 0) {
      return true;
    }
    // Use Codec to prevent Integer object allocation
View Full Code Here

    }

    @Override
    public boolean evaluate(Tuple tuple, ImmutableBytesWritable ptr) {
        Expression numExpr = getNumExpr();
        if (!numExpr.evaluate(tuple, ptr)) {
            return false;
        }
        long num = numExpr.getDataType().getCodec().decodeLong(ptr, numExpr.getSortOrder());
       
        Expression encodingExpression = getEncodingExpr();
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.