aokolnychyi commented on code in PR #6655:
URL: https://github.com/apache/iceberg/pull/6655#discussion_r1093711041
##########
spark/v3.3/spark/src/main/java/org/apache/iceberg/spark/SparkReadConf.java:
##########
@@ -67,7 +67,7 @@ public boolean caseSensitive() {
}
public boolean localityEnabled() {
- if (table.io() instanceof HadoopFileIO) {
+ if (Util.isHDFSLocation(table.io(), table.location())) {
HadoopInputFile file = (HadoopInputFile)
table.io().newInputFile(table.location());
Review Comment:
This bit seems repetitive in Spark and Flink. What about adding a new method
to `Util`?
```
public static boolean mayHaveBlockLocations(FileIO io, String location) {
if (usesHadoopFileIO(io, location)) {
...
return LOCALITY_WHITELIST_FS.contains(scheme);
}
return false;
}
```
I feel it would align well with other methods in `Util` like
`blockLocations`.
--
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]