use of io.confluent.ksql.metastore.TypeRegistry.CustomType in project ksql by confluentinc.
the class ListTypesExecutorTest method setUp.
@Before
public void setUp() {
when(context.getMetaStore()).thenReturn(metaStore);
when(metaStore.types()).thenReturn(ImmutableList.of(new CustomType("foo", SqlPrimitiveType.of(SqlBaseType.STRING))).iterator());
}
use of io.confluent.ksql.metastore.TypeRegistry.CustomType in project ksql by confluentinc.
the class ListTypesExecutor method execute.
public static StatementExecutorResponse execute(final ConfiguredStatement<ListTypes> configuredStatement, final SessionProperties sessionProperties, final KsqlExecutionContext executionContext, final ServiceContext serviceContext) {
final ImmutableMap.Builder<String, SchemaInfo> types = ImmutableMap.builder();
final Iterator<CustomType> customTypes = executionContext.getMetaStore().types();
while (customTypes.hasNext()) {
final CustomType customType = customTypes.next();
types.put(customType.getName(), EntityUtil.schemaInfo(customType.getType()));
}
return StatementExecutorResponse.handled(Optional.of(new TypeList(configuredStatement.getStatementText(), types.build())));
}
Aggregations