{"record":{"id":"8dd803f79b1d10e3","repo":"apache/iceberg","slug":"unsupported-base-type-for-decimal","errorCode":null,"errorMessage":"Unsupported base type for decimal: ","messagePattern":"Unsupported base type for decimal: ","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"arrow/src/main/java/org/apache/iceberg/arrow/vectorized/GenericArrowVectorAccessorFactory.java","lineNumber":153,"sourceCode":"        case INT_64:\n        case TIME_MICROS:\n        case TIMESTAMP_MILLIS:\n        case TIMESTAMP_MICROS:\n          return new DictionaryLongAccessor<>((IntVector) vector, dictionary);\n        case DECIMAL:\n          switch (primitive.getPrimitiveTypeName()) {\n            case BINARY:\n            case FIXED_LEN_BYTE_ARRAY:\n              return new DictionaryDecimalBinaryAccessor<>(\n                  (IntVector) vector, dictionary, decimalFactorySupplier.get());\n            case INT64:\n              return new DictionaryDecimalLongAccessor<>(\n                  (IntVector) vector, dictionary, decimalFactorySupplier.get());\n            case INT32:\n              return new DictionaryDecimalIntAccessor<>(\n                  (IntVector) vector, dictionary, decimalFactorySupplier.get());\n            default:\n              throw new UnsupportedOperationException(\n                  \"Unsupported base type for decimal: \" + primitive.getPrimitiveTypeName());\n          }\n        default:\n          throw new UnsupportedOperationException(\n              \"Unsupported logical type: \" + primitive.getOriginalType());\n      }\n    } else {\n      switch (primitive.getPrimitiveTypeName()) {\n        case FIXED_LEN_BYTE_ARRAY:\n        case BINARY:\n          return new DictionaryBinaryAccessor<>(\n              (IntVector) vector, dictionary, stringFactorySupplier.get());\n        case FLOAT:\n          return new DictionaryFloatAccessor<>((IntVector) vector, dictionary);\n        case INT64:\n          return new DictionaryLongAccessor<>((IntVector) vector, dictionary);\n        case INT96:\n          // Impala & Spark used to write timestamps as INT96 by default. For backwards","sourceCodeStart":135,"sourceCodeEnd":171,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/arrow/src/main/java/org/apache/iceberg/arrow/vectorized/GenericArrowVectorAccessorFactory.java#L135-L171","documentation":"When a column is dictionary-encoded, the factory builds a Dictionary*Accessor whose backing type must match the decimal's Parquet base type (FIXED_LEN_BYTE_ARRAY, INT64, or INT32). A decimal stored with any other base physical type has no dictionary accessor implementation, so the default branch throws this error.","triggerScenarios":"Reading a dictionary-encoded Parquet decimal column whose primitive base type is not FIXED_LEN_BYTE_ARRAY/INT64/INT32 (e.g. an unexpected physical encoding produced by a non-standard writer), via getVectorAccessor on a VectorHolder with a dictionary.","commonSituations":"Files written by third-party/older Parquet writers using unusual physical types for decimal logical type; mixed-writer datasets where encoding metadata doesn't match Iceberg's expectations.","solutions":["Rewrite/compact the data with standard Iceberg writers so decimals use the canonical physical types","Fall back to the non-vectorized (row) reader for such files","Inspect the Parquet schema (parquet-tools) to confirm the decimal's physical type and fix at write time"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"LogicalTypeAnnotation ann = primitive.getLogicalTypeAnnotation(); if (ann instanceof DecimalLogicalTypeAnnotation && !EnumSet.of(FIXED_LEN_BYTE_ARRAY, INT64, INT32).contains(primitive.getPrimitiveTypeName())) { useRowReader(); }","typeGuard":null,"tryCatchPattern":"try { accessor = factory.getVectorAccessor(holder); } catch (UnsupportedOperationException e) { accessor = rowBasedAccessor(holder); }","preventionTips":["Validate Parquet schemas on ingestion so decimals use canonical physical types","Prefer Iceberg writers for all files consumed by vectorized reads","Keep a non-vectorized fallback path in the read pipeline"],"tags":["parquet","decimal","dictionary-encoding"],"backgroundTag":"unsupported-enum-value","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"}