public static ConsumingResult createConsumingResult(
            DataTypeFactory dataTypeFactory,
            TypeInformation<?> inputTypeInfo,
            @Nullable Schema declaredSchema) {
        final DataType inputDataType =
                TypeInfoDataTypeConverter.toDataType(dataTypeFactory, inputTypeInfo);
        return createConsumingResult(dataTypeFactory, inputDataType, declaredSchema, true);
    }
@Test
    void testInputFromRowWithPhysicalDeclaredSchema() {
        final TypeInformation<?> inputTypeInfo =
                Types.ROW(Types.INT, Types.LONG, Types.GENERIC(BigDecimal.class), Types.BOOLEAN);

        final ConsumingResult result =
                SchemaTranslator.createConsumingResult(
                        dataTypeFactoryWithRawType(BigDecimal.class),
                        inputTypeInfo,
                        Schema.newBuilder()
                                .primaryKeyNamed("pk", "f0")
                                .column("f1", BIGINT()) // reordered
                                .column("f0", INT())
                                .columnByExpression("computed", "f1 + 42")
                                .column("f2", DECIMAL(10, 2)) // enriches
                                .columnByExpression("computed2", "f1 - 1")
                                .build());

        assertThat(result.getPhysicalDataType())
                .isEqualTo(
                        ROW(
                                        FIELD("f0", INT()),
                                        FIELD("f1", BIGINT()),
                                        FIELD("f2", DECIMAL(10, 2)),
                                        FIELD("f3", BOOLEAN()))
                                .notNull());

        assertThat(result.isTopLevelRecord()).isTrue();

        assertThat(result.getSchema())
                .isEqualTo(
                        Schema.newBuilder()
                                .column("f0", INT())
                                .column("f1", BIGINT())
                                .column("f2", DECIMAL(10, 2))
                                .column("f3", BOOLEAN())
                                .columnByExpression("computed", "f1 + 42")
                                .columnByExpression("computed2", "f1 - 1")
                                .primaryKeyNamed("pk", "f0")
                                .build());

        assertThat(result.getProjections())
                .isEqualTo(Arrays.asList("f1", "f0", "computed", "f2", "computed2"));
    }