public static Schema convertToSchema(LogicalType schema) {
        return convertToSchema(schema, true);
    }
@Test
    void testRowTypeAvroSchemaConversion() {
        RowType rowType =
                (RowType)
                        ResolvedSchema.of(
                                        Column.physical(
                                                "row1",
                                                DataTypes.ROW(
                                                        DataTypes.FIELD("a", DataTypes.STRING()))),
                                        Column.physical(
                                                "row2",
                                                DataTypes.ROW(
                                                        DataTypes.FIELD("b", DataTypes.STRING()))),
                                        Column.physical(
                                                "row3",
                                                DataTypes.ROW(
                                                        DataTypes.FIELD(
                                                                "row3",
                                                                DataTypes.ROW(
                                                                        DataTypes.FIELD(
                                                                                "c",
                                                                                DataTypes
                                                                                        .STRING()))))))
                                .toSourceRowDataType()
                                .getLogicalType();
        Schema schema = AvroSchemaConverter.convertToSchema(rowType);
        assertThat(schema.toString(true))
                .isEqualTo(
                        "{\n"
                                + "  \"type\" : \"record\",\n"
                                + "  \"name\" : \"record\",\n"
                                + "  \"namespace\" : \"org.apache.flink.avro.generated\",\n"
                                + "  \"fields\" : [ {\n"
                                + "    \"name\" : \"row1\",\n"
                                + "    \"type\" : [ \"null\", {\n"
                                + "      \"type\" : \"record\",\n"
                                + "      \"name\" : \"record_row1\",\n"
                                + "      \"fields\" : [ {\n"
                                + "        \"name\" : \"a\",\n"
                                + "        \"type\" : [ \"null\", \"string\" ],\n"
                                + "        \"default\" : null\n"
                                + "      } ]\n"
                                + "    } ],\n"
                                + "    \"default\" : null\n"
                                + "  }, {\n"
                                + "    \"name\" : \"row2\",\n"
                                + "    \"type\" : [ \"null\", {\n"
                                + "      \"type\" : \"record\",\n"
                                + "      \"name\" : \"record_row2\",\n"
                                + "      \"fields\" : [ {\n"
                                + "        \"name\" : \"b\",\n"
                                + "        \"type\" : [ \"null\", \"string\" ],\n"
                                + "        \"default\" : null\n"
                                + "      } ]\n"
                                + "    } ],\n"
                                + "    \"default\" : null\n"
                                + "  }, {\n"
                                + "    \"name\" : \"row3\",\n"
                                + "    \"type\" : [ \"null\", {\n"
                                + "      \"type\" : \"record\",\n"
                                + "      \"name\" : \"record_row3\",\n"
                                + "      \"fields\" : [ {\n"
                                + "        \"name\" : \"row3\",\n"
                                + "        \"type\" : [ \"null\", {\n"
                                + "          \"type\" : \"record\",\n"
                                + "          \"name\" : \"record_row3_row3\",\n"
                                + "          \"fields\" : [ {\n"
                                + "            \"name\" : \"c\",\n"
                                + "            \"type\" : [ \"null\", \"string\" ],\n"
                                + "            \"default\" : null\n"
                                + "          } ]\n"
                                + "        } ],\n"
                                + "        \"default\" : null\n"
                                + "      } ]\n"
                                + "    } ],\n"
                                + "    \"default\" : null\n"
                                + "  } ]\n"
                                + "}");
    }