kbendick commented on code in PR #5504:
URL: https://github.com/apache/iceberg/pull/5504#discussion_r943735990


##########
spark/v2.4/spark/src/main/java/org/apache/iceberg/spark/source/Reader.java:
##########
@@ -111,29 +107,7 @@
     this.baseScan = configureBaseScan(caseSensitive, options);
     this.schema = baseScan.schema();
 
-    if (table.io() instanceof HadoopFileIO) {
-      String fsscheme = "no_exist";
-      try {
-        Configuration conf = 
SparkSession.active().sessionState().newHadoopConf();
-        // merge hadoop config set on table
-        mergeIcebergHadoopConfs(conf, table.properties());
-        // merge hadoop config passed as options and overwrite the one on table
-        mergeIcebergHadoopConfs(conf, options.asMap());
-        FileSystem fs = new Path(table.location()).getFileSystem(conf);
-        fsscheme = fs.getScheme().toLowerCase(Locale.ENGLISH);
-      } catch (IOException ioe) {
-        LOG.warn("Failed to get Hadoop Filesystem", ioe);
-      }
-      String scheme = fsscheme; // Makes an effectively final version of scheme
-      this.localityPreferred =
-          options
-              .get("locality")
-              .map(Boolean::parseBoolean)
-              .orElseGet(() -> LOCALITY_WHITELIST_FS.contains(scheme));
-    } else {
-      this.localityPreferred = false;
-    }
-
+    this.localityPreferred = readConf.localityEnabled();

Review Comment:
   In the newer Spark versions, the readConf method is called 
`localityPreferred()`.
   
   Do we have tests in 2.4 for the reader configuration with the older name?



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