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

Sangkyoon Nam commented on FLINK-41103:
---------------------------------------

[~dianfu], I'd like to take this one. At {{e206faa4ca2}}, in a backend-level 
check with remote state I/O modeled, committing an integer ValueState after 
{{update(None)}} fails with {{required argument is not an integer}}. With 
{{add()}} skipped for {{None}}, the same check completes and the next bundle 
reads {{None}}. I'll add a regression test for it. Could you assign this to me?

> ValueState.update(None) attempts to serialize None instead of clearing the 
> state
> --------------------------------------------------------------------------------
>
>                 Key: FLINK-41103
>                 URL: https://issues.apache.org/jira/browse/FLINK-41103
>             Project: Flink
>          Issue Type: Bug
>          Components: API / Python
>            Reporter: Dian Fu
>            Priority: Major
>
> The ValueState update contract specifies that a null value removes the 
> current key's state. In PyFlink process mode, update(None) instead appends 
> None to the underlying Beam bag after clearing it.
> Reproduction using integer ValueState without TTL:
> 1. Write an integer value and complete a bundle.
> 2. Call state.update(None).
> 3. Complete the next bundle.
> Expected:
> The bundle completes successfully and subsequent reads return None.
> Actual:
> The bundle flush fails with "struct.error: required argument is not an 
> integer" when the buffered None is serialized. Reading immediately after 
> update(None) may appear correct because the pending local value is None.
> Root cause:
> SynchronousValueRuntimeState.update() unconditionally calls 
> self._internal_state.add(value), including when value is None.
> The affected implementation is in 
> flink-python/pyflink/fn_execution/state_impl.py. The null case should clear 
> the state without appending a value, while preserving the applicable flush 
> policy.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to