Search in sources :

Example 11 with RuntimeBuildContext

use of io.confluent.ksql.execution.runtime.RuntimeBuildContext in project ksql by confluentinc.

the class ForeignKeyTableTableJoinBuilderTest method init.

@SuppressWarnings("unchecked")
@Before
public void init() {
    when(left.build(any(), eq(planInfo))).thenReturn(KTableHolder.materialized(leftKTable, LEFT_SCHEMA, executionKeyFactory, materializationBuilder));
    when(leftMultiKey.build(any(), eq(planInfo))).thenReturn(KTableHolder.materialized(leftKTableMultiKey, LEFT_SCHEMA_MULTI_KEY, executionKeyFactory, materializationBuilder));
    when(right.build(any(), eq(planInfo))).thenReturn(KTableHolder.materialized(rightKTable, RIGHT_SCHEMA, executionKeyFactory, materializationBuilder));
    when(leftKTable.leftJoin(any(KTable.class), any(KsqlKeyExtractor.class), any(), any(Materialized.class))).thenReturn(resultKTable);
    when(leftKTable.join(any(KTable.class), any(KsqlKeyExtractor.class), any(), any(Materialized.class))).thenReturn(resultKTable);
    when(leftKTableMultiKey.leftJoin(any(KTable.class), any(KsqlKeyExtractor.class), any(), any(Materialized.class))).thenReturn(resultKTable);
    when(leftKTableMultiKey.join(any(KTable.class), any(KsqlKeyExtractor.class), any(), any(Materialized.class))).thenReturn(resultKTable);
    when(formats.getKeyFeatures()).thenReturn(mock(SerdeFeatures.class));
    when(formats.getValueFeatures()).thenReturn(mock(SerdeFeatures.class));
    final RuntimeBuildContext context = mock(RuntimeBuildContext.class);
    when((context.getFunctionRegistry())).thenReturn(mock(FunctionRegistry.class));
    when((context.getKsqlConfig())).thenReturn(mock(KsqlConfig.class));
    planBuilder = new KSPlanBuilder(context, mock(SqlPredicateFactory.class), mock(AggregateParamsFactory.class), mock(StreamsFactories.class));
}
Also used : FunctionRegistry(io.confluent.ksql.function.FunctionRegistry) RuntimeBuildContext(io.confluent.ksql.execution.runtime.RuntimeBuildContext) KsqlConfig(io.confluent.ksql.util.KsqlConfig) KTable(org.apache.kafka.streams.kstream.KTable) Materialized(org.apache.kafka.streams.kstream.Materialized) SerdeFeatures(io.confluent.ksql.serde.SerdeFeatures) Before(org.junit.Before)

Aggregations

RuntimeBuildContext (io.confluent.ksql.execution.runtime.RuntimeBuildContext)11 LogicalSchema (io.confluent.ksql.schema.ksql.LogicalSchema)7 GenericRow (io.confluent.ksql.GenericRow)6 PhysicalSchema (io.confluent.ksql.schema.ksql.PhysicalSchema)6 KTableHolder (io.confluent.ksql.execution.plan.KTableHolder)5 KTable (org.apache.kafka.streams.kstream.KTable)5 ExecutionKeyFactory (io.confluent.ksql.execution.plan.ExecutionKeyFactory)4 ProcessingLogger (io.confluent.ksql.logging.processing.ProcessingLogger)4 Serde (org.apache.kafka.common.serialization.Serde)4 Materialized (org.apache.kafka.streams.kstream.Materialized)4 QueryContext (io.confluent.ksql.execution.context.QueryContext)3 KsTransformer (io.confluent.ksql.execution.streams.transform.KsTransformer)3 Optional (java.util.Optional)3 Bytes (org.apache.kafka.common.utils.Bytes)3 KStream (org.apache.kafka.streams.kstream.KStream)3 Named (org.apache.kafka.streams.kstream.Named)3 KeyValueStore (org.apache.kafka.streams.state.KeyValueStore)3 GenericKey (io.confluent.ksql.GenericKey)2 Stacker (io.confluent.ksql.execution.context.QueryContext.Stacker)2 KsqlTopic (io.confluent.ksql.execution.ddl.commands.KsqlTopic)2