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

   ## What is the purpose of the change
   
   In process mode, `MapState.put_all()` iterates the dictionary instead of its 
items. A non-iterable key, such as an integer, raises `TypeError`, and a 
two-character string key is unpacked into the wrong entry: `put_all({'ab': 
'v'})` stores `'a' -> 'b'`. See 
[FLINK-41106](https://issues.apache.org/jira/browse/FLINK-41106).
   
   ## Brief change log
   
     - `InternalSynchronousMapRuntimeState.put_all` iterates 
`dict_value.items()`.
   
   ## Verifying this change
   
   This change added tests and can be verified as follows:
   
     - `test_map_state_put_all` in `ProcessDataStreamTests` puts an integer key 
and the string key `'ab'` through `put_all` and checks the stored entries. It 
fails on `master` with `TypeError: cannot unpack non-iterable int object` in 
both the streaming and batch variants, and passes with the change.
     - `ProcessDataStreamStreamingTests` and `ProcessDataStreamBatchTests` pass 
locally (64 tests).
   
   ## 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 map state updates through `put_all`.
     - 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