majian1998 commented on code in PR #13625:
URL: https://github.com/apache/iceberg/pull/13625#discussion_r2329073963


##########
spark/v4.0/spark/src/main/java/org/apache/iceberg/spark/ExtendedParser.java:
##########
@@ -66,5 +66,43 @@ static List<RawOrderField> parseSortOrder(SparkSession 
spark, String orderString
     }
   }
 
+  static <T> T findParser(ParserInterface parser, Class<T> clazz) {
+    ParserInterface current = parser;
+    while (current != null) {
+      if (clazz.isInstance(current)) {
+        return clazz.cast(current);
+      }
+      Object next = getDelegate(current);
+      if (next == null || next == current) {
+        break;
+      }
+      current = (ParserInterface) next;
+    }
+    return null;
+  }
+
+  static Object getDelegate(Object parser) {
+    try {
+      for (String methodName : new String[] {"delegate", "getDelegate"}) {

Review Comment:
   Thanks for the suggestion! I've updated the code to iterate over all fields



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