class SchemaUtil {

  public static String buildAvroSchema(final Schema schema, String name) {

    org.apache.avro.SchemaBuilder.FieldAssembler fieldAssembler = org.apache.avro.SchemaBuilder
        .record(name).namespace("ksql")
        .fields();
    for (Field field : schema.fields()) {
      fieldAssembler
          .name(field.name().replace(".", "_"))
          .type(getAvroSchemaForField(field.schema()))
          .withDefault(null);
    }

    return fieldAssembler.endRecord().toString();
  }

}