Search in sources :

Example 11 with KsqlTable

use of io.confluent.ksql.metastore.model.KsqlTable in project ksql by confluentinc.

the class ListSourceExecutor method tables.

public static StatementExecutorResponse tables(final ConfiguredStatement<ListTables> statement, final SessionProperties sessionProperties, final KsqlExecutionContext executionContext, final ServiceContext serviceContext) {
    final List<KsqlTable<?>> ksqlTables = getSpecificTables(executionContext);
    final ListTables listTables = statement.getStatement();
    if (listTables.getShowExtended()) {
        return StatementExecutorResponse.handled(sourceDescriptionList(statement, sessionProperties, executionContext, serviceContext, ksqlTables, listTables.getShowExtended()));
    }
    return StatementExecutorResponse.handled(Optional.of(new TablesList(statement.getStatementText(), ksqlTables.stream().map(ListSourceExecutor::sourceTable).collect(Collectors.toList()))));
}
Also used : ListTables(io.confluent.ksql.parser.tree.ListTables) KsqlTable(io.confluent.ksql.metastore.model.KsqlTable) TablesList(io.confluent.ksql.rest.entity.TablesList)

Aggregations

KsqlTable (io.confluent.ksql.metastore.model.KsqlTable)11 Test (org.junit.Test)5 KsqlTopic (io.confluent.ksql.execution.ddl.commands.KsqlTopic)4 CreateTableCommand (io.confluent.ksql.execution.ddl.commands.CreateTableCommand)3 CreateTable (io.confluent.ksql.parser.tree.CreateTable)3 InternalFunctionRegistry (io.confluent.ksql.function.InternalFunctionRegistry)2 MetaStoreImpl (io.confluent.ksql.metastore.MetaStoreImpl)2 MutableMetaStore (io.confluent.ksql.metastore.MutableMetaStore)2 DataSourceType (io.confluent.ksql.metastore.model.DataSource.DataSourceType)2 KsqlStream (io.confluent.ksql.metastore.model.KsqlStream)2 SourceName (io.confluent.ksql.name.SourceName)2 AliasedRelation (io.confluent.ksql.parser.tree.AliasedRelation)2 Table (io.confluent.ksql.parser.tree.Table)2 TablesList (io.confluent.ksql.rest.entity.TablesList)2 Before (org.junit.Before)2 Throwables (com.google.common.base.Throwables)1 ImmutableMap (com.google.common.collect.ImmutableMap)1 ImmutableSet (com.google.common.collect.ImmutableSet)1 Iterables (com.google.common.collect.Iterables)1 SuppressFBWarnings (edu.umd.cs.findbugs.annotations.SuppressFBWarnings)1