ebyhr commented on code in PR #13108:
URL: https://github.com/apache/iceberg/pull/13108#discussion_r2098952765


##########
parquet/src/main/java/org/apache/iceberg/parquet/ParquetReader.java:
##########
@@ -120,18 +125,27 @@ public boolean hasNext() {
 
     @Override
     public T next() {
-      if (valuesRead >= nextRowGroupStart) {
-        advance();
-      }
-
-      if (reuseContainers) {
-        this.last = model.read(last);
-      } else {
-        this.last = model.read(null);
+      try {
+        if (valuesRead >= nextRowGroupStart) {
+          advance();
+        }
+
+        if (reuseContainers) {
+          this.last = model.read(last);
+        } else {
+          this.last = model.read(null);
+        }
+        valuesRead += 1;
+
+        return last;
+      } catch (ParquetDecodingException e) {
+        if (reader != null) {

Review Comment:
   Is `reader` really nullable? This condition looks redundant. 



##########
parquet/src/main/java/org/apache/iceberg/parquet/ParquetReader.java:
##########
@@ -120,18 +125,27 @@ public boolean hasNext() {
 
     @Override
     public T next() {
-      if (valuesRead >= nextRowGroupStart) {
-        advance();
-      }
-
-      if (reuseContainers) {
-        this.last = model.read(last);
-      } else {
-        this.last = model.read(null);
+      try {
+        if (valuesRead >= nextRowGroupStart) {
+          advance();
+        }
+
+        if (reuseContainers) {
+          this.last = model.read(last);
+        } else {
+          this.last = model.read(null);
+        }
+        valuesRead += 1;
+
+        return last;
+      } catch (ParquetDecodingException e) {
+        if (reader != null) {
+          // Knowing the exact parquet file is essential for tracing bad nodes
+          // that produced the corrupt file, parquet lib doesn't do this today.
+          LOG.error("Error decoding Parquet file {}", reader.getFile(), e);

Review Comment:
   ParquetInputFile doesn't implement `toString` method, right? Does this log 
print human-readable path? 
   
   ```java
     public String getFile() {
       return file.toString();
     }
   ```
   



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