KnightChess commented on a change in pull request #3459:
URL: https://github.com/apache/iceberg/pull/3459#discussion_r746218179



##########
File path: 
spark/v3.2/spark/src/main/java/org/apache/iceberg/spark/source/SparkTable.java
##########
@@ -298,6 +311,103 @@ public void deleteWhere(Filter[] filters) {
     }
   }
 
+  @Override
+  public StructType partitionSchema() {
+    if (lazyPartitionSchema == null) {
+      Table table = table();
+      PartitionsTable partitionsTable =
+          (PartitionsTable) 
MetadataTableUtils.createMetadataTableInstance(table, 
MetadataTableType.PARTITIONS);
+      Types.NestedField partition = 
partitionsTable.schema().findField("partition");
+      if (partition != null) {
+        this.lazyPartitionSchema = (StructType) 
SparkSchemaUtil.convert(partition.type());

Review comment:
       Oh, I got it, when a partition field remove, it only mark spec transform 
void, so it may be return incorrectly. I am not sure if I understand is correct




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