Search in sources :

Example 21 with FieldInfo

use of io.confluent.ksql.rest.entity.FieldInfo in project ksql by confluentinc.

the class EntityUtilTest method shouldNotExposeMetaColumns.

@Test
public void shouldNotExposeMetaColumns() {
    // Given:
    final LogicalSchema schema = LogicalSchema.builder().valueColumn(ColumnName.of("bob"), SqlTypes.STRING).build();
    // When:
    final List<FieldInfo> fields = EntityUtil.buildSourceSchemaEntity(schema);
    // Then:
    assertThat(fields, hasSize(1));
}
Also used : LogicalSchema(io.confluent.ksql.schema.ksql.LogicalSchema) FieldInfo(io.confluent.ksql.rest.entity.FieldInfo) Test(org.junit.Test)

Example 22 with FieldInfo

use of io.confluent.ksql.rest.entity.FieldInfo in project ksql by confluentinc.

the class ConsoleTest method shouldPrintTypesList.

@Test
public void shouldPrintTypesList() {
    // Given:
    final KsqlEntityList entities = new KsqlEntityList(ImmutableList.of(new TypeList("statement", ImmutableMap.of("typeB", new SchemaInfo(SqlBaseType.ARRAY, null, new SchemaInfo(SqlBaseType.STRING, null, null)), "typeA", new SchemaInfo(SqlBaseType.STRUCT, ImmutableList.of(new FieldInfo("f1", new SchemaInfo(SqlBaseType.STRING, null, null), Optional.empty())), null), "typeC", new SchemaInfo(SqlBaseType.DECIMAL, null, null, ImmutableMap.of("precision", 10, "scale", 9))))));
    // When:
    console.printKsqlEntityList(entities);
    // Then:
    final String output = terminal.getOutputString();
    Approvals.verify(output, approvalOptions);
}
Also used : KsqlEntityList(io.confluent.ksql.rest.entity.KsqlEntityList) Matchers.containsString(org.hamcrest.Matchers.containsString) TypeList(io.confluent.ksql.rest.entity.TypeList) FieldInfo(io.confluent.ksql.rest.entity.FieldInfo) SchemaInfo(io.confluent.ksql.rest.entity.SchemaInfo) Test(org.junit.Test)

Aggregations

FieldInfo (io.confluent.ksql.rest.entity.FieldInfo)22 Test (org.junit.Test)20 LogicalSchema (io.confluent.ksql.schema.ksql.LogicalSchema)13 QueryId (io.confluent.ksql.query.QueryId)8 RunningQuery (io.confluent.ksql.rest.entity.RunningQuery)8 KsqlEntityList (io.confluent.ksql.rest.entity.KsqlEntityList)7 SourceDescriptionEntity (io.confluent.ksql.rest.entity.SourceDescriptionEntity)7 Matchers.containsString (org.hamcrest.Matchers.containsString)7 SchemaInfo (io.confluent.ksql.rest.entity.SchemaInfo)5 QueryError (io.confluent.ksql.query.QueryError)3 QueryDescription (io.confluent.ksql.rest.entity.QueryDescription)3 QueryDescriptionEntity (io.confluent.ksql.rest.entity.QueryDescriptionEntity)3 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)2 ImmutableList (com.google.common.collect.ImmutableList)2 ImmutableMap (com.google.common.collect.ImmutableMap)2 BaseApiTest (io.confluent.ksql.api.BaseApiTest)2 CliSpecificCommand (io.confluent.ksql.cli.console.cmd.CliSpecificCommand)2 Stat (io.confluent.ksql.metrics.TopicSensors.Stat)2 ArgumentInfo (io.confluent.ksql.rest.entity.ArgumentInfo)2 CommandStatusEntity (io.confluent.ksql.rest.entity.CommandStatusEntity)2