sangkyoonnam opened a new pull request, #29599:
URL: https://github.com/apache/flink/pull/29599

   ## What is the purpose of the change
   
   In process mode, `MapState.contains(key)` returns `False` for a key whose 
value is `None`, because it checks `get(key) is None` instead of whether the 
key exists. This holds both before and after the write cache is committed. See 
[FLINK-41104](https://issues.apache.org/jira/browse/FLINK-41104).
   
   ## Brief change log
   
     - `InternalSynchronousMapRuntimeState.contains` reads the existence flag 
that the write cache and `CachingMapStateHandler.blocking_get` already keep, 
instead of comparing the value with `None`.
   
   ## Verifying this change
   
   This change added tests and can be verified as follows:
   
     - `test_map_state_contains_none_value` in `ProcessDataStreamTests` runs 
one record per bundle and checks `contains` for a key put with `None` before 
and after its bundle is committed, a missing key, a removed key, and a key put 
with `None` after `clear()`. On `master` every check of a `None`-valued key 
returns `False` in both the streaming and batch variants; it passes with the 
change.
     - `ProcessDataStreamStreamingTests` and `ProcessDataStreamBatchTests` pass 
locally (64 tests), and so does `pyflink/table/tests/test_udaf.py` (17 tests), 
since `MapView.contains` in the Table API goes through the same method.
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): no
     - The public API, i.e., is any changed class annotated with 
`@Public(Evolving)`: no
     - The serializers: no
     - The runtime per-record code paths (performance sensitive): yes, 
process-mode `MapState.contains`.
     - Anything that affects deployment or recovery: JobManager (and its 
components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
     - The S3 file system connector: no
   
   ## Documentation
   
     - Does this pull request introduce a new feature? no
     - If yes, how is the feature documented? not applicable
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes (please specify the tool below)
   
   AI was used for the implementation, the verification runs and this 
description.
   
   Generated-by: Claude Code 2.1.308 (Claude Opus 5.5)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to