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


##########
parquet/src/main/java/org/apache/iceberg/parquet/TypeWithSchemaVisitor.java:
##########
@@ -201,6 +211,17 @@ private static <T> List<T> visitFields(
     return results;
   }
 
+  private static <T> T visitVariant(
+      Types.VariantType variant, GroupType group, TypeWithSchemaVisitor<T> 
visitor) {
+    ParquetVariantVisitor<T> variantVisitor = visitor.variantVisitor();
+    if (variantVisitor != null) {
+      T variantResult = ParquetVariantVisitor.visit(group, variantVisitor);

Review Comment:
   The project uses visitors to separate the logic of traversing a type from 
the logic of what to do with parts of the structure. While you could put the 
logic in `visit` into an instance method of the visitor (or other places) I 
think it is important to have that traversal logic in only one place across 
visitors with the same pattern (i.e. `TypeWithSchemaVisitor`). If we allow 
customization of the `visit` method, I think we would soon defeat the purpose 
of the visitors.



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to