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

Flink Jira Bot commented on FLINK-15424:
----------------------------------------

This issue is assigned but has not received an update in 7 days so it has been 
labeled "stale-assigned". If you are still working on the issue, please give an 
update and remove the label. If you are no longer working on the issue, please 
unassign so someone else may work on it. In 7 days the issue will be 
automatically unassigned.

> Make all AppendingState#add respect the java doc
> ------------------------------------------------
>
>                 Key: FLINK-15424
>                 URL: https://issues.apache.org/jira/browse/FLINK-15424
>             Project: Flink
>          Issue Type: Bug
>          Components: API / DataStream, Runtime / State Backends
>    Affects Versions: 1.8.3, 1.9.1
>            Reporter: Congxian Qiu
>            Assignee: Congxian Qiu
>            Priority: Major
>              Labels: pull-request-available, stale-assigned
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Currently, We have a java doc in 
> {{[AppendingState#add|https://github.com/apache/flink/blob/52fdee1d0c7af24d25c51caa073e29f11b07210b/flink-core/src/main/java/org/apache/flink/api/common/state/AppendingState.java#L63]}}
> {code:java}
> <p> If null is passed in, the state value will remain unchanged.{code}
> but currently, the implementation did not respect this, take 
> {{HeapReducingState}} as an example, we'll clear the state if the passed 
> parameter is null
> {code:java}
> @Override     
> public void add(V value) throws IOException {
>     if (value == null) {                      
>         clear();                      
>         return;               
>     }
>     try {                     
>         stateTable.transform(currentNamespace, value, reduceTransformation);  
>                     } catch (Exception e) {                     
>         throw new IOException("Exception while applying ReduceFunction in 
> reducing state", e);                
>     } 
> }
> {code}
> But in {{RocksDBReducingState}}  we would not clear the state, and put the 
> null value into state if serializer can serialize null.
> {code:java}
> @Override
> public void add(V value) throws Exception {
>    byte[] key = getKeyBytes();
>    V oldValue = getInternal(key);
>    V newValue = oldValue == null ? value : reduceFunction.reduce(oldValue, 
> value);
>    updateInternal(key, newValue);
> }
> {code}
> this issue wants to make all {{Appending}}State respect the javadoc of 
> {{AppendingState}}, and return directly if the passed in parameter is null.



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

Reply via email to