deniskuzZ commented on code in PR #4910:
URL: https://github.com/apache/hive/pull/4910#discussion_r1412238093


##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergInputFormat.java:
##########
@@ -176,6 +179,20 @@ public RecordReader<Void, Container<Record>> 
getRecordReader(InputSplit split, J
     }
   }
 
+  private static void validateFilesWithinTableDirectory(InputSplit split, 
JobConf job) throws IOException {
+    boolean dataFilesWithingTableLocationOnly =
+        
job.getBoolean(HiveConf.ConfVars.HIVE_ICEBERG_ALLOW_DATA_IN_TABLE_LOCATION_ONLY.varname,
+            
HiveConf.ConfVars.HIVE_ICEBERG_ALLOW_DATA_IN_TABLE_LOCATION_ONLY.defaultBoolVal);
+    if (dataFilesWithingTableLocationOnly) {
+      Path tableLocation = new Path(job.get(InputFormatConfig.TABLE_LOCATION));
+      for (String location : split.getLocations()) {

Review Comment:
   check the method code:
   ````
     public String[] getLocations() {
       // The implementation of getLocations() is only meant to be used during 
split computation
       // getLocations() won't be accurate when called on worker nodes and will 
always return "*"
       if (locations == null && conf != null) {
         boolean localityPreferred = 
conf.getBoolean(InputFormatConfig.LOCALITY, false);
         locations = localityPreferred ? Util.blockLocations(task, conf) : 
ANYWHERE;
       } else {
         locations = ANYWHERE;
       }
   
       return locations;
     }
   ````
   when invoked 2nd time it returns "*" always :) nice design



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