singhpk234 commented on code in PR #14497:
URL: https://github.com/apache/iceberg/pull/14497#discussion_r2488744748


##########
spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/ExtendedParser.java:
##########
@@ -74,18 +76,15 @@ private static <T> T findParser(ParserInterface parser, 
Class<T> clazz) {
         return clazz.cast(current);
       }
 
-      ParserInterface next = getNextDelegateParser(current);
-      if (next == null) {
-        break;
-      }
-
-      current = next;
+      current = getNextDelegateParser(current);
     }
 
     return null;
   }
 
   private static ParserInterface getNextDelegateParser(ParserInterface parser) 
{
+    Logger logger = LoggerFactory.getLogger(ExtendedParser.class);

Review Comment:
   can we not declare this as `private static final` member of the interface



##########
spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/ExtendedParser.java:
##########
@@ -100,6 +99,8 @@ private static ParserInterface 
getNextDelegateParser(ParserInterface parser) {
       }
     } catch (Exception e) {
       // ignore
+      logger.warn(
+          "Failed to scan delegate parser in {}: {}", 
parser.getClass().getName(), e.toString());

Review Comment:
   ```suggestion
         logger.warn("Failed to scan delegate parser in {}", 
parser.getClass().getName(), e);
   ```



##########
spark/v3.5/spark-extensions/src/test/java/org/apache/iceberg/spark/TestExtendedParser.java:
##########
@@ -67,6 +70,10 @@ public void saveOriginalParser() throws Exception {
       try {
         parserField = clazz.getDeclaredField(SQL_PARSER_FIELD);
       } catch (NoSuchFieldException e) {
+        LOG.warn(
+            "Field '{}' not found in class {}. Trying superclass.",
+            SQL_PARSER_FIELD,
+            clazz.getName());

Review Comment:
   LOG lines for test ?



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