yuxiqian commented on code in PR #3749: URL: https://github.com/apache/flink-cdc/pull/3749#discussion_r1909700869
########## flink-cdc-composer/src/test/java/org/apache/flink/cdc/composer/flink/FlinkPipelineTransformITCase.java: ########## @@ -370,6 +371,99 @@ void testMultiTransformMissingProjection(ValuesDataSink.SinkApi sinkApi) throws "DataChangeEvent{tableId=default_namespace.default_schema.mytable2, before=[4, DERRIDA, 25, student], after=[], op=DELETE, meta=()}")); } + @ParameterizedTest + @EnumSource + void testMultiTransformSchemaColumnsCompatibility(ValuesDataSink.SinkApi sinkApi) { + TransformDef nullProjection = + new TransformDef( + "default_namespace.default_schema.mytable2", + null, + "age < 18", + null, + null, + null, + null, + null); + + TransformDef emptyProjection = + new TransformDef( + "default_namespace.default_schema.mytable2", + "", + "age < 18", + null, + null, + null, + null, + null); + + TransformDef asteriskProjection = + new TransformDef( + "default_namespace.default_schema.mytable2", + "*", + "age < 18", + null, + null, + null, + null, + null); + + List<TransformDef> transformDefList = + Arrays.asList(nullProjection, emptyProjection, asteriskProjection); + + for (TransformDef transformDef : transformDefList) { + assertThatThrownBy( + () -> + runGenericTransformTest( + sinkApi, + Arrays.asList( + transformDef, + new TransformDef( + "default_namespace.default_schema.mytable2", + // reference part column + "id,UPPER(name) AS name", + "age >= 18", + null, + null, + null, + null, + null)), + Collections.emptyList())) + .rootCause() + .isExactlyInstanceOf(IllegalStateException.class) + .hasMessage( + "Unable to merge schema columns={`id` BIGINT,`name` VARCHAR(255),`age` TINYINT,`description` STRING}, primaryKeys=id, options=() " + + "and columns={`id` BIGINT,`name` STRING}, primaryKeys=id, options=() with different column counts."); + } + + for (TransformDef transformDef : transformDefList) { + assertThatThrownBy( Review Comment: Seems this `assertThatTHrownBy` block still has no following assertions 🤕 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org