{"record":{"id":"b4f4c7c3c968d40b","repo":"apache/iceberg","slug":"cannot-decode-dictionary-of-type-type","errorCode":null,"errorMessage":"Cannot decode dictionary of type: <type>","messagePattern":"Cannot decode dictionary of type: <type>","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"parquet/src/main/java/org/apache/iceberg/parquet/ParquetDictionaryRowGroupFilter.java","lineNumber":467,"sourceCode":"            dictSet.add((T) conversion.apply(dict.decodeToBinary(i)));\n            break;\n          case INT32:\n            dictSet.add((T) conversion.apply(dict.decodeToInt(i)));\n            break;\n          case INT64:\n            dictSet.add((T) conversion.apply(dict.decodeToLong(i)));\n            break;\n          case FLOAT:\n            dictSet.add((T) conversion.apply(dict.decodeToFloat(i)));\n            break;\n          case DOUBLE:\n            dictSet.add((T) conversion.apply(dict.decodeToDouble(i)));\n            break;\n          case INT96:\n            dictSet.add((T) conversion.apply(dict.decodeToBinary(i)));\n            break;\n          default:\n            throw new IllegalArgumentException(\n                \"Cannot decode dictionary of type: \"\n                    + col.getPrimitiveType().getPrimitiveTypeName());\n        }\n      }\n\n      dictCache.put(id, dictSet);\n\n      return dictSet;\n    }\n\n    @Override\n    public <T> Boolean handleNonReference(Bound<T> term) {\n      return ROWS_MIGHT_MATCH;\n    }\n  }\n\n  private static boolean mayContainNull(ColumnChunkMetaData meta) {\n    return meta.getStatistics() == null || meta.getStatistics().getNumNulls() != 0;","sourceCodeStart":449,"sourceCodeEnd":485,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/parquet/src/main/java/org/apache/iceberg/parquet/ParquetDictionaryRowGroupFilter.java#L449-L485","documentation":"Thrown while decoding dictionary entries when the column's Parquet primitive type has no decode branch (anything other than the INT32/INT64/FLOAT/DOUBLE/BINARY/FIXED_LEN_BYTE_ARRAY/INT96 paths implemented). The dictionary reader returns values via typed decode methods and this default branch catches unsupported primitives.","triggerScenarios":"A Parquet column with an exotic/unsupported primitive type reaching the dictionary filter's decode loop, e.g. from malformed schema metadata or a type added to Parquet that the filter doesn't handle.","commonSituations":"Files with nonstandard schema; future/bleeding-edge Parquet types read by older Iceberg; hand-built Parquet schemas in tests.","solutions":["Rewrite the data so columns use standard supported primitive types.","Upgrade Iceberg to a version supporting the type.","Exclude such columns from dictionary filtering (fall back to record-level filtering)."],"exampleFix":"// before\nDictionary built for a column with an unsupported primitive (e.g. FLOAT16)\n// after\nrewrite the column as FIXED_LEN_BYTE_ARRAY(2) or BINARY and adjust the Iceberg schema accordingly","handlingStrategy":"fallback","validationCode":"PrimitiveType.PrimitiveTypeName name = col.getPrimitiveType().getPrimitiveTypeName();\nboolean decodable = name == PrimitiveType.PrimitiveTypeName.INT32\n    || name == PrimitiveType.PrimitiveTypeName.INT64\n    || name == PrimitiveType.PrimitiveTypeName.FLOAT\n    || name == PrimitiveType.PrimitiveTypeName.DOUBLE\n    || name == PrimitiveType.PrimitiveTypeName.BINARY\n    || name == PrimitiveType.PrimitiveTypeName.FIXED_LEN_BYTE_ARRAY\n    || name == PrimitiveType.PrimitiveTypeName.INT96;\nif (!decodable) {\n  // skip dictionary filtering for this column\n}","typeGuard":null,"tryCatchPattern":"try {\n  boolean mayMatch = dictFilter.shouldRead(...);\n} catch (IllegalArgumentException e) {\n  LOG.warn(\"Undecodable dictionary type, falling back\", e);\n  mayMatch = true;\n}","preventionTips":["Use only standard Parquet primitive types in schemas.","Upgrade Iceberg when reading files with newer types.","Restrict dictionary pushdown to well-known column types."],"tags":["parquet","dictionary","unsupported-type","decode"],"backgroundTag":"unsupported-operation","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}