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 testFieldMappingLegacyCompositeTypeWithRenaming() {
        int[] indices =
                TypeMappingUtils.computePhysicalIndices(
                        TableSchema.builder()
                                .field("a", DataTypes.BIGINT())
                                .field("b", DataTypes.STRING())
                                .build()
                                .getTableColumns(),
                        TypeConversions.fromLegacyInfoToDataType(
                                Types.TUPLE(Types.STRING, Types.LONG)),
                        str -> {
                            switch (str) {
                                case "a":
                                    return "f1";
                                case "b":
                                    return "f0";
                                default:
                                    throw new AssertionError();
                            }
                        });

        assertThat(indices).isEqualTo(new int[] {1, 0});
    }