public static int[] computePhysicalIndices(
            List<TableColumn> logicalColumns,
            DataType physicalType,
            Function<String, String> nameRemapping) {

        Map<TableColumn, Integer> physicalIndexLookup =
                computePhysicalIndices(logicalColumns.stream(), physicalType, nameRemapping);

        return logicalColumns.stream().mapToInt(physicalIndexLookup::get).toArray();
    }
@Test
    void testFieldMappingRowTypeNotMatchingTypesInNestedType() {
        assertThatThrownBy(
                        () ->
                                TypeMappingUtils.computePhysicalIndices(
                                        TableSchema.builder()
                                                .field("f0", DECIMAL(38, 18))
                                                .field(
                                                        "f1",
                                                        ROW(
                                                                FIELD("f1_0", BIGINT()),
                                                                FIELD("f1_1", STRING())))
                                                .build()
                                                .getTableColumns(),
                                        ROW(
                                                FIELD("f0", DECIMAL(38, 18)),
                                                FIELD(
                                                        "f1",
                                                        ROW(
                                                                FIELD("f1_0", STRING()),
                                                                FIELD("f1_1", STRING())))),
                                        Function.identity()))
                .isInstanceOf(ValidationException.class)
                .hasMessage(
                        "Type ROW<`f1_0` BIGINT, `f1_1` STRING> of table field 'f1' does not "
                                + "match with the physical type ROW<`f1_0` STRING, `f1_1` STRING> "
                                + "of the 'f1' field of the TableSource return type.");
    }