[ 
https://issues.apache.org/jira/browse/FLINK-6552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16010498#comment-16010498
 ] 

ASF GitHub Bot commented on FLINK-6552:
---------------------------------------

Github user zentol commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3885#discussion_r116488176
  
    --- Diff: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/graph/StreamGraph.java
 ---
    @@ -318,9 +318,10 @@ public void addVirtualSideOutputNode(Integer 
originalId, Integer virtualId, Outp
                                continue;
                        }
     
    -                   if 
(!tag.f1.getTypeInfo().equals(outputTag.getTypeInfo())) {
    -                           throw new IllegalArgumentException("Trying to 
add a side input for the same id " +
    -                                           "with a different type. This is 
not allowed.");
    +                   if (tag.f1.getId().equals(outputTag.getId()) &&
    +                                   
!tag.f1.getTypeInfo().equals(outputTag.getTypeInfo())) {
    +                           throw new IllegalArgumentException("Trying to 
add a side output for the same" +
    +                                           "side-output id with a 
different type. This is not allowed.");
    --- End diff --
    
    Could also include the tag name for good measure.


> Side outputs don't allow differing output types
> -----------------------------------------------
>
>                 Key: FLINK-6552
>                 URL: https://issues.apache.org/jira/browse/FLINK-6552
>             Project: Flink
>          Issue Type: Improvement
>          Components: DataStream API
>    Affects Versions: 1.3.0, 1.4.0
>            Reporter: Chesnay Schepler
>            Assignee: Aljoscha Krettek
>            Priority: Blocker
>             Fix For: 1.3.0
>
>
> When calling {SingleOutputStreamOperator#getSideOutput(OutputTag<X>} multiple 
> times with the output tags having different types you get the following 
> exception:
> {code}
>  "Trying to add a side input for the same id with a different type. This is 
> not allowed." 
> {code}
> This error message is ambiguous, as it could either mean that you cannot add 
> 2 side outputs with the same name but different types or that 2 side outputs 
> with different types cannot be retrieved from a single operator.
> Furthermore, the error message contains the concept of node id's (i guess?) 
> which users aren't exposed to. This is confusing and should be reworded to 
> work with operators.
> Lastly, i find this limitation rather odd. It is possible for an operator to 
> have multiple side outputs. It is also possible to have a side output with a 
> different type than the main output. Yet, it is not possible to have multiple 
> side outputs with different types.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to