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 testFieldMappingLegacyDecimalTypeNotMatchingPrecision() {
        assertThatThrownBy(
                        () ->
                                TypeMappingUtils.computePhysicalIndices(
                                        TableSchema.builder()
                                                .field("f0", DECIMAL(38, 10))
                                                .build()
                                                .getTableColumns(),
                                        ROW(
                                                FIELD(
                                                        "f0",
                                                        TypeConversions.fromLegacyInfoToDataType(
                                                                Types.BIG_DEC))),
                                        Function.identity()))
                .isInstanceOf(ValidationException.class)
                .hasMessage(
                        "Type DECIMAL(38, 10) of table field 'f0' does not match with the "
                                + "physical type LEGACY('DECIMAL', 'DECIMAL') of the "
                                + "'f0' field of the TableSource return type.")
                .cause()
                .isInstanceOf(ValidationException.class)
                .hasMessage("Legacy decimal type can only be mapped to DECIMAL(38, 18).");
    }