Search in sources :

Example 26 with CreateStreamCommand

use of io.confluent.ksql.execution.ddl.commands.CreateStreamCommand in project ksql by confluentinc.

the class DdlCommandExecTest method shouldAddNormalStreamWhenNoTypeIsSpecified.

@Test
public void shouldAddNormalStreamWhenNoTypeIsSpecified() {
    // Given:
    final CreateStreamCommand cmd = buildCreateStream(SourceName.of("t1"), SCHEMA, false, null);
    // When:
    cmdExec.execute(SQL_TEXT, cmd, true, NO_QUERY_SOURCES);
    // Then:
    final KsqlStream ksqlTable = (KsqlStream) metaStore.getSource(SourceName.of("t1"));
    assertThat(ksqlTable.isSource(), is(false));
}
Also used : KsqlStream(io.confluent.ksql.metastore.model.KsqlStream) CreateStreamCommand(io.confluent.ksql.execution.ddl.commands.CreateStreamCommand) Test(org.junit.Test)

Aggregations

CreateStreamCommand (io.confluent.ksql.execution.ddl.commands.CreateStreamCommand)26 Test (org.junit.Test)25 CreateStream (io.confluent.ksql.parser.tree.CreateStream)18 StringLiteral (io.confluent.ksql.execution.expression.tree.StringLiteral)6 DropSourceCommand (io.confluent.ksql.execution.ddl.commands.DropSourceCommand)3 Type (io.confluent.ksql.execution.expression.tree.Type)3 TimestampColumn (io.confluent.ksql.execution.timestamp.TimestampColumn)3 DataSourceType (io.confluent.ksql.metastore.model.DataSource.DataSourceType)3 KsqlStream (io.confluent.ksql.metastore.model.KsqlStream)2 LogicalSchema (io.confluent.ksql.schema.ksql.LogicalSchema)2 KsqlConfig (io.confluent.ksql.util.KsqlConfig)2 KsqlException (io.confluent.ksql.util.KsqlException)2 DdlCommandResult (io.confluent.ksql.execution.ddl.commands.DdlCommandResult)1 KsqlTopic (io.confluent.ksql.execution.ddl.commands.KsqlTopic)1 BooleanLiteral (io.confluent.ksql.execution.expression.tree.BooleanLiteral)1 DataSource (io.confluent.ksql.metastore.model.DataSource)1 SourceName (io.confluent.ksql.name.SourceName)1 CreateSourceProperties (io.confluent.ksql.parser.properties.with.CreateSourceProperties)1 KsqlStructuredDataOutputNode (io.confluent.ksql.planner.plan.KsqlStructuredDataOutputNode)1 CommandId (io.confluent.ksql.rest.entity.CommandId)1