Search in sources :

Example 1 with StepSchemaResolver

use of io.confluent.ksql.execution.streams.StepSchemaResolver in project ksql by confluentinc.

the class SchemaKStreamTest method init.

@Before
@SuppressWarnings("rawtypes")
public void init() {
    functionRegistry = new InternalFunctionRegistry();
    schemaResolver = new StepSchemaResolver(ksqlConfig, functionRegistry);
    ksqlStream = (KsqlStream) metaStore.getSource(SourceName.of("TEST1"));
    final KsqlTable<?> ksqlTable = (KsqlTable) metaStore.getSource(SourceName.of("TEST2"));
    schemaKTable = new SchemaKTable(tableSourceStep, ksqlTable.getSchema(), keyFormat, ksqlConfig, functionRegistry);
    schemaKStream = new SchemaKStream(streamSourceStep, ksqlStream.getSchema(), keyFormat, ksqlConfig, functionRegistry);
}
Also used : KsqlTable(io.confluent.ksql.metastore.model.KsqlTable) InternalFunctionRegistry(io.confluent.ksql.function.InternalFunctionRegistry) StepSchemaResolver(io.confluent.ksql.execution.streams.StepSchemaResolver) Before(org.junit.Before)

Example 2 with StepSchemaResolver

use of io.confluent.ksql.execution.streams.StepSchemaResolver in project ksql by confluentinc.

the class SchemaKTableTest method init.

@Before
public void init() {
    UserFunctionLoader.newInstance(ksqlConfig, functionRegistry, ".", new Metrics()).load();
    schemaResolver = new StepSchemaResolver(ksqlConfig, functionRegistry);
    ksqlTable = (KsqlTable) metaStore.getSource(SourceName.of("TEST2"));
    final StreamsBuilder builder = new StreamsBuilder();
    kTable = builder.table(ksqlTable.getKsqlTopic().getKafkaTopicName(), Consumed.with(Serdes.String(), getRowSerde(ksqlTable.getKsqlTopic(), ksqlTable.getSchema())));
    secondKsqlTable = (KsqlTable) metaStore.getSource(SourceName.of("TEST3"));
    secondKTable = builder.table(secondKsqlTable.getKsqlTopic().getKafkaTopicName(), Consumed.with(Serdes.String(), getRowSerde(secondKsqlTable.getKsqlTopic(), secondKsqlTable.getSchema())));
    mockKTable = mock(KTable.class);
    firstSchemaKTable = buildSchemaKTableForJoin(ksqlTable, mockKTable);
    secondSchemaKTable = buildSchemaKTableForJoin(secondKsqlTable, secondKTable);
    when(executeContext.getKsqlConfig()).thenReturn(ksqlConfig);
    when(executeContext.getFunctionRegistry()).thenReturn(functionRegistry);
    when(executeContext.getProcessingLogger(any())).thenReturn(processingLogger);
    planBuilder = new KSPlanBuilder(executeContext, mock(SqlPredicateFactory.class), mock(AggregateParamsFactory.class), new StreamsFactories(groupedFactory, mock(JoinedFactory.class), mock(MaterializedFactory.class), mock(StreamJoinedFactory.class), mock(ConsumedFactory.class)));
}
Also used : StreamsBuilder(org.apache.kafka.streams.StreamsBuilder) KSPlanBuilder(io.confluent.ksql.execution.streams.KSPlanBuilder) Metrics(org.apache.kafka.common.metrics.Metrics) MaterializedFactory(io.confluent.ksql.execution.streams.MaterializedFactory) StreamJoinedFactory(io.confluent.ksql.execution.streams.StreamJoinedFactory) ConsumedFactory(io.confluent.ksql.execution.streams.ConsumedFactory) StreamsFactories(io.confluent.ksql.execution.streams.StreamsFactories) JoinedFactory(io.confluent.ksql.execution.streams.JoinedFactory) StreamJoinedFactory(io.confluent.ksql.execution.streams.StreamJoinedFactory) KTable(org.apache.kafka.streams.kstream.KTable) StepSchemaResolver(io.confluent.ksql.execution.streams.StepSchemaResolver) Before(org.junit.Before)

Aggregations

StepSchemaResolver (io.confluent.ksql.execution.streams.StepSchemaResolver)2 Before (org.junit.Before)2 ConsumedFactory (io.confluent.ksql.execution.streams.ConsumedFactory)1 JoinedFactory (io.confluent.ksql.execution.streams.JoinedFactory)1 KSPlanBuilder (io.confluent.ksql.execution.streams.KSPlanBuilder)1 MaterializedFactory (io.confluent.ksql.execution.streams.MaterializedFactory)1 StreamJoinedFactory (io.confluent.ksql.execution.streams.StreamJoinedFactory)1 StreamsFactories (io.confluent.ksql.execution.streams.StreamsFactories)1 InternalFunctionRegistry (io.confluent.ksql.function.InternalFunctionRegistry)1 KsqlTable (io.confluent.ksql.metastore.model.KsqlTable)1 Metrics (org.apache.kafka.common.metrics.Metrics)1 StreamsBuilder (org.apache.kafka.streams.StreamsBuilder)1 KTable (org.apache.kafka.streams.kstream.KTable)1