use of io.confluent.ksql.parser.tree.DescribeStreams in project ksql by confluentinc.
the class SqlFormatterTest method shouldFormatDescribeStreams.
@Test
public void shouldFormatDescribeStreams() {
// Given:
final DescribeStreams describeStreams = new DescribeStreams(Optional.empty(), false);
// When:
final String formatted = SqlFormatter.formatSql(describeStreams);
// Then:
assertThat(formatted, is("DESCRIBE STREAMS"));
}
use of io.confluent.ksql.parser.tree.DescribeStreams in project ksql by confluentinc.
the class KsqlParserTest method testDescribeStreams.
@Test
public void testDescribeStreams() {
final String statementString = "DESCRIBE STREAMS;";
final Statement statement = KsqlParserTestUtil.buildSingleAst(statementString, metaStore).getStatement();
assertThat(statement, instanceOf(DescribeStreams.class));
final DescribeStreams describeStreams = (DescribeStreams) statement;
assertThat(describeStreams.getShowExtended(), is(false));
}
use of io.confluent.ksql.parser.tree.DescribeStreams in project ksql by confluentinc.
the class KsqlParserTest method testDescribeStreamsExtended.
@Test
public void testDescribeStreamsExtended() {
final String statementString = "DESCRIBE STREAMS EXTENDED;";
final Statement statement = KsqlParserTestUtil.buildSingleAst(statementString, metaStore).getStatement();
assertThat(statement, instanceOf(DescribeStreams.class));
final DescribeStreams describeStreams = (DescribeStreams) statement;
assertThat(describeStreams.getShowExtended(), is(true));
}
use of io.confluent.ksql.parser.tree.DescribeStreams in project ksql by confluentinc.
the class ListSourceExecutor method describeStreams.
public static StatementExecutorResponse describeStreams(final ConfiguredStatement<DescribeStreams> statement, final SessionProperties sessionProperties, final KsqlExecutionContext executionContext, final ServiceContext serviceContext) {
final List<KsqlStream<?>> ksqlStreams = getSpecificStreams(executionContext);
final DescribeStreams describeStreams = statement.getStatement();
return StatementExecutorResponse.handled(sourceDescriptionList(statement, sessionProperties, executionContext, serviceContext, ksqlStreams, describeStreams.getShowExtended()));
}
Aggregations