use of io.crate.analyze.symbol.Value in project crate by crate.
the class TopNProjectionTest method testStreaming.
@Test
public void testStreaming() throws Exception {
ImmutableList<Symbol> outputs = ImmutableList.of(new Value(DataTypes.BOOLEAN), new Value(DataTypes.INTEGER));
TopNProjection p = new TopNProjection(5, 10, outputs);
BytesStreamOutput out = new BytesStreamOutput();
Projection.toStream(p, out);
StreamInput in = StreamInput.wrap(out.bytes());
TopNProjection p2 = (TopNProjection) Projection.fromStream(in);
assertEquals(p, p2);
}
use of io.crate.analyze.symbol.Value in project crate by crate.
the class SymbolSerializerTest method testValueSymbol.
@Test
public void testValueSymbol() throws Exception {
Value v = new Value(DataTypes.STRING);
BytesStreamOutput out = new BytesStreamOutput();
Symbols.toStream(v, out);
StreamInput in = StreamInput.wrap(out.bytes());
Value v2 = (Value) Symbols.fromStream(in);
assertEquals(v2.valueType(), DataTypes.STRING);
}
Aggregations