Package org.voltdb.expressions

Examples of org.voltdb.expressions.OperatorExpression


            AbstractExpression expr = new ComparisonExpression(ExpressionType.COMPARE_EQUAL,
                    idxExpr, (AbstractExpression) m_searchkeyExpressions.get(i).clone());
            exprs.add(expr);
        }
        AbstractExpression nullExpr = indexedExprs.get(nextKeyIndex);
        AbstractExpression expr = new OperatorExpression(ExpressionType.OPERATOR_IS_NULL, nullExpr, null);
        exprs.add(expr);

        m_skip_null_predicate = ExpressionUtil.combine(exprs);
        m_skip_null_predicate.finalizeValueTypes();
    }
View Full Code Here


            expr = new ComparisonExpression(ExpressionType.COMPARE_EQUAL,
                    idxExpr, (AbstractExpression) m_searchkeyExpressions.get(i).clone());
            exprs.add(expr);
        }
        AbstractExpression nullExpr = indexedExprs.get(nextKeyIndex);
        expr = new OperatorExpression(ExpressionType.OPERATOR_IS_NULL, nullExpr, null);
        exprs.add(expr);
        m_skip_null_predicate = ExpressionUtil.combine(exprs);
        m_skip_null_predicate.finalizeValueTypes();
    }
View Full Code Here

        proj_schema.addColumn(new SchemaColumn(TABLE1, TABLE1, COLS[3], COLS[3],
                                               col3_exp));
        cols[2] = COLS[3];

        // update column 4 with a sum of columns 0 and 2
        OperatorExpression col4_exp = new OperatorExpression();
        col4_exp.setValueType(COLTYPES[4]);
        col4_exp.setValueSize(COLTYPES[4].getLengthInBytesForFixedTypes());
        col4_exp.setExpressionType(ExpressionType.OPERATOR_PLUS);
        TupleValueExpression left = new TupleValueExpression(TABLE1, TABLE1, COLS[0], COLS[0]);
        left.setValueType(COLTYPES[0]);
        left.setValueSize(COLTYPES[0].getLengthInBytesForFixedTypes());
        TupleValueExpression right = new TupleValueExpression(TABLE1, TABLE1, COLS[2], COLS[2]);
        right.setValueType(COLTYPES[2]);
        right.setValueSize(COLTYPES[2].getLengthInBytesForFixedTypes());
        col4_exp.setLeft(left);
        col4_exp.setRight(right);
        proj_schema.addColumn(new SchemaColumn(TABLE1, TABLE1, COLS[4], "C1",
                                               col4_exp));
        cols[3] = COLS[4];

        ProjectionPlanNode proj_node = new ProjectionPlanNode();
View Full Code Here

            if (hasLimitOrOffsetParameters()) {
                AbstractExpression left = getParameterOrConstantAsExpression(m_offsetParameterId, m_offset);
                assert (left != null);
                AbstractExpression right = getParameterOrConstantAsExpression(m_limitParameterId, m_limit);
                assert (right != null);
                OperatorExpression expr = new OperatorExpression(ExpressionType.OPERATOR_PLUS, left, right);
                expr.setValueType(VoltType.INTEGER);
                expr.setValueSize(VoltType.INTEGER.getLengthInBytesForFixedTypes());
                m_limitNodeDist.setLimitExpression(expr);
            }
            // else let the parameterized forms of offset/limit default to unused/invalid.
        }
    }
View Full Code Here

                // as required by the comparison filter, so construct a NOT NULL comparator and
                // add to post-filter
                // TODO: Implement an abstract isNullable() method on AbstractExpression and use
                // that here to optimize out the "NOT NULL" comparator for NOT NULL columns
                if (startingBoundExpr == null) {
                    AbstractExpression newComparator = new OperatorExpression(ExpressionType.OPERATOR_NOT,
                            new OperatorExpression(ExpressionType.OPERATOR_IS_NULL), null);
                    newComparator.getLeft().setLeft(upperBoundComparator.getLeft());
                    newComparator.finalizeValueTypes();
                    retval.otherExprs.add(newComparator);
                } else {
                    int lastIdx = retval.indexExprs.size() -1;
                    retval.indexExprs.remove(lastIdx);
View Full Code Here

    static private AbstractExpression castExprIfNeeded(AbstractExpression expr, Column column) {

        if (expr.getValueType().getValue() != column.getType() ||
                expr.getValueSize() != column.getSize()) {
            expr = new OperatorExpression(ExpressionType.OPERATOR_CAST, expr, null);
            expr.setValueType(VoltType.get((byte) column.getType()));
            // We don't really support parameterized casting, such as specifically to "VARCHAR(3)"
            // vs. just VARCHAR, but set the size parameter anyway in this case to make sure that
            // the tuple that gets the result of the cast can be properly formatted as inline.
            // A too-wide value survives the cast (to generic VARCHAR of any length) but the
View Full Code Here

TOP

Related Classes of org.voltdb.expressions.OperatorExpression

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.