use of io.confluent.ksql.parser.tree.ShowColumns in project ksql by confluentinc.
the class KsqlResourceTest method testDescribeStatement.
@Test
public void testDescribeStatement() throws Exception {
KsqlResource testResource = TestKsqlResourceUtil.get(ksqlEngine, ksqlRestConfig);
final String tableName = "TEST_TABLE";
final String ksqlString = String.format("DESCRIBE %s;", tableName);
final ShowColumns ksqlStatement = new ShowColumns(QualifiedName.of(tableName), false, false);
SourceDescription testDescription = makeSingleRequest(testResource, ksqlString, ksqlStatement, Collections.emptyMap(), SourceDescription.class);
SourceDescription expectedDescription = new SourceDescription(testResource.getKsqlEngine().getMetaStore().getSource(tableName), false, "serdes", "topo", "exec-plan", Collections.EMPTY_LIST, Collections.EMPTY_LIST, null);
assertEquals(expectedDescription, testDescription);
}
use of io.confluent.ksql.parser.tree.ShowColumns in project ksql by confluentinc.
the class KsqlResourceTest method testErroneousStatement.
@Test
public void testErroneousStatement() throws Exception {
KsqlResource testResource = TestKsqlResourceUtil.get(ksqlEngine, ksqlRestConfig);
final String ksqlString = "DESCRIBE nonexistent_table;";
final ShowColumns ksqlStatement = new ShowColumns(QualifiedName.of("nonexistent_table"), false, false);
KsqlEntity resultEntity = makeSingleRequest(testResource, ksqlString, ksqlStatement, Collections.emptyMap(), ErrorMessageEntity.class);
assertEquals(ErrorMessageEntity.class, resultEntity.getClass());
}
Aggregations