Search in sources :

Example 11 with KsqlStream

use of io.confluent.ksql.metastore.KsqlStream in project ksql by confluentinc.

the class KsqlResourceTest method testListStreamsStatement.

@Test
public void testListStreamsStatement() throws Exception {
    KsqlResource testResource = TestKsqlResourceUtil.get(ksqlEngine, ksqlRestConfig);
    final String ksqlString = "LIST STREAMS;";
    final ListStreams ksqlStatement = new ListStreams(Optional.empty());
    StreamsList streamsList = makeSingleRequest(testResource, ksqlString, ksqlStatement, Collections.emptyMap(), StreamsList.class);
    List<SourceInfo.Stream> testStreams = streamsList.getStreams();
    assertEquals(1, testStreams.size());
    SourceInfo expectedStream = new SourceInfo.Stream((KsqlStream) testResource.getKsqlEngine().getMetaStore().getSource("TEST_STREAM"));
    assertEquals(expectedStream, testStreams.get(0));
}
Also used : ListStreams(io.confluent.ksql.parser.tree.ListStreams) StreamsList(io.confluent.ksql.rest.entity.StreamsList) SourceInfo(io.confluent.ksql.rest.entity.SourceInfo) KsqlStream(io.confluent.ksql.metastore.KsqlStream) Test(org.junit.Test)

Aggregations

KsqlStream (io.confluent.ksql.metastore.KsqlStream)11 StructuredDataSource (io.confluent.ksql.metastore.StructuredDataSource)6 KsqlTopic (io.confluent.ksql.metastore.KsqlTopic)5 KsqlTable (io.confluent.ksql.metastore.KsqlTable)3 KsqlJsonTopicSerDe (io.confluent.ksql.serde.json.KsqlJsonTopicSerDe)3 SchemaBuilder (org.apache.kafka.connect.data.SchemaBuilder)3 SelectItem (io.confluent.ksql.parser.tree.SelectItem)2 SingleColumn (io.confluent.ksql.parser.tree.SingleColumn)2 Schema (org.apache.kafka.connect.data.Schema)2 AggregateAnalysis (io.confluent.ksql.analyzer.AggregateAnalysis)1 Analysis (io.confluent.ksql.analyzer.Analysis)1 QueryAnalyzer (io.confluent.ksql.analyzer.QueryAnalyzer)1 FunctionRegistry (io.confluent.ksql.function.FunctionRegistry)1 MetaStore (io.confluent.ksql.metastore.MetaStore)1 MetaStoreImpl (io.confluent.ksql.metastore.MetaStoreImpl)1 ListStreams (io.confluent.ksql.parser.tree.ListStreams)1 LogicalPlanner (io.confluent.ksql.planner.LogicalPlanner)1 KsqlStructuredDataOutputNode (io.confluent.ksql.planner.plan.KsqlStructuredDataOutputNode)1 PlanNode (io.confluent.ksql.planner.plan.PlanNode)1 PlanNodeId (io.confluent.ksql.planner.plan.PlanNodeId)1