rdblue commented on a change in pull request #2984:
URL: https://github.com/apache/iceberg/pull/2984#discussion_r716257949
##########
File path: core/src/main/java/org/apache/iceberg/util/PartitionUtil.java
##########
@@ -51,6 +56,20 @@ private PartitionUtil() {
MetadataColumns.FILE_PATH.fieldId(),
convertConstant.apply(Types.StringType.get(), task.file().path()));
+ // add _spec_id
+ idToConstant.put(
+ MetadataColumns.SPEC_ID.fieldId(),
+ convertConstant.apply(Types.IntegerType.get(), task.file().specId()));
+
+ // add _partition
+ if (partitionType != null && partitionType.fields().size() > 0) {
+ StructLike coercedPartition = coercePartition(partitionType, spec,
partitionData);
+ idToConstant.put(MetadataColumns.PARTITION_COLUMN_ID,
convertConstant.apply(partitionType, coercedPartition));
Review comment:
Okay, I see what's happening. This PR updates the conversion for Spark
and because most callers only use `constantsMap(task, func)` there's no way to
get a partition passed through. I'm a little uneasy about this, but since we
need to convert to a specific class for the reader I don't see a good way
around it.
--
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]