@Override
  public String format(final Schema schema) {
    final String converted = SchemaWalker.visit(schema, new Converter()) + typePostFix(schema);

    return options.contains(Option.AS_COLUMN_LIST)
        ? stripTopLevelStruct(converted)
        : converted;
  }
@Test
  public void shouldFormatOptionalStructAsColumns() {
    // Given:
    final Schema structSchema = SchemaBuilder.struct()
        .field("COL1", Schema.OPTIONAL_STRING_SCHEMA)
        .field("COL4", SchemaBuilder
            .array(Schema.OPTIONAL_FLOAT64_SCHEMA)
            .optional()
            .build())
        .field("COL5", SchemaBuilder
            .map(Schema.OPTIONAL_STRING_SCHEMA, Schema.OPTIONAL_FLOAT64_SCHEMA)
            .optional()
            .build())
        .optional()
        .build();

    final SqlSchemaFormatter formatter = new SqlSchemaFormatter(
        DO_NOT_ESCAPE_COLUMN_NAMES,
        Option.AS_COLUMN_LIST,
        Option.APPEND_NOT_NULL
    );

    // When:
    final String result = formatter.format(structSchema);

    // Then:
    assertThat(result, is(
        "COL1 VARCHAR, "
            + "COL4 ARRAY<DOUBLE>, "
            + "COL5 MAP<VARCHAR, DOUBLE>"));
  }