use of io.confluent.ksql.execution.expression.tree.LongLiteral in project ksql by confluentinc.
the class GroupByParamsFactoryTest method setUp.
@Before
public void setUp() {
when(groupBy0.getExpression()).thenReturn(new LongLiteral(0));
when(groupBy0.getExpressionType()).thenReturn(SqlTypes.INTEGER);
when(groupBy1.getExpression()).thenReturn(new UnqualifiedColumnReferenceExp(ColumnName.of("K1")));
when(groupBy1.getExpressionType()).thenReturn(SqlTypes.INTEGER);
singleParams = GroupByParamsFactory.build(SOURCE_SCHEMA, ImmutableList.of(groupBy0), logger);
multiParams = GroupByParamsFactory.build(SOURCE_SCHEMA, ImmutableList.of(groupBy0, groupBy1), logger);
when(groupBy0.evaluate(any(), any(), any(), any())).thenReturn(0);
when(groupBy1.evaluate(any(), any(), any(), any())).thenReturn(0L);
}
use of io.confluent.ksql.execution.expression.tree.LongLiteral in project ksql by confluentinc.
the class GroupByParamsV1FactoryTest method shouldGenerateKeyNameFromSingleGroupByOtherExpressionType.
@Test
public void shouldGenerateKeyNameFromSingleGroupByOtherExpressionType() {
// Given:
when(groupBy0.getExpression()).thenReturn(new LongLiteral(1));
// When:
final LogicalSchema schema = GroupByParamsV1Factory.buildSchema(SOURCE_SCHEMA, ImmutableList.of(groupBy0));
// Then:
assertThat(schema, is(LogicalSchema.builder().keyColumn(ColumnName.of("KSQL_COL_1"), SqlTypes.INTEGER).valueColumns(SOURCE_SCHEMA.value()).build()));
}
use of io.confluent.ksql.execution.expression.tree.LongLiteral in project ksql by confluentinc.
the class GroupByParamsV1FactoryTest method setUp.
@Before
public void setUp() {
when(groupBy0.getExpression()).thenReturn(new LongLiteral(0));
when(groupBy0.getExpressionType()).thenReturn(SqlTypes.INTEGER);
singleParams = GroupByParamsV1Factory.build(SOURCE_SCHEMA, ImmutableList.of(groupBy0), logger);
multiParams = GroupByParamsV1Factory.build(SOURCE_SCHEMA, ImmutableList.of(groupBy0, groupBy1), logger);
when(groupBy0.evaluate(any(), any(), any(), any())).thenReturn(0);
when(groupBy1.evaluate(any(), any(), any(), any())).thenReturn(0L);
}
Aggregations