Fokko commented on code in PR #13941:
URL: https://github.com/apache/iceberg/pull/13941#discussion_r2316886861


##########
spark/v4.0/spark/src/main/java/org/apache/iceberg/spark/data/ParquetWithSparkSchemaVisitor.java:
##########
@@ -154,11 +155,10 @@ public static <T> T visit(DataType sType, Type type, 
ParquetWithSparkSchemaVisit
         } finally {
           visitor.fieldNames.pop();
         }
-      } else if (sType instanceof VariantType) {
-        // TODO: Use LogicalTypeAnnotation.variantType().equals(annotation) 
when VARIANT type is
-        // added to Parquet
-        // Preconditions.checkArgument(
-        //  sType instanceof VariantType, "Invalid variant: %s is not a 
VariantType", sType);
+      } else if (sType instanceof VariantType

Review Comment:
   Ideally we don't need both, but if there is any data that has been written 
without the annotation, then we can fallback to the Iceberg schema. The 
important part is that we set the annotations in 
[TypeToMessageType.java](https://github.com/apache/iceberg/pull/13941/files#diff-5cf0b9da8dc5244bf7ae8ff96e50a4447ea1326e2ba249bcd1b51f2e529a3f0e).



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