Search in sources :

Example 1 with CreateTableAsSelect

use of io.confluent.ksql.parser.tree.CreateTableAsSelect in project ksql by confluentinc.

the class StatementExecutor method handleCreateAsSelect.

private String handleCreateAsSelect(final CreateAsSelect statement, final Command command, final CommandId commandId, final Map<QueryId, CommandId> terminatedQueries, final String statementStr, final boolean wasDropped) throws Exception {
    QuerySpecification querySpecification = (QuerySpecification) statement.getQuery().getQueryBody();
    Query query = ksqlEngine.addInto(statement.getQuery(), querySpecification, statement.getName().getSuffix(), statement.getProperties(), statement.getPartitionByColumn());
    if (startQuery(statementStr, query, commandId, terminatedQueries, command, wasDropped)) {
        return statement instanceof CreateTableAsSelect ? "Table created and running" : "Stream created and running";
    }
    return null;
}
Also used : QuerySpecification(io.confluent.ksql.parser.tree.QuerySpecification) Query(io.confluent.ksql.parser.tree.Query) TerminateQuery(io.confluent.ksql.parser.tree.TerminateQuery) CreateTableAsSelect(io.confluent.ksql.parser.tree.CreateTableAsSelect)

Aggregations

CreateTableAsSelect (io.confluent.ksql.parser.tree.CreateTableAsSelect)1 Query (io.confluent.ksql.parser.tree.Query)1 QuerySpecification (io.confluent.ksql.parser.tree.QuerySpecification)1 TerminateQuery (io.confluent.ksql.parser.tree.TerminateQuery)1