public static List<String> getFieldNames(DataType dataType) {
        final LogicalType type = dataType.getLogicalType();
        if (type.is(LogicalTypeRoot.DISTINCT_TYPE)) {
            return getFieldNames(dataType.getChildren().get(0));
        } else if (isCompositeType(type)) {
            return LogicalTypeChecks.getFieldNames(type);
        }
        return Collections.emptyList();
    }
@Test
    void testGetFieldNames() {
        assertThat(
                        DataType.getFieldNames(
                                ROW(
                                        FIELD("c0", BOOLEAN()),
                                        FIELD("c1", DOUBLE()),
                                        FIELD("c2", INT()))))
                .containsExactly("c0", "c1", "c2");
        assertThat(
                        DataType.getFieldNames(
                                STRUCTURED(
                                        DataTypesTest.SimplePojo.class,
                                        FIELD("name", STRING()),
                                        FIELD("count", INT().notNull().bridgedTo(int.class)))))
                .containsExactly("name", "count");
        assertThat(DataType.getFieldNames(ARRAY(INT()))).isEmpty();
        assertThat(DataType.getFieldNames(INT())).isEmpty();
    }