thswlsqls opened a new pull request, #17276:
URL: https://github.com/apache/iceberg/pull/17276
Closes #17274
## Summary
- `case RANGE` in `HashKeyGenerator.getKeySelector()` tested
`schema.identifierFieldIds().isEmpty()` but passed the `equalityFields`
parameter to `equalityFieldKeySelector`. Siblings `case NONE` and `case HASH`
test `equalityFields.isEmpty()`; RANGE now matches.
- Previously, equality fields on a schema without identifier fields fell
back to round-robin while `DynamicWriter` still emitted equality deletes for
them; the `"because there are no equality fields set"` warning, left unchanged,
now matches the condition.
- Backward compatible: `equalityFields` comes from
`DynamicSinkUtil.resolveEqualityFieldNames(record.equalityFields(), schema)`,
which falls back to `schema.identifierFieldNames()` when unset, so
`equalityFields.isEmpty()` implies `schema.identifierFieldIds().isEmpty()`.
`getKeySelector` is private with one caller, so only the user-specified case
changes behavior.
- #16243 lifted that fallback into the caller, making the RANGE schema check
redundant.
## Testing done
- Added `TestHashKeyGenerator#rangeModeWithEqualityFields` (RANGE, equality
fields `{"id"}`, schema without identifier fields). Fails before the change,
passes after.
- `:iceberg-flink:iceberg-flink-2.1:test --tests "*TestHashKeyGenerator*"` —
17 tests passed.
- Same task for `*TestDynamicRecordProcessor*`, `*TestDynamicWriter*`,
`*TestDynamicRecordWithConfig*`, `*TestTableUpdater*` — 30 tests passed.
- `spotlessCheck`, `checkstyleMain`, `checkstyleTest` passed. The full
module `:check` was not run — its MiniCluster suites do not complete here.
Flink is not a REVAPI module.
--
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]