Search in sources :

Example 1 with SqlSchemaBuilder

use of org.apache.samza.sql.schema.SqlSchemaBuilder in project samza by apache.

the class AvroTypeFactoryImpl method convertSchema.

private SqlSchema convertSchema(List<Schema.Field> fields, boolean isTopLevelField) {
    SqlSchemaBuilder schemaBuilder = SqlSchemaBuilder.builder();
    for (Schema.Field field : fields) {
        SqlFieldSchema fieldSchema = convertField(field.schema(), false, isOptional(field, isTopLevelField));
        schemaBuilder.addField(field.name(), fieldSchema);
    }
    return schemaBuilder.build();
}
Also used : SqlFieldSchema(org.apache.samza.sql.schema.SqlFieldSchema) SqlFieldSchema(org.apache.samza.sql.schema.SqlFieldSchema) Schema(org.apache.avro.Schema) SqlSchema(org.apache.samza.sql.schema.SqlSchema) SqlSchemaBuilder(org.apache.samza.sql.schema.SqlSchemaBuilder)

Aggregations

Schema (org.apache.avro.Schema)1 SqlFieldSchema (org.apache.samza.sql.schema.SqlFieldSchema)1 SqlSchema (org.apache.samza.sql.schema.SqlSchema)1 SqlSchemaBuilder (org.apache.samza.sql.schema.SqlSchemaBuilder)1