{"record":{"id":"ed88489b51cc5e95","repo":"apache/druid","slug":"cannot-handle-column-s-with-type-s-ed8848","errorCode":null,"errorMessage":"Cannot handle column [%s] with type [%s]","messagePattern":"Cannot handle column \\[(.+?)\\] with type \\[(.+?)\\]","errorType":"exception","errorClass":"UnsupportedColumnTypeException","httpStatus":null,"severity":"error","filePath":"processing/src/main/java/org/apache/druid/frame/field/FieldWriters.java","lineNumber":98,"sourceCode":"      case STRING:\n        return makeStringWriter(columnSelectorFactory, columnName, removeNullBytes);\n\n      case COMPLEX:\n        return makeComplexWriter(columnSelectorFactory, columnName, columnType.getComplexTypeName());\n\n      case ARRAY:\n        switch (columnType.getElementType().getType()) {\n          case STRING:\n            return makeStringArrayWriter(columnSelectorFactory, columnName, removeNullBytes);\n          case LONG:\n            return makeLongArrayWriter(columnSelectorFactory, columnName);\n          case FLOAT:\n            return makeFloatArrayWriter(columnSelectorFactory, columnName, frameType);\n          case DOUBLE:\n            return makeDoubleArrayWriter(columnSelectorFactory, columnName, frameType);\n          case ARRAY:\n          case COMPLEX:\n            throw new UnsupportedColumnTypeException(columnName, columnType);\n        }\n      default:\n        throw new UnsupportedColumnTypeException(columnName, columnType);\n    }\n  }\n\n  private static FieldWriter makeLongWriter(\n      final ColumnSelectorFactory selectorFactory,\n      final String columnName\n  )\n  {\n    final ColumnValueSelector<?> selector =\n        TypeCastSelectors.makeColumnValueSelector(selectorFactory, columnName, ColumnType.LONG);\n    return LongFieldWriter.forPrimitive(selector);\n  }\n\n  private static FieldWriter makeFloatWriter(\n      final ColumnSelectorFactory selectorFactory,","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/frame/field/FieldWriters.java#L80-L116","documentation":"FieldWriters.create dispatches on the column type to build writers; supported scalar and scalar-array types return writers, but some branches (e.g. COMPLEX inside the array switch, and the outer default) throw UnsupportedColumnTypeException ('Cannot handle column [%s] with type [%s]'). Error [989] is the outer default: a top-level type the frame writer layer cannot write.","triggerScenarios":"Calling FieldWriters.create with a ColumnType whose top-level type is not handled by the switch — for instance a COMPLEX column (hit in the array-switch COMPLEX arm) or any unknown/newer top-level type — when writing frames.","commonSituations":"MSQ work involving complex-metric columns that cannot be shuffled as frames; new column types introduced by upgrades but not yet supported by the frame writer; extension-provided types routed into generic frame writing.","solutions":["Read the reported type; if it is COMPLEX, avoid routing complex-metric columns through frame writing or convert them to a serializable representation.","Cast/derive supported columns (LONG/FLOAT/DOUBLE/STRING/arrays of those) before the frame-writing stage.","Align Druid versions so any newly supported types are available on all nodes.","Extend FieldWriters/FieldReaders together if adding support for a new type."],"exampleFix":"// before\nSELECT sketch_col FROM ... -- complex column hits frame writer\n// after\nSELECT APPROX_QUANTILE_DS(sketch_col, 0.5) AS p50 FROM ...  -- aggregate to a supported scalar before shuffle","handlingStrategy":"validation","validationCode":"if (columnType != null && columnType.getType() == ValueType.COMPLEX) { throw new IllegalStateException(\"complex column \" + columnName + \" not frame-writable; aggregate or convert first\"); }","typeGuard":null,"tryCatchPattern":"try { FieldWriters.create(factory, name, t, false); } catch (UnsupportedColumnTypeException e) { /* rewrite query to convert the column to a supported type */ }","preventionTips":["Aggregate complex-metric columns to scalars before shuffle stages","Cast unsupported types to supported ones upstream","Keep writer and reader type support in sync with the same Druid version"],"tags":["column-type","frames","unsupported-type"],"backgroundTag":"unsupported-operation","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}