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/09/10 00:15:52 UTC

[I] MR: IcebergSplit.getLocations discards cached block locations on repeated calls [iceberg]

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

   **Apache Iceberg version**
   main @ 9d7b2c52f
   
   **Query engine**
   None — the bug is in `iceberg-mr` and is engine-agnostic.
   
   **Please describe the bug**
   `IcebergSplit.getLocations()` (`mr/src/main/java/org/apache/iceberg/mr/mapreduce/IcebergSplit.java` line 70-82) returns the computed block locations on the first call and `["*"]` on every call after that, even though nothing about the split changed.
   
   The `transient locations` field and the `locations == null` check say the value is computed once and cached. The `else` branch defeats that: it runs whenever `locations` is already set and overwrites it with `ANYWHERE`. Hadoop's `InputSplit.getLocations()` contract expects repeated calls on an unchanged split to return the same value.
   
   The `else` branch came from #1582, which kept a deserialized split on a worker node (where `conf` is null) from hitting an NPE. Before that, #1192 had `if (locations == null)` alone.
   
   **Steps to reproduce**
   Build splits with `iceberg.mr.locality` enabled (`InputFormatConfig.ConfigBuilder.preferLocality()`) and call `getLocations()` twice on the same split.
   
   - Expected: both calls return the computed hosts, e.g. `["localhost"]`.
   - Actual: the first returns `["localhost"]`, the second returns `["*"]`.
   
   `TestIcebergInputFormats#testLocality` reproduces this without Docker.
   
   **Additional context**
   N/A
   


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