use of io.confluent.ksql.execution.plan.StreamGroupByKey in project ksql by confluentinc.
the class StepSchemaResolverTest method shouldResolveSchemaForStreamGroupByKey.
@Test
public void shouldResolveSchemaForStreamGroupByKey() {
// Given:
final StreamGroupByKey step = new StreamGroupByKey(PROPERTIES, streamSource, formats);
// When:
final LogicalSchema result = resolver.resolve(step, SCHEMA);
// Then:
assertThat(result, is(SCHEMA));
}
use of io.confluent.ksql.execution.plan.StreamGroupByKey in project ksql by confluentinc.
the class StreamGroupByBuilderTest method init.
@Before
@SuppressWarnings("unchecked")
public void init() {
when(streamHolder.getSchema()).thenReturn(SCHEMA);
when(streamHolder.getStream()).thenReturn(sourceStream);
when(paramsFactory.build(any(), any(), any())).thenReturn(groupByParams);
when(groupByParams.getSchema()).thenReturn(REKEYED_SCHEMA);
when(groupByParams.getMapper()).thenReturn(mapper);
when(buildContext.getKsqlConfig()).thenReturn(ksqlConfig);
when(buildContext.getFunctionRegistry()).thenReturn(functionRegistry);
when(buildContext.buildKeySerde(any(), any(), any())).thenReturn(keySerde);
when(buildContext.buildValueSerde(any(), any(), any())).thenReturn(valueSerde);
when(buildContext.getProcessingLogger(any())).thenReturn(processingLogger);
when(groupedFactory.create(any(), any(Serde.class), any())).thenReturn(grouped);
when(sourceStream.groupByKey(any(Grouped.class))).thenReturn(groupedStream);
when(sourceStream.filter(any())).thenReturn(filteredStream);
when(filteredStream.groupBy(any(KeyValueMapper.class), any(Grouped.class))).thenReturn(groupedStream);
groupBy = new StreamGroupBy<>(PROPERTIES, sourceStep, FORMATS, GROUP_BY_EXPRESSIONS);
groupByKey = new StreamGroupByKey(PROPERTIES, sourceStep, FORMATS);
builder = new StreamGroupByBuilder(buildContext, groupedFactory, paramsFactory);
}
use of io.confluent.ksql.execution.plan.StreamGroupByKey in project ksql by confluentinc.
the class StreamGroupByBuilderV1Test method init.
@Before
@SuppressWarnings("unchecked")
public void init() {
when(streamHolder.getSchema()).thenReturn(SCHEMA);
when(streamHolder.getStream()).thenReturn(sourceStream);
when(paramsFactory.build(any(), any(), any())).thenReturn(groupByParams);
when(groupByParams.getSchema()).thenReturn(REKEYED_SCHEMA);
when(groupByParams.getMapper()).thenReturn(mapper);
when(buildContext.getKsqlConfig()).thenReturn(ksqlConfig);
when(buildContext.getFunctionRegistry()).thenReturn(functionRegistry);
when(buildContext.buildKeySerde(any(), any(), any())).thenReturn(keySerde);
when(buildContext.buildValueSerde(any(), any(), any())).thenReturn(valueSerde);
when(buildContext.getProcessingLogger(any())).thenReturn(processingLogger);
when(groupedFactory.create(any(), any(Serde.class), any())).thenReturn(grouped);
when(sourceStream.groupByKey(any(Grouped.class))).thenReturn(groupedStream);
when(sourceStream.filter(any())).thenReturn(filteredStream);
when(filteredStream.groupBy(any(KeyValueMapper.class), any(Grouped.class))).thenReturn(groupedStream);
groupBy = new StreamGroupByV1<>(PROPERTIES, sourceStep, FORMATS, GROUP_BY_EXPRESSIONS);
groupByKey = new StreamGroupByKey(PROPERTIES, sourceStep, FORMATS);
builder = new StreamGroupByBuilderV1(buildContext, groupedFactory, paramsFactory);
}
Aggregations