Github user kl0u commented on a diff in the pull request: https://github.com/apache/flink/pull/3484#discussion_r105402262 --- Diff: flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/OperatorChain.java --- @@ -539,5 +625,26 @@ public void collect(StreamRecord<T> record) { // don't copy for the last output outputs[outputs.length - 1].collect(record); } + + @Override + public <X> void collect( + OutputTag<?> outputTag, StreamRecord<X> record) { + for (int i = 0; i < outputs.length - 1; i++) { + Output<StreamRecord<T>> output = outputs[i]; + + // due to side outputs, StreamRecords of varying types can pass through the broadcasting + // collector so we need to cast + @SuppressWarnings({"unchecked", "rawtypes"}) + StreamRecord<T> shallowCopy = (StreamRecord<T>) record.copy(record.getValue()); + output.collect(shallowCopy); + } + --- End diff -- Duplicate comment with the one inside the loop. Also the "// don't copy for the last output" is not right because we actually create a copy before.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---