use of io.confluent.ksql.schema.ksql.SimpleColumn in project ksql by confluentinc.
the class KsqlDelimitedDeserializer method buildParsers.
private static List<Parser> buildParsers(final PersistenceSchema schema) {
final List<Parser> parsers = new ArrayList<>(schema.columns().size());
for (final SimpleColumn column : schema.columns()) {
final SqlBaseType baseType = column.type().baseType();
final ParserFactory parserFactory = PARSERS.get(baseType);
if (parserFactory == null) {
throw new KsqlException("The '" + FormatFactory.DELIMITED.name() + "' format does not support type '" + baseType + "', column: " + column.name());
}
parsers.add(parserFactory.build(column.type()));
}
return parsers;
}
use of io.confluent.ksql.schema.ksql.SimpleColumn in project ksql by confluentinc.
the class ConnectFormatSchemaTranslatorTest method createColumn.
private static SimpleColumn createColumn(final String name, final SqlType sqlType) {
final SimpleColumn column = mock(SimpleColumn.class);
when(column.name()).thenReturn(ColumnName.of(name));
when(column.type()).thenReturn(sqlType);
return column;
}
use of io.confluent.ksql.schema.ksql.SimpleColumn in project ksql by confluentinc.
the class ConnectFormatTest method shouldCallSubclassToCreateOuterWhenWrapped.
@Test
public void shouldCallSubclassToCreateOuterWhenWrapped() {
// Given:
final SimpleColumn singleColumn = createColumn("bob", SqlTypes.INTEGER);
when(persistenceSchema.columns()).thenReturn(ImmutableList.of(singleColumn));
// When:
format.getSerde(persistenceSchema, formatProps, config, srFactory, false);
// Then:
verify(format).getConnectSerde(SINGLE_FIELD_SCHEMA, formatProps, config, srFactory, Struct.class, false);
}
use of io.confluent.ksql.schema.ksql.SimpleColumn in project ksql by confluentinc.
the class GenericKeySerDeTest method column.
private static SimpleColumn column(final SqlType type) {
final SimpleColumn column = mock(SimpleColumn.class, type.toString());
when(column.name()).thenReturn(COLUMN_NAME);
when(column.type()).thenReturn(type);
return column;
}
use of io.confluent.ksql.schema.ksql.SimpleColumn in project ksql by confluentinc.
the class AvroFormatTest method column.
private static SimpleColumn column(final String name) {
final SimpleColumn column = mock(SimpleColumn.class);
when(column.name()).thenReturn(ColumnName.of(name));
when(column.type()).thenReturn(SqlTypes.BIGINT);
return column;
}
Aggregations