Search in sources :

Example 1 with QuerySchemas

use of io.confluent.ksql.schema.query.QuerySchemas in project ksql by confluentinc.

the class QueryDescriptionFactoryTest method setUp.

@Before
public void setUp() {
    when(topology.describe()).thenReturn(topologyDescription);
    when(kafkaStreamsBuilder.build(any(), any())).thenReturn(queryStreams);
    when(queryStreams.metadataForLocalThreads()).thenReturn(Collections.emptySet());
    when(sinkTopic.getKeyFormat()).thenReturn(KeyFormat.nonWindowed(FormatInfo.of(FormatFactory.KAFKA.name()), SerdeFeatures.of()));
    when(sinkDataSource.getKsqlTopic()).thenReturn(sinkTopic);
    when(sinkDataSource.getName()).thenReturn(SourceName.of("sink name"));
    transientQuery = new TransientQueryMetadata(SQL_TEXT, TRANSIENT_SCHEMA, SOURCE_NAMES, "execution plan", queryQueue, QUERY_ID, APPLICATION_ID, topology, kafkaStreamsBuilder, STREAMS_PROPS, PROP_OVERRIDES, closeTimeout, 10, ResultType.STREAM, 0L, 0L, listener);
    transientQuery.initialize();
    transientQueryDescription = QueryDescriptionFactory.forQueryMetadata(transientQuery, Collections.emptyMap());
    persistentQuery = new PersistentQueryMetadataImpl(KsqlConstants.PersistentQueryType.CREATE_AS, SQL_TEXT, PhysicalSchema.from(PERSISTENT_SCHEMA, SerdeFeatures.of(), SerdeFeatures.of()), SOURCE_NAMES, Optional.of(sinkDataSource), "execution plan", QUERY_ID, Optional.empty(), APPLICATION_ID, topology, kafkaStreamsBuilder, new QuerySchemas(), STREAMS_PROPS, PROP_OVERRIDES, closeTimeout, QueryErrorClassifier.DEFAULT_CLASSIFIER, physicalPlan, 10, processingLogger, 0L, 0L, listener, Optional.empty());
    persistentQuery.initialize();
    persistentQueryDescription = QueryDescriptionFactory.forQueryMetadata(persistentQuery, STATUS_MAP);
}
Also used : QuerySchemas(io.confluent.ksql.schema.query.QuerySchemas) PersistentQueryMetadataImpl(io.confluent.ksql.util.PersistentQueryMetadataImpl) TransientQueryMetadata(io.confluent.ksql.util.TransientQueryMetadata) Before(org.junit.Before)

Aggregations

QuerySchemas (io.confluent.ksql.schema.query.QuerySchemas)1 PersistentQueryMetadataImpl (io.confluent.ksql.util.PersistentQueryMetadataImpl)1 TransientQueryMetadata (io.confluent.ksql.util.TransientQueryMetadata)1 Before (org.junit.Before)1