Search in sources :

Example 16 with Materialization

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

the class QueryBuilderTest method shouldNotIncludeMaterializationProviderIfNoMaterialization.

@Test
public void shouldNotIncludeMaterializationProviderIfNoMaterialization() {
    // Given:
    when(tableHolder.getMaterializationBuilder()).thenReturn(Optional.empty());
    final PersistentQueryMetadata queryMetadata = buildPersistentQuery(SOURCES, KsqlConstants.PersistentQueryType.CREATE_AS, QUERY_ID);
    queryMetadata.initialize();
    // When:
    final Optional<Materialization> result = queryMetadata.getMaterialization(QUERY_ID, stacker);
    // Then:
    assertThat(result, is(Optional.empty()));
}
Also used : KsMaterialization(io.confluent.ksql.execution.streams.materialization.ks.KsMaterialization) Materialization(io.confluent.ksql.execution.streams.materialization.Materialization) PersistentQueryMetadata(io.confluent.ksql.util.PersistentQueryMetadata) Test(org.junit.Test)

Aggregations

Materialization (io.confluent.ksql.execution.streams.materialization.Materialization)16 PersistentQueryMetadata (io.confluent.ksql.util.PersistentQueryMetadata)16 Test (org.junit.Test)16 IntegrationTest (org.apache.kafka.test.IntegrationTest)13 GenericKey (io.confluent.ksql.GenericKey)8 GenericRow (io.confluent.ksql.GenericRow)8 WindowedRow (io.confluent.ksql.execution.streams.materialization.WindowedRow)8 LogicalSchema (io.confluent.ksql.schema.ksql.LogicalSchema)8 MaterializedWindowedTable (io.confluent.ksql.execution.streams.materialization.MaterializedWindowedTable)7 MaterializedTable (io.confluent.ksql.execution.streams.materialization.MaterializedTable)5 Row (io.confluent.ksql.execution.streams.materialization.Row)5 Window (io.confluent.ksql.Window)4 Windowed (org.apache.kafka.streams.kstream.Windowed)4 KsMaterialization (io.confluent.ksql.execution.streams.materialization.ks.KsMaterialization)3 Optional (java.util.Optional)3 ConsumerRecord (org.apache.kafka.clients.consumer.ConsumerRecord)3 TestKsqlContext (io.confluent.ksql.integration.TestKsqlContext)2 Range (com.google.common.collect.Range)1 GenericKey.genericKey (io.confluent.ksql.GenericKey.genericKey)1 QueryContext (io.confluent.ksql.execution.context.QueryContext)1