rdblue commented on a change in pull request #3817:
URL: https://github.com/apache/iceberg/pull/3817#discussion_r780426329



##########
File path: 
flink/v1.14/flink/src/main/java/org/apache/iceberg/flink/source/FlinkSource.java
##########
@@ -247,6 +258,24 @@ int inferParallelism(FlinkInputFormat format, ScanContext 
context) {
       parallelism = Math.max(1, parallelism);
       return parallelism;
     }
+
+    boolean localityEnabled() {
+      FileIO fileIO = table.io();
+      if (fileIO instanceof HadoopFileIO) {
+        Boolean localityConfig = 
readableConfig.get(FlinkConfigOptions.TABLE_EXEC_ICEBERG_EXPOSE_SPLIT_LOCALITY_INFO);

Review comment:
       I think this should return early if the value of this config is `false`. 
That way you don't needlessly attempt to create a file system when locality 
won't be used.

##########
File path: 
flink/v1.14/flink/src/main/java/org/apache/iceberg/flink/source/FlinkSource.java
##########
@@ -195,6 +205,7 @@ public FlinkInputFormat buildFormat() {
       } else {
         contextBuilder.project(FlinkSchemaUtil.convert(icebergSchema, 
projectedSchema));
       }
+      contextBuilder.exposeLocality(localityEnabled());

Review comment:
       I think it should be possible to override `exposeLocality` in this 
builder so that you can set it differently for different sources. Keeping a 
boolean in this builder and passing that as an override for the environment 
property in `localityEnabled()` should work.

##########
File path: 
spark/v3.2/spark/src/main/java/org/apache/iceberg/spark/SparkReadConf.java
##########
@@ -46,7 +46,7 @@
  */
 public class SparkReadConf {
 
-  private static final Set<String> LOCALITY_WHITELIST_FS = 
ImmutableSet.of("hdfs");

Review comment:
       Let's not change Spark here.




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