dawidwys commented on a change in pull request #7258: [FLINK-11084]Throw a hard
exception to remind developers while there's no stream node between two split
transformation
URL: https://github.com/apache/flink/pull/7258#discussion_r242535599
##########
File path:
flink-streaming-java/src/test/java/org/apache/flink/streaming/api/DataStreamTest.java
##########
@@ -1091,6 +1091,94 @@ public void testChannelSelectors() {
assertTrue(globalPartitioner instanceof GlobalPartitioner);
}
+ /////////////////////////////////////////////////////////////
+ // Split testing
+ /////////////////////////////////////////////////////////////
+
+ @Test
+ public void testConsecutiveSplitRejection() {
+ StreamExecutionEnvironment env =
StreamExecutionEnvironment.getExecutionEnvironment();
+
+ DataStreamSource<Integer> src = env.fromElements(0, 0);
+
+ OutputSelector<Integer> outputSelector = new
OutputSelector<Integer>() {
+ @Override
+ public Iterable<String> select(Integer value) {
+ return null;
+ }
+ };
+
+ src.split(outputSelector).split(outputSelector).addSink(new
DiscardingSink<>());
+
+ expectedException.expect(IllegalStateException.class);
+ expectedException.expectMessage("Error while tranforming
SplitTransformation, please use side output instead.");
+
+ env.getStreamGraph();
+ }
+
+ @Test
+ public void testSelectBetweenConsecutiveSplitRejection() {
+ StreamExecutionEnvironment env =
StreamExecutionEnvironment.getExecutionEnvironment();
+
+ DataStreamSource<Integer> src = env.fromElements(0, 0);
+
+ OutputSelector<Integer> outputSelector = new
OutputSelector<Integer>() {
Review comment:
Could you extract common `outputSelector`?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services