{"record":{"id":"9b781fb186f5fdb5","repo":"apache/druid","slug":"not-supported-9b781f","errorCode":null,"errorMessage":"Not supported","messagePattern":"Not supported","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"processing/src/main/java/org/apache/druid/segment/column/TypeStrategy.java","lineNumber":176,"sourceCode":"      return write(buffer, value, maxSizeBytes);\n    }\n    finally {\n      buffer.position(oldPosition);\n    }\n  }\n\n  /**\n   * Translate raw byte array into a value. This is primarily useful for transforming self contained values that are\n   * serialized into byte arrays, such as happens with 'COMPLEX' types which serialize to base64 strings in JSON\n   * responses.\n   *\n   * 'COMPLEX' types should implement this method to participate in the expression systems built-in function\n   * to deserialize base64 encoded values,\n   * {@link org.apache.druid.math.expr.BuiltInExprMacros.ComplexDecodeBase64ExprMacro}.\n   */\n  default T fromBytes(byte[] value)\n  {\n    throw new IllegalStateException(\"Not supported\");\n  }\n\n  /**\n   * Whether the type is groupable or not. This is always true for all the primitive types, arrays, and nested arrays\n   * therefore the SQL and the native layer might ignore this flag for those types. For complex types, this flag can be\n   * true or false, depending on whether the semantics and implementation of the type naturally leads to groupability\n   * or not. For example, it makes sense for JSON columns to be groupable, however there is little sense in grouping\n   * sketches (before finalizing).\n   * <p>\n   * If a type is groupable, following statements MUST hold:\n   * <p>\n   * a. {@link #equals(Object, Object)} must be implemented. It should return true if and only if two objects are equal\n   *    and can be grouped together.\n   * <p>\n   * b. {@link #hashCode(Object)} must be implemented, and must be consistent with equals. It should return a hashCode\n   *    for the given object. For two objects that are equal, it must return the same hash value. For two objects that are\n   *    not equal, it can return the same hash value (or not). A conscious effort must be made to minimise collisions between\n   *    the hash values of two non-equal objects for faster grouping.","sourceCodeStart":158,"sourceCodeEnd":194,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/segment/column/TypeStrategy.java#L158-L194","documentation":"TypeStrategy.fromBytes(byte[]) is a default method that deserializes a base64-encoded byte array value; only COMPLEX types are expected to override it for the expression engine's decode_base64 function. The default implementation throws IllegalStateException('Not supported').","triggerScenarios":"Calling fromBytes on a primitive, array, or complex type strategy that does not implement it — e.g. evaluating decode_base64 on a column of a type whose strategy lacks the override.","commonSituations":"Running decode_base64 expressions on non-complex or unsupported complex columns; custom complex types whose serde does not implement fromBytes.","solutions":["Only call fromBytes for types whose strategy implements it (COMPLEX types with byte-array support)","Implement fromBytes in the custom complex type's TypeStrategy/Serde","Avoid decode_base64 on unsupported column types in expressions"],"exampleFix":"// before\nObject v = strategy.fromBytes(Base64.decode(encoded));\n// after\nif (strategy instanceof MyComplexStrategy) {\n  Object v = strategy.fromBytes(Base64.decode(encoded));\n}","handlingStrategy":"type-guard","validationCode":"if (strategy instanceof ByteDecodableStrategy) { value = ((ByteDecodableStrategy<?>) strategy).fromBytes(bytes); }","typeGuard":"boolean supportsFromBytes(TypeStrategy<?> s) { return s instanceof SomeComplexStrategy || s.getClass().getName().equals(KNOWN_IMPLEMENTING_CLASSES); } // no marker interface exists; check type docs","tryCatchPattern":"try { return strategy.fromBytes(bytes); } catch (IllegalStateException e) { return null; /* type does not support decode_base64 */ }","preventionTips":["Use decode_base64 only on COMPLEX columns with byte-array-capable serdes","Implement fromBytes in custom complex TypeStrategies","Gate expression evaluation on column type capabilities"],"tags":["java","unsupported-operation","serialization","expressions"],"backgroundTag":"method-not-implemented","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"}