{"record":{"id":"ccfe58188a7ac9f2","repo":"apache/iceberg","slug":"unsupported-base-type-for-decimal-primitive-g","errorCode":null,"errorMessage":"Unsupported base type for decimal: \" + primitive.getPrimitiveTypeName()","messagePattern":"Unsupported base type for decimal: \" \\+ primitive\\.getPrimitiveTypeName\\(\\)","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"arrow/src/main/java/org/apache/iceberg/arrow/vectorized/GenericArrowVectorAccessorFactory.java","lineNumber":157,"sourceCode":"          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\n          // compatibility we try to read INT96 as timestamps. But INT96 is not recommended\n          // and deprecated (see https://issues.apache.org/jira/browse/PARQUET-323)\n          return new DictionaryTimestampInt96Accessor<>((IntVector) vector, dictionary);\n        case DOUBLE:","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/arrow/src/main/java/org/apache/iceberg/arrow/vectorized/GenericArrowVectorAccessorFactory.java#L139-L175","documentation":"This is the same 'Unsupported base type for decimal' error thrown from the non-dictionary branch of getVectorAccessor (line 157 vs 256 for the dictionary branch). A plain (non-dictionary-encoded) decimal column's Parquet base type is not one of the supported physical types, so accessor construction fails.","triggerScenarios":"getVectorAccessor resolving a plain decimal column whose PrimitiveTypeName is outside FIXED_LEN_BYTE_ARRAY/BINARY, INT64, INT32; passing a malformed or foreign Parquet schema to the Arrow accessor factory.","commonSituations":"External Parquet files (non-Iceberg writers) registered directly; corrupted or hand-edited Parquet metadata claiming decimal logical type over an unsupported physical type.","solutions":["Validate the Parquet schema's physical type for decimal columns before vectorized reads","Rewrite the files with standard writers (decimal over FIXED_LEN_BYTE_ARRAY/INT64/INT32)","Use the generic Parquet row reader for these files instead of the Arrow path"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"if (decimalPhysicalTypes.stream().noneMatch(t -> t == primitive.getPrimitiveTypeName())) { skipVectorized(column); }","typeGuard":null,"tryCatchPattern":"try { accessor = factory.getVectorAccessor(holder); } catch (UnsupportedOperationException e) { if (e.getMessage().startsWith(\"Unsupported base type for decimal\")) { accessor = null; } else throw e; }","preventionTips":["Run parquet-tools/schema inspection on external files before vectorized reads","Normalize decimal storage (FIXED_LEN_BYTE_ARRAY/INT64/INT32) at write time","Gate vectorized reads per file/column based on schema checks"],"tags":["parquet","decimal","schema"],"backgroundTag":"incompatible-source-type","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"}