{"record":{"id":"6cfe4cb0edc01b54","repo":"apache/druid","slug":"unsupported-pairclass-type-s","errorCode":null,"errorMessage":"Unsupported pairClass type: %s","messagePattern":"Unsupported pairClass type: (.+?)","errorType":"exception","errorClass":"ResourceLimitException","httpStatus":null,"severity":"error","filePath":"processing/src/main/java/org/apache/druid/query/aggregation/AbstractSerializablePairLongObjectColumnHeader.java","lineNumber":84,"sourceCode":"    long minTimestamp = byteBuffer.getLong();\n\n    if (pairClass.isAssignableFrom(SerializablePairLongLong.class)) {\n      return new SerializablePairLongLongColumnHeader(bytes, minTimestamp);\n    }\n\n    if (pairClass.isAssignableFrom(SerializablePairLongDouble.class)) {\n      return new SerializablePairLongDoubleColumnHeader(bytes, minTimestamp);\n    }\n\n    if (pairClass.isAssignableFrom(SerializablePairLongFloat.class)) {\n      return new SerializablePairLongFloatColumnHeader(bytes, minTimestamp);\n    }\n\n    if (pairClass.isAssignableFrom(SerializablePairLongString.class)) {\n      return new SerializablePairLongStringColumnHeader(bytes, minTimestamp);\n    }\n\n    throw new RE(String.format(Locale.ENGLISH, \"Unsupported pairClass type: %s\", pairClass.getSimpleName()));\n  }\n\n  public abstract AbstractSerializablePairLongObjectDeltaEncodedStagedSerde<?> createSerde();\n\n  public void transferTo(WritableByteChannel channel) throws IOException\n  {\n    LongSerializer longSerializer = new LongSerializer();\n\n    channel.write(ByteBuffer.wrap(bytes));\n    channel.write(longSerializer.serialize(minValue));\n  }\n\n  public int getVersion()\n  {\n    return 0XFF & bytes[VERSION_INDEX];\n  }\n\n  public boolean isUseIntegerDeltas()","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/query/aggregation/AbstractSerializablePairLongObjectColumnHeader.java#L66-L102","documentation":"The column-header deserializer (fromBuffer) can only reconstruct headers for pair types it knows, currently SerializablePairLongString. If the stored generic-pair serde was built with any other pair value type, the runtime pairClass cannot be mapped to a concrete header class and Druid throws RE. This usually means reading staged/intermediate store data written with an unsupported type.","triggerScenarios":"Reading a staged intermediate store whose header was written by an AbstractSerializablePairLongObjectStagedSerde parameterized with a pair class other than SerializablePairLongString, then calling fromBuffer to decode the header.","commonSituations":"Adding a new SerializablePairLongObject<T> serde in one Druid version and reading its output with a version lacking that header class; custom aggregators using non-String object types; cluster nodes with mismatched extension jars.","solutions":["Extend fromBuffer (or upgrade Druid) to support the specific pairClass used when writing the data","Regenerate/rewrite the intermediate data using a supported pair type (SerializablePairLongString)","Verify all cluster nodes/extensions run the same version so writers and readers agree on supported types","Add the new pair class mapping to fromBuffer before deploying a custom serde"],"exampleFix":"// before\nthrow new RE(String.format(Locale.ENGLISH, \"Unsupported pairClass type: %s\", pairClass.getSimpleName()));\n// after\nif (pairClass.isAssignableFrom(SerializablePairLongDouble.class)) {\n  return new SerializablePairLongDoubleColumnHeader(bytes, minTimestamp);\n}\nthrow new RE(String.format(Locale.ENGLISH, \"Unsupported pairClass type: %s\", pairClass.getSimpleName()));","handlingStrategy":"try-catch","validationCode":"if (!SerializablePairLongString.class.isAssignableFrom(pairClass)) {\n  throw new UnsupportedOperationException(\"pairClass \" + pairClass + \" header not supported by this reader\");\n}","typeGuard":"boolean isSupportedPairClass(Class<?> pairClass) {\n  return SerializablePairLongString.class.isAssignableFrom(pairClass);\n}","tryCatchPattern":"try {\n  AbstractSerializablePairLongObjectColumnHeader h =\n      AbstractSerializablePairLongObjectColumnHeader.fromBuffer(bytes, minTimestamp, pairClass);\n} catch (RuntimeException e) {\n  // fall back to unsupported-type handling / rewrite the intermediate store\n}","preventionTips":["Keep writer and reader Druid versions/extensions aligned in the cluster","Use supported pair types (SerializablePairLongString) in staged serdes","Add header mappings for new pair classes before writing data with them"],"tags":["druid","serialization","unsupported-type"],"backgroundTag":"unsupported-enum-value","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"}