bgeng777 opened a new pull request, #29472: URL: https://github.com/apache/flink/pull/29472
## What is the purpose of the change Fixes [FLINK-40986](https://issues.apache.org/jira/browse/FLINK-40986). Named PyFlink Rows with the same field names and values compare equal regardless of field order, but previously could produce different hashes. This caused duplicate entries in Python sets and failed dictionary lookups. For example, `Row(a=1, b=2)` and `Row(b=2, a=1)` compare equal and should work interchangeably as dictionary keys. ## Brief change log - Hash named Rows using a frozenset of field-name/value pairs, making the hash independent of field order. - Preserve stored field order and positional Row hashing. - Add regression tests for hash consistency, set deduplication, dictionary lookup and replacement, nested Rows, and unhashable values. ## Verifying this change This change added tests and can be verified as follows: - Added six Python unit tests covering keyword and factory-created Rows, all RowKind values, and the scenarios above. - Verified that the regression tests expose the original defect and pass with the fix. - Four existing tests covering Row conversion, construction, and nested schema inference also pass. - Flake8 and `git diff --check` pass. Run the new tests with: PYTHONPATH=flink-python python -m unittest -v pyflink.common.tests.test_types Full Maven verification and the complete integration test suite were not run locally. ## 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): no - 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) Generated-by: Codex (GPT-6) -- 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]
