Search in sources :

Example 16 with SchemaKStream

use of io.confluent.ksql.structured.SchemaKStream in project ksql by confluentinc.

the class JoinNode method buildStream.

@Override
public SchemaKStream buildStream(final StreamsBuilder builder, final KsqlConfig ksqlConfig, final KafkaTopicClient kafkaTopicClient, final FunctionRegistry functionRegistry, final Map<String, Object> props, final SchemaRegistryClient schemaRegistryClient) {
    if (!isLeftJoin()) {
        throw new KsqlException("Join type is not supported yet: " + getType());
    }
    final SchemaKTable table = tableForJoin(builder, ksqlConfig, kafkaTopicClient, functionRegistry, props, schemaRegistryClient);
    final SchemaKStream stream = streamForJoin(getLeft().buildStream(builder, ksqlConfig, kafkaTopicClient, functionRegistry, props, schemaRegistryClient), getLeftKeyFieldName(), kafkaTopicClient);
    final KsqlTopicSerDe joinSerDe = getResultTopicSerde(this);
    return stream.leftJoin(table, getSchema(), getSchema().field(getLeftAlias() + "." + stream.getKeyField().name()), joinSerDe, ksqlConfig);
}
Also used : SchemaKTable(io.confluent.ksql.structured.SchemaKTable) KsqlTopicSerDe(io.confluent.ksql.serde.KsqlTopicSerDe) SchemaKStream(io.confluent.ksql.structured.SchemaKStream) KsqlException(io.confluent.ksql.util.KsqlException)

Example 17 with SchemaKStream

use of io.confluent.ksql.structured.SchemaKStream in project ksql by confluentinc.

the class KsqlBareOutputNode method buildStream.

@Override
public SchemaKStream buildStream(final StreamsBuilder builder, final KsqlConfig ksqlConfig, final KafkaTopicClient kafkaTopicClient, final FunctionRegistry functionRegistry, final Map<String, Object> props, final SchemaRegistryClient schemaRegistryClient) {
    final SchemaKStream schemaKStream = getSource().buildStream(builder, ksqlConfig, kafkaTopicClient, functionRegistry, props, schemaRegistryClient);
    schemaKStream.setOutputNode(this);
    return schemaKStream.toQueue(getLimit());
}
Also used : SchemaKStream(io.confluent.ksql.structured.SchemaKStream)

Aggregations

SchemaKStream (io.confluent.ksql.structured.SchemaKStream)17 SchemaKTable (io.confluent.ksql.structured.SchemaKTable)10 Test (org.junit.Test)8 KsqlException (io.confluent.ksql.util.KsqlException)5 StreamsBuilder (org.apache.kafka.streams.StreamsBuilder)4 MockSchemaRegistryClient (io.confluent.kafka.schemaregistry.client.MockSchemaRegistryClient)3 FunctionRegistry (io.confluent.ksql.function.FunctionRegistry)3 KsqlTopicSerDe (io.confluent.ksql.serde.KsqlTopicSerDe)3 KafkaTopicClient (io.confluent.ksql.util.KafkaTopicClient)3 Field (org.apache.kafka.connect.data.Field)3 GenericRow (io.confluent.ksql.GenericRow)2 KsqlTable (io.confluent.ksql.metastore.KsqlTable)2 QueuedSchemaKStream (io.confluent.ksql.structured.QueuedSchemaKStream)2 HashMap (java.util.HashMap)2 Schema (org.apache.kafka.connect.data.Schema)2 KudafAggregator (io.confluent.ksql.function.udaf.KudafAggregator)1 KudafInitializer (io.confluent.ksql.function.udaf.KudafInitializer)1 KsqlTopic (io.confluent.ksql.metastore.KsqlTopic)1 AddTimestampColumn (io.confluent.ksql.physical.AddTimestampColumn)1 KsqlBareOutputNode (io.confluent.ksql.planner.plan.KsqlBareOutputNode)1