Package io.crate.planner.symbol

Examples of io.crate.planner.symbol.Value


public class SymbolSerializerTest {


    @Test
    public void testValueSymbol() throws Exception {
        Value v = new Value(DataTypes.STRING);

        BytesStreamOutput out = new BytesStreamOutput();
        Symbol.toStream(v, out);

        BytesStreamInput in = new BytesStreamInput(out.bytes());
        Value v2 = (Value) Symbol.fromStream(in);
        assertEquals(v2.valueType(), DataTypes.STRING);
    }
View Full Code Here


        CollectNode cn = new CollectNode("cn");
        cn.maxRowGranularity(RowGranularity.DOC);

        cn.downStreamNodes(ImmutableList.of("n1", "n2"));
        cn.toCollect(ImmutableList.<Symbol>of(new Value(DataTypes.STRING)));


        BytesStreamOutput out = new BytesStreamOutput();
        cn.writeTo(out);
View Full Code Here

        CollectNode cn = new CollectNode("cn");
        cn.maxRowGranularity(RowGranularity.DOC);

        cn.downStreamNodes(ImmutableList.of("n1", "n2"));
        cn.toCollect(ImmutableList.<Symbol>of(new Value(DataTypes.STRING)));
        cn.jobId(UUID.randomUUID());

        BytesStreamOutput out = new BytesStreamOutput();
        cn.writeTo(out);
View Full Code Here

        TopNProjection p = new TopNProjection(5, 10,
                ImmutableList.<Symbol>of(createReference("foo", DataTypes.BOOLEAN)),
                new boolean[]{true},
                new Boolean[] { null });

        p.outputs(ImmutableList.<Symbol>of(new Value(DataTypes.BOOLEAN), new Value(DataTypes.INTEGER)));

        BytesStreamOutput out = new BytesStreamOutput();
        Projection.toStream(p, out);

        BytesStreamInput in = new BytesStreamInput(out.bytes());
View Full Code Here

        assertEquals(DataTypes.UNDEFINED, literal.valueType());
    }

    @Test
    public void testNormalizeSymbolNonLiteral() throws Exception {
        Symbol symbol = normalize(op_gt_string, Literal.newLiteral("a"), new Value(DataTypes.STRING));
        assertThat(symbol, instanceOf(Function.class));
    }
View Full Code Here

TOP

Related Classes of io.crate.planner.symbol.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.