{"record":{"id":"24344df7b5dadb23","repo":"apache/iceberg","slug":"read-failure-possibly-due-to-parquet-246-try-sett","errorCode":null,"errorMessage":"Read failure possibly due to PARQUET-246: try setting parquet.split.files to false","messagePattern":"Read failure possibly due to PARQUET-246: try setting parquet\\.split\\.files to false","errorType":"exception","errorClass":"ParquetDecodingException","httpStatus":null,"severity":"error","filePath":"parquet/src/main/java/org/apache/iceberg/parquet/PageIterator.java","lineNumber":211,"sourceCode":"  private void advance() {\n    if (triplesRead < triplesCount) {\n      this.currentDL = definitionLevels.nextInt();\n      this.currentRL = repetitionLevels.nextInt();\n      this.triplesRead += 1;\n      this.hasNext = true;\n    } else {\n      this.currentDL = -1;\n      this.currentRL = -1;\n      this.hasNext = false;\n    }\n  }\n\n  RuntimeException handleRuntimeException(RuntimeException exception) {\n    if (CorruptDeltaByteArrays.requiresSequentialReads(writerVersion, valueEncoding)\n        && exception instanceof ArrayIndexOutOfBoundsException) {\n      // this is probably PARQUET-246, which may happen if reading data with\n      // MR because this can't be detected without reading all footers\n      throw new ParquetDecodingException(\n          \"Read failure possibly due to \" + \"PARQUET-246: try setting parquet.split.files to false\",\n          new ParquetDecodingException(\n              String.format(\n                  Locale.ROOT,\n                  \"Can't read value in column %s at value %d out of %d in current page. \"\n                      + \"repetition level: %d, definition level: %d\",\n                  desc,\n                  triplesRead,\n                  triplesCount,\n                  currentRL,\n                  currentDL),\n              exception));\n    }\n    throw new ParquetDecodingException(\n        String.format(\n            Locale.ROOT,\n            \"Can't read value in column %s at value %d out of %d in current page. \"\n                + \"repetition level: %d, definition level: %d\",","sourceCodeStart":193,"sourceCodeEnd":229,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/parquet/src/main/java/org/apache/iceberg/parquet/PageIterator.java#L193-L229","documentation":"handleRuntimeException detects that an ArrayIndexOutOfBoundsException during value decoding is likely the Parquet bug PARQUET-246: DeltaByteArray-encoded pages require sequential reads, which fail when file splits were created without reading footers. It rethrows as ParquetDecodingException with a workaround hint.","triggerScenarios":"Calling nextBoolean/nextInteger/nextLong/nextFloat/nextDouble/nextBinary on a page with DeltaByteArray encoding while an ArrayIndexOutOfBoundsException occurs and the writer version requires sequential reads.","commonSituations":"Reading files written by older Parquet/MR writers in a split-parallel reader (e.g. Spark) hitting the PARQUET-246 defect.","solutions":["Set parquet.split.files to false (spark.sql.files.split=false style config) so files are read sequentially","Rewrite the file with a newer Parquet writer version","Upgrade Iceberg/Parquet libraries to pick up PARQUET-246 fixes"],"exampleFix":"// before\nspark.conf.set(\"spark.sql.files.maxPartitionBytes\", \"1MB\") // aggressive splits\n// after\nspark.conf.set(\"parquet.split.files\", \"false\")","handlingStrategy":"retry","validationCode":"Encoding enc = pageHeader.getDataPageHeader().getEncoding();\nif (enc == Encoding.DELTA_BYTE_ARRAY) { /* ensure sequential read / disable splits before reading */ }","typeGuard":null,"tryCatchPattern":"try {\n  iterator.nextBinary();\n} catch (ParquetDecodingException e) {\n  if (e.getMessage().contains(\"PARQUET-246\")) { /* re-read with splitting disabled */ }\n  else throw e;\n}","preventionTips":["Disable file splitting for files written by old MR Parquet writers","Rewrite old files with a current Parquet writer version","Record writer versions in metadata and route old files to sequential readers"],"tags":["parquet","corrupt-data","decoding"],"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"}