You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "thswlsqls (via GitHub)" <gi...@apache.org> on 2026/07/17 07:36:09 UTC

[I] Flink: RANGE distribution mode ignores user-specified equality fields in dynamic sink [iceberg]

thswlsqls opened a new issue, #17274:
URL: https://github.com/apache/iceberg/issues/17274

   **Apache Iceberg version**
   main @ 8550723a7
   
   **Query engine**
   Flink
   
   **Please describe the bug**
   `RANGE` distribution mode in the dynamic sink ignores user-specified equality fields and routes rows round-robin.
   
   `HashKeyGenerator.getKeySelector()` `case RANGE` (`flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/sink/dynamic/HashKeyGenerator.java` line 176) tests `schema.identifierFieldIds().isEmpty()`, while sibling `case NONE` (line 127) and `case HASH` (line 138) test the `equalityFields` parameter. RANGE then passes `equalityFields` to `equalityFieldKeySelector` (line 189) — it checks the schema but uses the parameter.
   
   `equalityFields` comes from `DynamicSinkUtil.resolveEqualityFieldNames(record.equalityFields(), schema)` (line 83): user-specified fields when set, otherwise `schema.identifierFieldNames()`. The conditions diverge only when a user sets equality fields on a schema without identifier fields — RANGE falls back to `tableKeySelector` (round-robin) and logs `"because there are no equality fields set"`, contradicting the actual state.
   
   `DynamicWriter` (line 109) honors the user-specified fields, so rows sharing a key land on different subtasks while equality deletes are still emitted.
   
   **Steps to reproduce**
   Write with `DistributionMode.RANGE` and equality fields `{"id"}` to a table whose schema declares no identifier fields.
   Expected: rows sharing an `id` route to one subtask. Actual: round-robin.
   
   **Additional context**
   #16243 lifted the equality-field fallback into the caller (`resolveEqualityFieldNames`), making the RANGE schema check redundant.
   
   


-- 
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: issues-unsubscribe@iceberg.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [I] Flink: RANGE distribution mode ignores user-specified equality fields in dynamic sink [iceberg]

Posted by "mxm (via GitHub)" <gi...@apache.org>.
mxm closed issue #17274: Flink: RANGE distribution mode ignores user-specified equality fields in dynamic sink
URL: https://github.com/apache/iceberg/issues/17274


-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org