{"record":{"id":"b32fb1ad27fa1304","repo":"apache/iceberg","slug":"could-not-read-page-in-col-s-as-the-dictionary-wa","errorCode":null,"errorMessage":"could not read page in col %s as the dictionary was missing for encoding %s","messagePattern":"could not read page in col (.+?) as the dictionary was missing for encoding (.+?)","errorType":"exception","errorClass":"ParquetDecodingException","httpStatus":null,"severity":"error","filePath":"parquet/src/main/java/org/apache/iceberg/parquet/PageIterator.java","lineNumber":249,"sourceCode":"            triplesRead,\n            triplesCount,\n            currentRL,\n            currentDL),\n        exception);\n  }\n\n  @Override\n  protected void initDataReader(Encoding dataEncoding, ByteBufferInputStream in, int valueCount) {\n    ValuesReader previousReader = values;\n\n    this.valueEncoding = dataEncoding;\n\n    // TODO: May want to change this so that this class is not dictionary-aware.\n    // For dictionary columns, this class could rely on wrappers to correctly handle dictionaries\n    // This isn't currently possible because RLE must be read by getDictionaryBasedValuesReader\n    if (dataEncoding.usesDictionary()) {\n      if (dictionary == null) {\n        throw new ParquetDecodingException(\n            \"could not read page in col \"\n                + desc\n                + \" as the dictionary was missing for encoding \"\n                + dataEncoding);\n      }\n      this.values =\n          dataEncoding.getDictionaryBasedValuesReader(desc, ValuesType.VALUES, dictionary);\n    } else {\n      this.values = dataEncoding.getValuesReader(desc, ValuesType.VALUES);\n    }\n\n    //    if (dataEncoding.usesDictionary() && converter.hasDictionarySupport()) {\n    //      bindToDictionary(dictionary);\n    //    } else {\n    //      bind(path.getType());\n    //    }\n\n    try {","sourceCodeStart":231,"sourceCodeEnd":267,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/parquet/src/main/java/org/apache/iceberg/parquet/PageIterator.java#L231-L267","documentation":"Thrown in initDataReader when a page's data encoding uses a dictionary but no dictionary was supplied (dictionary == null). Dictionary-based encodings cannot decode values without the dictionary page, so the library fails fast.","triggerScenarios":"Reading a data page whose Encoding.usesDictionary() is true (PLAIN_DICTIONARY, RLE_DICTIONARY) while the preceding dictionary page is absent or not yet initialized.","commonSituations":"Corrupt/truncated files missing the dictionary page; readers skipping pages out of order; files produced by writers emitting dictionary encodings incorrectly.","solutions":["Validate/repair the Parquet file (dictionary page missing)","Rewrite the file with dictionary encoding disabled (parquet.enable.dictionary=false)","Upgrade writer/reader libraries to ensure dictionary pages are emitted/consumed correctly"],"exampleFix":"// before\n// writer: parquet.enable.dictionary=true with corrupt dict page\n// after\nwriter.parquet.enable.dictionary=false // or repair the source file","handlingStrategy":"validation","validationCode":"// ensure dictionary page exists before data pages that use dictionary encoding\nif (pageHeader.getType() != PageType.DICTIONARY_PAGE && pageHeader.getDataPageHeader().getEncoding().usesDictionary() && dictionary == null) throw new IllegalStateException(\"Missing dictionary page\");","typeGuard":null,"tryCatchPattern":"try {\n  iterator.next();\n} catch (ParquetDecodingException e) {\n  if (e.getMessage().contains(\"dictionary was missing\")) { /* repair/rewrite file */ }\n  else throw e;\n}","preventionTips":["Disable dictionary encoding if writer/reader combinations are unreliable","Verify complete file copies (dictionary page is at column-chunk start)","Test files from new writers with a full read before production"],"tags":["parquet","dictionary-encoding","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"}