thswlsqls opened a new pull request, #17459:
URL: https://github.com/apache/iceberg/pull/17459

   ## Summary
   
   - Backport of #17276 to the Flink 1.20 and 2.0 modules, requested by @mxm on 
that PR.
   - In `HashKeyGenerator.getKeySelector()`, the `RANGE` branch decided the 
fallback to the `none` distribution mode from `schema.identifierFieldIds()` 
instead of the `equalityFields` passed in. A caller who supplied equality 
fields for a schema without identifier fields had them ignored, and rows 
sharing a key could land on different writers.
   - The branch now checks `equalityFields.isEmpty()`, matching the 
neighbouring `HASH` branch and the warning message in that same block.
   - Same one-line change as d8c10a1608170f0ba83be740d6ab0b6a3757cb3e on 2.1, 
applied to both modules. Flink 2.1 is untouched.
   
   ## Testing done
   
   - Backported the two tests added by #17276: 
`TestHashKeyGenerator#testRangeModeWithEqualityFields` (equal values share a 
write key, different values do not) and 
`#testRangeModeFallsBackToDistributionModeNone` (the round-robin fallback still 
works).
   - `:iceberg-flink:iceberg-flink-1.20:test` and 
`:iceberg-flink:iceberg-flink-2.0:test` with `--tests "*TestHashKeyGenerator*"` 
— 18 tests passed on each.
   - Reverting the production change makes `testRangeModeWithEqualityFields` 
fail on both versions, so it covers the bug.
   
   ---
   **AI Disclosure**
   - Model: Claude Opus 5
   - Platform/Tool: Claude Code
   - Human Oversight: fully reviewed
   - Prompt Summary: Backport the already-merged fix from #17276 (RANGE 
distribution ignoring user-specified equality fields in `HashKeyGenerator`) and 
its tests from the Flink 2.1 module to the Flink 1.20 and 2.0 modules in a 
single PR, then build and run the affected tests on both versions.
   
   
   


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to