@VisibleForTesting
  static String logicalToProtoSchema(final LogicalSchema schema) {
    final ConnectSchema connectSchema = ConnectSchemas.columnsToConnectSchema(schema.columns());

    final ProtobufSchema protobufSchema = new ProtobufData(
            new ProtobufDataConfig(ImmutableMap.of())).fromConnectSchema(connectSchema);
    return protobufSchema.canonicalString();
  }
@Test
  public void shouldFailNestedArraysConvertLogicalSchemaToProtobufSchema() {
    // Given:
    final LogicalSchema schema = LogicalSchema.builder()
            .valueColumn(ColumnName.of("COMPLEX"), SqlTypes.struct()
                    .field("ARRAY_ARRAY", SqlTypes.array(SqlTypes.array(SqlTypes.STRING)))
                    .build()
            )
            .build();

    // When:
    Exception exception = assertThrows(IllegalArgumentException.class, () -> {
      JsonStreamedRowResponseWriter.logicalToProtoSchema(schema);
    });

    String expectedMessage = "Array cannot be nested";
    String actualMessage = exception.getMessage();

    // Then:
    assertThat(actualMessage.contains(expectedMessage), is(true));
  }