use of io.confluent.ksql.execution.plan.WindowedStreamSource in project ksql by confluentinc.
the class StepSchemaResolverTest method shouldResolveSchemaForStreamWindowedSource.
@Test
public void shouldResolveSchemaForStreamWindowedSource() {
final WindowedStreamSource step = new WindowedStreamSource(PROPERTIES, "foo", formats, WindowInfo.of(WindowType.TUMBLING, Optional.of(Duration.ofMillis(123))), Optional.empty(), SCHEMA, OptionalInt.of(SystemColumns.CURRENT_PSEUDOCOLUMN_VERSION_NUMBER));
// When:
final LogicalSchema result = resolver.resolve(step, SCHEMA);
// Then:
assertThat(result, is(SCHEMA.withPseudoAndKeyColsInValue(true)));
}
use of io.confluent.ksql.execution.plan.WindowedStreamSource in project ksql by confluentinc.
the class SourceBuilderV1Test method givenWindowedSourceStream.
private void givenWindowedSourceStream(final int pseudoColumnVersion) {
when(buildContext.buildKeySerde(any(), any(), any(), any())).thenReturn(windowedKeySerde);
givenConsumed(consumedWindowed, windowedKeySerde);
windowedStreamSource = new WindowedStreamSource(new ExecutionStepPropertiesV1(ctx), TOPIC_NAME, Formats.of(keyFormatInfo, valueFormatInfo, KEY_FEATURES, VALUE_FEATURES), windowInfo, TIMESTAMP_COLUMN, SOURCE_SCHEMA, OptionalInt.of(pseudoColumnVersion));
}
use of io.confluent.ksql.execution.plan.WindowedStreamSource in project ksql by confluentinc.
the class SchemaKSourceFactory method buildWindowedStream.
private static SchemaKStream<?> buildWindowedStream(final PlanBuildContext buildContext, final DataSource dataSource, final Stacker contextStacker) {
final WindowInfo windowInfo = dataSource.getKsqlTopic().getKeyFormat().getWindowInfo().orElseThrow(IllegalArgumentException::new);
final int pseudoColumnVersionToUse = determinePseudoColumnVersionToUse(buildContext);
final WindowedStreamSource step = ExecutionStepFactory.streamSourceWindowed(contextStacker, dataSource.getSchema(), dataSource.getKafkaTopicName(), Formats.from(dataSource.getKsqlTopic()), windowInfo, dataSource.getTimestampColumn(), pseudoColumnVersionToUse);
return schemaKStream(buildContext, resolveSchema(buildContext, step, dataSource), dataSource.getKsqlTopic().getKeyFormat(), step);
}
Aggregations