use of io.confluent.ksql.analyzer.Analysis.Into.NewTopic in project ksql by confluentinc.
the class LogicalPlanner method getSinkTopic.
private KsqlTopic getSinkTopic(final Into into, final LogicalSchema schema) {
if (into.getExistingTopic().isPresent()) {
return into.getExistingTopic().get();
}
final NewTopic newTopic = into.getNewTopic().orElseThrow(IllegalStateException::new);
final FormatInfo keyFormat = getSinkKeyFormat(schema, newTopic);
final SerdeFeatures keyFeatures = SerdeFeaturesFactory.buildKeyFeatures(schema, FormatFactory.of(keyFormat));
final SerdeFeatures valFeatures = SerdeFeaturesFactory.buildValueFeatures(schema, FormatFactory.of(newTopic.getValueFormat()), analysis.getProperties().getValueSerdeFeatures(), ksqlConfig);
return new KsqlTopic(newTopic.getTopicName(), KeyFormat.of(keyFormat, keyFeatures, newTopic.getWindowInfo()), ValueFormat.of(newTopic.getValueFormat(), valFeatures));
}
Aggregations