use of io.confluent.ksql.ddl.commands.DdlCommand in project ksql by confluentinc.
the class QueryEngine method handleDdlStatement.
DdlCommandResult handleDdlStatement(String sqlExpression, DdlStatement statement, final Map<String, Object> overriddenProperties) {
if (statement instanceof AbstractStreamCreateStatement) {
AbstractStreamCreateStatement streamCreateStatement = (AbstractStreamCreateStatement) statement;
Pair<DdlStatement, String> avroCheckResult = maybeAddFieldsFromSchemaRegistry(streamCreateStatement);
if (avroCheckResult.getRight() != null) {
statement = avroCheckResult.getLeft();
sqlExpression = avroCheckResult.getRight();
}
}
DdlCommand command = ddlCommandFactory.create(sqlExpression, statement, overriddenProperties);
return ksqlEngine.getDdlCommandExec().execute(command);
}
Aggregations