Package org.apache.phoenix.expression

Examples of org.apache.phoenix.expression.ComparisonExpression


                if (lhsMaxLength != null && lhsMaxLength != rhsLiteral.length()) {
                    return LiteralExpression.newConstant(false, rhs.isDeterministic());
                }
                CompareOp op = node.isNegate() ? CompareOp.NOT_EQUAL : CompareOp.EQUAL;
                if (pattern.equals(rhsLiteral)) {
                    return new ComparisonExpression(op, children);
                } else {
                    rhs = LiteralExpression.newConstant(rhsLiteral, PDataType.CHAR, rhs.isDeterministic());
                    return new ComparisonExpression(op, Arrays.asList(lhs,rhs));
                }
            }
        }
        Expression expression = new LikeExpression(children);
        if (ExpressionUtil.isConstant(expression)) {
View Full Code Here


    public static BigDecimal computeAverage(long sum, long count) {
        return BigDecimal.valueOf(sum).divide(BigDecimal.valueOf(count), PDataType.DEFAULT_MATH_CONTEXT);
    }

    public static Expression constantComparison(CompareOp op, PColumn c, Object o) {
        return  new ComparisonExpression(op, Arrays.<Expression>asList(new KeyValueColumnExpression(c), LiteralExpression.newConstant(o)));
    }
View Full Code Here

    public static Expression pkColumn(PColumn c, List<PColumn> columns) {
        return new RowKeyColumnExpression(c, new RowKeyValueAccessor(columns, columns.indexOf(c)));
    }

    public static Expression constantComparison(CompareOp op, Expression e, Object o) {
        return  new ComparisonExpression(op, Arrays.asList(e, LiteralExpression.newConstant(o)));
    }
View Full Code Here

    public static Expression substr(Expression e, Object offset, Object length) {
        return  new SubstrFunction(Arrays.asList(e, LiteralExpression.newConstant(offset), LiteralExpression.newConstant(length)));
    }

    public static Expression columnComparison(CompareOp op, Expression c1, Expression c2) {
        return  new ComparisonExpression(op, Arrays.<Expression>asList(c1, c2));
    }
View Full Code Here

                default:
                    break;
                }
            }
        }
        return new ComparisonExpression(node.getFilterOp(), children);
    }
View Full Code Here

                if (lhsByteSize != null && lhsByteSize != rhsLiteral.length()) {
                    return LiteralExpression.FALSE_EXPRESSION;
                }
                CompareOp op = node.isNegate() ? CompareOp.NOT_EQUAL : CompareOp.EQUAL;
                if (pattern.equals(rhsLiteral)) {
                    return new ComparisonExpression(op, children);
                } else {
                    rhs = LiteralExpression.newConstant(rhsLiteral, PDataType.CHAR);
                    return new ComparisonExpression(op, Arrays.asList(lhs,rhs));
                }
            }
        }
        Expression expression = new LikeExpression(children);
        if (node.isConstant()) {
View Full Code Here

    public static BigDecimal computeAverage(long sum, long count) {
        return BigDecimal.valueOf(sum).divide(BigDecimal.valueOf(count), PDataType.DEFAULT_MATH_CONTEXT);
    }

    public static Expression constantComparison(CompareOp op, PColumn c, Object o) {
        return  new ComparisonExpression(op, Arrays.<Expression>asList(new KeyValueColumnExpression(c), LiteralExpression.newConstant(o)));
    }
View Full Code Here

    public static Expression pkColumn(PColumn c, List<PColumn> columns) {
        return new RowKeyColumnExpression(c, new RowKeyValueAccessor(columns, columns.indexOf(c)));
    }

    public static Expression constantComparison(CompareOp op, Expression e, Object o) {
        return  new ComparisonExpression(op, Arrays.asList(e, LiteralExpression.newConstant(o)));
    }
View Full Code Here

    public static Expression constantComparison(CompareOp op, Expression e, Object o) {
        return  new ComparisonExpression(op, Arrays.asList(e, LiteralExpression.newConstant(o)));
    }

    public static Expression columnComparison(CompareOp op, PColumn c1, PColumn c2) {
        return  new ComparisonExpression(op, Arrays.<Expression>asList(new KeyValueColumnExpression(c1), new KeyValueColumnExpression(c2)));
    }
View Full Code Here

    public void testCollapseAnd() throws SQLException {
        String tenantId = "000000000000001";
        String query = "select * from atable where organization_id='" + tenantId + "' and a_integer=0";
        Expression where = compileStatement(query);
        assertTrue(where instanceof ComparisonExpression);
        ComparisonExpression child = (ComparisonExpression)where;
        assertEquals(CompareOp.EQUAL, child.getFilterOp());
        assertTrue(child.getChildren().get(0) instanceof KeyValueColumnExpression);
        assertTrue(child.getChildren().get(1) instanceof LiteralExpression);
    }
View Full Code Here

TOP

Related Classes of org.apache.phoenix.expression.ComparisonExpression

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.