rdblue commented on a change in pull request #3186:
URL: https://github.com/apache/iceberg/pull/3186#discussion_r741528577



##########
File path: 
spark/v2.4/spark/src/main/java/org/apache/iceberg/spark/source/BaseDataReader.java
##########
@@ -196,4 +198,40 @@ protected static Object convertConstant(Type type, Object 
value) {
     }
     return value;
   }
+
+  protected void findMoreCompoundConstants(Schema tableSchema, Map<Integer, ?> 
idToConstant) {
+    List<Types.NestedField> columns = tableSchema.columns();
+
+    for (Types.NestedField nestedField : columns) {
+      visitCompoundTypesByDFS(nestedField, (Map<Integer, Object>) 
idToConstant);
+    }
+  }
+
+  protected void visitCompoundTypesByDFS(
+          Types.NestedField nestedField,
+          Map<Integer, Object> idToConstant) {
+    switch (nestedField.type().typeId()) {
+      case STRUCT:

Review comment:
       In Iceberg, we separate schema traversal logic from other logic using 
visitors. I think that you should use a type visitor to implement this rather 
than traversing a type tree and doing some task in the same recursive function.




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