aokolnychyi commented on a change in pull request #2984:
URL: https://github.com/apache/iceberg/pull/2984#discussion_r716840651



##########
File path: core/src/main/java/org/apache/iceberg/util/PartitionUtil.java
##########
@@ -51,6 +53,20 @@ private PartitionUtil() {
         MetadataColumns.FILE_PATH.fieldId(),
         convertConstant.apply(Types.StringType.get(), task.file().path()));
 
+    // add _spec
+    idToConstant.put(
+        MetadataColumns.SPEC.fieldId(),
+        convertConstant.apply(Types.IntegerType.get(), task.file().specId()));
+
+    // add _partition
+    if (partitionType.fields().isEmpty()) {
+      // use null as some query engines may not be able to handle empty structs
+      idToConstant.put(MetadataColumns.PARTITION_COLUMN_ID, null);
+    } else {
+      StructLike partition = Partitioning.reconcilePartition(partitionType, 
spec, partitionData);
+      idToConstant.put(MetadataColumns.PARTITION_COLUMN_ID, 
convertConstant.apply(partitionType, partition));

Review comment:
       I switched to using projections.




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