use of io.crate.analyze.symbol.Symbol in project crate by crate.
the class SymbolToTrueVisitorTest method testFalseAndMatchFunction.
@Test
public void testFalseAndMatchFunction() throws Exception {
Symbol symbol = convertFromSQL("false and match (table_name, 'jalla')");
assertThat(symbol, isLiteral(false));
}
use of io.crate.analyze.symbol.Symbol in project crate by crate.
the class SymbolToTrueVisitorTest method testNullAndMatchFunction.
@Test
public void testNullAndMatchFunction() throws Exception {
Symbol symbol = convertFromSQL("null and match (table_name, 'jalla')");
assertThat(symbol, isLiteral(null, DataTypes.BOOLEAN));
}
use of io.crate.analyze.symbol.Symbol in project crate by crate.
the class GroupProjectionTest method testStreaming2.
@Test
public void testStreaming2() throws Exception {
Reference nameRef = createReference("name", DataTypes.STRING);
List<Symbol> keys = Collections.singletonList(nameRef);
List<Aggregation> aggregations = Collections.singletonList(Aggregation.finalAggregation(new FunctionInfo(new FunctionIdent(CountAggregation.NAME, ImmutableList.of()), DataTypes.LONG), ImmutableList.of(), Aggregation.Step.PARTIAL));
GroupProjection groupProjection = new GroupProjection(keys, aggregations, RowGranularity.CLUSTER);
BytesStreamOutput out = new BytesStreamOutput();
Projection.toStream(groupProjection, out);
StreamInput in = StreamInput.wrap(out.bytes());
GroupProjection p2 = (GroupProjection) Projection.fromStream(in);
assertThat(p2.keys().size(), is(1));
assertThat(p2.values().size(), is(1));
}
use of io.crate.analyze.symbol.Symbol in project crate by crate.
the class GroupProjectionTest method testStreaming.
@Test
public void testStreaming() throws Exception {
ImmutableList<Symbol> keys = ImmutableList.of(createReference("foo", DataTypes.STRING), createReference("bar", DataTypes.SHORT));
ImmutableList<Aggregation> aggregations = ImmutableList.of();
GroupProjection p = new GroupProjection(keys, aggregations, RowGranularity.CLUSTER);
BytesStreamOutput out = new BytesStreamOutput();
Projection.toStream(p, out);
StreamInput in = StreamInput.wrap(out.bytes());
GroupProjection p2 = (GroupProjection) Projection.fromStream(in);
assertEquals(p, p2);
}
use of io.crate.analyze.symbol.Symbol in project crate by crate.
the class GroupProjectionTest method testStreamingGranularity.
@Test
public void testStreamingGranularity() throws Exception {
ImmutableList<Symbol> keys = ImmutableList.of(createReference("foo", DataTypes.STRING), createReference("bar", DataTypes.SHORT));
ImmutableList<Aggregation> aggregations = ImmutableList.of();
GroupProjection p = new GroupProjection(keys, aggregations, RowGranularity.SHARD);
BytesStreamOutput out = new BytesStreamOutput();
Projection.toStream(p, out);
StreamInput in = StreamInput.wrap(out.bytes());
GroupProjection p2 = (GroupProjection) Projection.fromStream(in);
assertEquals(p, p2);
}
Aggregations