rdblue commented on code in PR #12238:
URL: https://github.com/apache/iceberg/pull/12238#discussion_r1966252517


##########
core/src/main/java/org/apache/iceberg/avro/PruneColumns.java:
##########
@@ -92,7 +93,8 @@ public Schema record(Schema record, List<String> names, 
List<Schema> fields) {
           hasChange = true; // Sub-fields may be different
           filteredFields.add(copyField(field, fieldSchema, fieldId));
         } else {
-          if (isRecord(field.schema())) {
+          if (isRecord(field.schema())
+              && field.schema().getLogicalType() != VariantLogicalType.get()) {

Review Comment:
   I think it would be good to have util method similar to `isRecord` (or maybe 
update `isRecord`?)
   
   This check is somewhat brittle. Why not check `instance VariantLogicalType`?



##########
core/src/main/java/org/apache/iceberg/avro/PruneColumns.java:
##########
@@ -92,7 +93,8 @@ public Schema record(Schema record, List<String> names, 
List<Schema> fields) {
           hasChange = true; // Sub-fields may be different
           filteredFields.add(copyField(field, fieldSchema, fieldId));
         } else {
-          if (isRecord(field.schema())) {
+          if (isRecord(field.schema())
+              && field.schema().getLogicalType() != VariantLogicalType.get()) {

Review Comment:
   I think it would be good to have util method similar to `isRecord` (or maybe 
update `isRecord`?)
   
   This check is somewhat brittle. Why not check `instanceof 
VariantLogicalType`?



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