{"record":{"id":"38ecc1a4fc869391","repo":"apache/iceberg","slug":"failed-to-read-from-input-stream","errorCode":null,"errorMessage":"Failed to read from input stream","messagePattern":"Failed to read from input stream","errorType":"exception","errorClass":"ParquetDecodingException","httpStatus":null,"severity":"error","filePath":"arrow/src/main/java/org/apache/iceberg/arrow/vectorized/parquet/BaseVectorizedParquetValuesReader.java","lineNumber":209,"sourceCode":"          this.currentCount = numGroups * 8;\n          if (this.packedValuesBuffer.length < this.currentCount) {\n            this.packedValuesBuffer = new int[this.currentCount];\n          }\n          packedValuesBufferIdx = 0;\n          int valueIndex = 0;\n          while (valueIndex < this.currentCount) {\n            // values are bit packed 8 at a time, so reading bitWidth will always work\n            ByteBuffer buffer = inputStream.slice(bitWidth);\n            this.packer.unpack8Values(\n                buffer, buffer.position(), this.packedValuesBuffer, valueIndex);\n            valueIndex += 8;\n          }\n          return;\n        default:\n          throw new ParquetDecodingException(\"not a valid mode \" + this.mode);\n      }\n    } catch (IOException e) {\n      throw new ParquetDecodingException(\"Failed to read from input stream\", e);\n    }\n  }\n\n  @Override\n  public boolean readBoolean() {\n    return this.readInteger() != 0;\n  }\n\n  @Override\n  public void skip() {\n    throw new UnsupportedOperationException();\n  }\n\n  @Override\n  public int readValueDictionaryId() {\n    return readInteger();\n  }\n","sourceCodeStart":191,"sourceCodeEnd":227,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/arrow/src/main/java/org/apache/iceberg/arrow/vectorized/parquet/BaseVectorizedParquetValuesReader.java#L191-L227","documentation":"While decoding an RLE/bit-packed page, the underlying input stream threw an IOException; the reader wraps it in ParquetDecodingException with this message and the cause attached. It indicates the page bytes could not be read from the input.","triggerScenarios":"readNextGroup reading past the end of a truncated page, network/filesystem I/O failure mid-scan, or corrupt Parquet footer offsets.","commonSituations":"Truncated files from failed writes, HDFS/S3 transient errors during long scans, mismatched file checksums.","solutions":["Retry the scan if the cause is a transient I/O error (S3/HDFS).","Re-validate and regenerate the source Parquet file if it is truncated or corrupt.","Check cause chain (ParquetDecodingException.getCause) to distinguish I/O errors from corruption."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"// catch (ParquetDecodingException e) {\n//   if (e.getCause() instanceof IOException) { retryWithBackoff(); } // transient I/O\n//   else throw e; // corruption\n// }","preventionTips":["Distinguish transient I/O (retry) from corruption (regenerate) via getCause().","Use checksums to detect truncated files before scanning.","Ensure stable object-store connectivity for long scans."],"tags":["parquet","io","vectorized-reader","network"],"backgroundTag":"file-read-failed","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}