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



##########
File path: core/src/main/java/org/apache/iceberg/util/PartitionUtil.java
##########
@@ -39,13 +40,17 @@ private PartitionUtil() {
   }
 
   public static Map<Integer, ?> constantsMap(FileScanTask task, 
BiFunction<Type, Object, Object> convertConstant) {
-    return constantsMap(task.spec(), task.file().partition(), convertConstant);
-  }
+    PartitionSpec spec = task.spec();
+    StructLike partitionData = task.file().partition();
 
-  private static Map<Integer, ?> constantsMap(PartitionSpec spec, StructLike 
partitionData,
-                                              BiFunction<Type, Object, Object> 
convertConstant) {
     // use java.util.HashMap because partition data may contain null values
     Map<Integer, Object> idToConstant = new HashMap<>();
+
+    // add _file
+    idToConstant.put(
+        MetadataColumns.FILE_PATH.fieldId(),
+        convertConstant.apply(Types.StringType.get(), task.file().path()));

Review comment:
       This adds `_file` to the constants map so it is set in records like a 
partition value.




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

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