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

Till Rohrmann commented on FLINK-20580:
---------------------------------------

Thanks for further looking into the problem [~kezhuw]. I think the answer 
depends on whether we want to support {{null}} values or not in 
{{SerializedValue}}.

If we want to support {{null}} values, then returning an empty {{byte[]}} does 
not work because it would not deserialize to {{null}}. This would be somewhat 
surprising given that {{SerializedValue.getByteArray}} should return the bytes 
of the serialized value.

Since {{null}} values are always a bit problematic I think it would be good to 
get rid of them as much as possible. Hence, I like your idea of only accepting 
non-null values for the {{SerializedValue}}. So if there are only few places 
where {{SerializedValue}} is used with {{null}} values, then this sounds like 
my preferred solution. 

Moreover, I think you are completely right that the {{RpcService}} should use 
their own abstraction to send serialized data over the wire. That way it would 
be decoupled from what the user actually returns. With {{SerializedValue}} this 
can lead currently to incorrect results in the case of local communication and 
a RPC returning a {{SerializedValue}}.

> Missing null value handling for SerializedValue's getByteArray() 
> -----------------------------------------------------------------
>
>                 Key: FLINK-20580
>                 URL: https://issues.apache.org/jira/browse/FLINK-20580
>             Project: Flink
>          Issue Type: Bug
>          Components: API / Type Serialization System
>    Affects Versions: 1.13.0
>            Reporter: Matthias
>            Assignee: Kezhu Wang
>            Priority: Minor
>              Labels: pull-request-available, starter
>
> {{SerializedValue}} allows to wrap {{null}} values. Because of this, 
> {{SerializedValue.getByteArray()}} might return {{null}} which is not 
> properly handled in different locations (it's probably the best to use the 
> IDEs "Find usages" to identify these locations). The most recent findings 
> (for now) are listed in the comments.
> We should add null handling in these cases and add tests for these cases.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to