Package com.foundationdb.server.types.value

Examples of com.foundationdb.server.types.value.Value


        // Neither side is constant null. If both sides are constant, evaluate
        ValueSource resultSource = null;
        boolean nullable;
        if (oneVal != null && twoVal != null) {
            final boolean result = doEval(leftPrep.type(), oneVal, rightPrep.type(), twoVal);
            resultSource = new Value(AkBool.INSTANCE.instance(false), result);
            nullable = resultSource.isNull();
        }
        else {
            nullable = left.resultType().nullability() || right.resultType().nullability();
        }
View Full Code Here


        }

        @Override
        public void evaluate() {
            if (value == null)
                value = new Value(AkBool.INSTANCE.instance(true));
            left.evaluate();
            ValueSource leftSource = left.resultValue();
            if (leftSource.isNull()) {
                value.putNull();
                return;
View Full Code Here

        {
            this.overload = overload;
            this.inputs = inputs;
            this.inputValues = new ValueSource[inputs.size()];
            this.context = context;
            resultValue = new Value(resultType);
            this.evaluations = overload.filterInputs(new LazyListBase<ValueSource>() {
                @Override
                public ValueSource get(int i) {
                    ValueSource value = inputValues[i];
                    if (value == null) {
View Full Code Here

        InnerEvaluation(Operator subquery, RowType outerRowType, int bindingPosition, TInstance type)
        {
            this.subquery = subquery;
            this.outerRowType = outerRowType;
            this.bindingPosition = bindingPosition;
            this.value = new Value(type);
        }
View Full Code Here

                public String getCurrentSchema() {
                    return SCHEMA_NAME;
                }
            };
        QueryBindings queryBindings = queryContext.createBindings();
        queryBindings.setValue(0, new Value(MString.varcharFor(SCHEMA_NAME), SCHEMA_NAME));
        queryBindings.setValue(1, new Value(MString.varcharFor(groupName), groupName));
        if (multiple)
            queryBindings.setValue(2, new Value(MNumeric.INT.instance(false), 10));
        if (commitFreq > 0)
            queryBindings.setValue(3, new Value(MNumeric.INT.instance(false), commitFreq));

        DirectObjectCursor cursor = plan.cursor(queryContext, queryBindings);
       
        StringBuilder actual = new StringBuilder();
View Full Code Here

import static org.junit.Assert.assertEquals;

public final class ImmutableRowTest {
    @Test
    public void basic() {
        Value vh1 = new Value(MNumeric.BIGINT.instance(false), 1L);
        Value vh2 = new Value(MString.varchar(), "right");
        Row row = new ImmutableRow (rowType(MNumeric.BIGINT.instance(false), MString.varchar()), Arrays.asList(vh1, vh2).iterator());
        vh1.putInt64(50L);
        vh2.putString("wrong", null);
        assertEquals("1", 1L, row.value(0).getInt64());
        assertEquals("2", "right", row.value(1).getString());
    }
View Full Code Here

    @Test(expected = IllegalArgumentException.class)
    public void tooManyInputs() {
        new ImmutableRow(
                rowType(MNumeric.BIGINT.instance(false)),
                Arrays.asList(
                        new Value(MNumeric.BIGINT.instance(false), 1L),
                        new Value(MString.varchar(), "bonus")).iterator()
        );
    }
View Full Code Here

    @Test(expected = IllegalStateException.class)
    public void wrongInputType() {
        new ImmutableRow(
                rowType(MNumeric.INT.instance(false)),
                Collections.singleton(new Value(MNumeric.INT.instance(false), "1L")).iterator()
        );
    }
View Full Code Here

    @Test(expected = IllegalArgumentException.class)
    public void tryToClear() {
        ImmutableRow row = new ImmutableRow(
                rowType(MNumeric.INT.instance(false)),
                Collections.singleton(new Value(MString.varchar(), "1L")).iterator()
        );
        row.clear();
    }
View Full Code Here

   
    @Test(expected = IllegalStateException.class)
    public void tryToGetHolder() {
        ImmutableRow row = new ImmutableRow(
                rowType(MString.varchar()),
                Collections.singleton(new Value(MString.varchar(), "1L")).iterator()
        );
        row.valueAt(0);
    }
View Full Code Here

TOP

Related Classes of com.foundationdb.server.types.value.Value

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.