wypoon commented on code in PR #7733:
URL: https://github.com/apache/iceberg/pull/7733#discussion_r1274232520


##########
spark/v3.4/spark/src/main/java/org/apache/iceberg/spark/SparkReadConf.java:
##########
@@ -73,7 +73,12 @@ public boolean caseSensitive() {
 
   public boolean localityEnabled() {
     boolean defaultValue = Util.mayHaveBlockLocations(table.io(), 
table.location());
-    return PropertyUtil.propertyAsBoolean(readOptions, 
SparkReadOptions.LOCALITY, defaultValue);
+    return confParser
+        .booleanConf()
+        .option(SparkReadOptions.LOCALITY)
+        .sessionConf(SparkSQLProperties.LOCALITY_ENABLED)
+        .defaultValue(defaultValue)
+        .parse();

Review Comment:
   Actually, maybe it wouldn't throw an exception. But the default 
implementation of `FileSystem#getFileBlockLocations` does
   ```
                   String[] name = new String[]{"localhost:50010"};
                   String[] host = new String[]{"localhost"};
                   return new BlockLocation[]{new BlockLocation(name, host, 0L, 
file.getLen())};
   ```
   and from that, we get a `String[]` of the hosts, and that probably won't be 
too helpful to Spark.



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