{"record":{"id":"249b6413d039aa69","repo":"apache/druid","slug":"unknown-decimal-type-supplied-to-primitive-conve","errorCode":null,"errorMessage":"Unknown 'DECIMAL' type supplied to primitive conversion: %s (this should never happen)","messagePattern":"Unknown 'DECIMAL' type supplied to primitive conversion: (.+?) \\(this should never happen\\)","errorType":"exception","errorClass":"RE","httpStatus":null,"severity":"error","filePath":"extensions-core/parquet-extensions/src/main/java/org/apache/druid/data/input/parquet/simple/ParquetGroupConverter.java","lineNumber":441,"sourceCode":"                the unscaled value should be used.\n           */\n            int precision = pt.asPrimitiveType().getDecimalMetadata().getPrecision();\n            int scale = pt.asPrimitiveType().getDecimalMetadata().getScale();\n            switch (pt.getPrimitiveTypeName()) {\n              case INT32:\n                // The primitive returned from Group is an unscaledValue.\n                // We need to do unscaledValue * 10^(-scale) to convert back to decimal\n                return new BigDecimal(g.getInteger(fieldIndex, index)).movePointLeft(scale);\n              case INT64:\n                // The primitive returned from Group is an unscaledValue.\n                // We need to do unscaledValue * 10^(-scale) to convert back to decimal\n                return new BigDecimal(g.getLong(fieldIndex, index)).movePointLeft(scale);\n              case FIXED_LEN_BYTE_ARRAY:\n              case BINARY:\n                Binary value = g.getBinary(fieldIndex, index);\n                return convertBinaryToDecimal(value, precision, scale);\n              default:\n                throw new RE(\n                    \"Unknown 'DECIMAL' type supplied to primitive conversion: %s (this should never happen)\",\n                    pt.getPrimitiveTypeName()\n                );\n            }\n          case UTF8:\n          case ENUM:\n          case JSON:\n            return g.getString(fieldIndex, index);\n          case LIST:\n          case MAP:\n          case MAP_KEY_VALUE:\n          case BSON:\n          default:\n            throw new RE(\n                \"Non-primitive supplied to primitive conversion: %s (this should never happen)\",\n                ot.name()\n            );\n        }","sourceCodeStart":423,"sourceCodeEnd":459,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/extensions-core/parquet-extensions/src/main/java/org/apache/druid/data/input/parquet/simple/ParquetGroupConverter.java#L423-L459","documentation":"Internal exhaustiveness error in ParquetGroupConverter.convertPrimitiveField's DECIMAL branch: the parquet primitive type of a decimal column was something other than INT32, INT64, BINARY, or FIXED_LEN_BYTE_ARRAY, which parquet schema rules should make impossible — hence 'this should never happen'. It signals an unexpected/corrupt schema or a parquet-library version mismatch.","triggerScenarios":"Thrown at extensions-core/parquet-extensions/src/main/java/org/apache/druid/data/input/parquet/simple/ParquetGroupConverter.java:441 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the parquet schema of the offending file to confirm the decimal's physical type.","Upgrade/align the parquet-extensions and parquet-mr library versions.","Exclude the malformed file or re-write it with a standard decimal physical type."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}