{"record":{"id":"550b2180d049307f","repo":"apache/druid","slug":"cannot-handle-column-s-with-type-s-550b21","errorCode":null,"errorMessage":"Cannot handle column [%s] with type [%s]","messagePattern":"Cannot handle column \\[(.+?)\\] with type \\[(.+?)\\]","errorType":"validation","errorClass":"UnsupportedColumnTypeException","httpStatus":null,"severity":"error","filePath":"processing/src/main/java/org/apache/druid/frame/write/columnar/FrameColumnWriters.java","lineNumber":90,"sourceCode":"        return makeLongWriter(columnSelectorFactory, allocator, column);\n      case FLOAT:\n        return makeFloatWriter(columnSelectorFactory, allocator, column);\n      case DOUBLE:\n        return makeDoubleWriter(columnSelectorFactory, allocator, column);\n      case STRING:\n        return makeStringWriter(columnSelectorFactory, allocator, column);\n      case ARRAY:\n        switch (type.getElementType().getType()) {\n          case STRING:\n            return makeStringArrayWriter(columnSelectorFactory, allocator, column);\n          case LONG:\n            return makeLongArrayWriter(columnSelectorFactory, allocator, column);\n          case FLOAT:\n            return makeFloatArrayWriter(columnSelectorFactory, allocator, column);\n          case DOUBLE:\n            return makeDoubleArrayWriter(columnSelectorFactory, allocator, column);\n          default:\n            throw new UnsupportedColumnTypeException(column, type);\n        }\n      case COMPLEX:\n        return makeComplexWriter(columnSelectorFactory, allocator, column, type.getComplexTypeName());\n      default:\n        throw new UnsupportedColumnTypeException(column, type);\n    }\n  }\n\n  private static LongFrameColumnWriter makeLongWriter(\n      final ColumnSelectorFactory selectorFactory,\n      final MemoryAllocator allocator,\n      final String columnName\n  )\n  {\n    final ColumnCapabilities capabilities = selectorFactory.getColumnCapabilities(columnName);\n    final ColumnValueSelector<?> selector =\n        TypeCastSelectors.makeColumnValueSelector(selectorFactory, columnName, ColumnType.LONG);\n    return new LongFrameColumnWriter(selector, allocator, hasNullsForNumericWriter(capabilities));","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/frame/write/columnar/FrameColumnWriters.java#L72-L108","documentation":"FrameColumnWriters.create's switch over ColumnType falls through to default when the type family (or array element type within a family) has no corresponding writer. It throws UnsupportedColumnTypeException(column, type) naming the concrete unsupported type. This covers exotic complex types or array element types the frame writer cannot encode.","triggerScenarios":"Writing a frame column whose ColumnType is a family other than LONG/FLOAT/DOUBLE/STRING/ARRAY/COMPLEX branches (or an array with unsupported element type), e.g. a newly added type not yet mapped in the switch.","commonSituations":"Version skew where a writer node emits a type older readers/writers don't know; querying with expression results of new types; ingestion specs introducing complex types not supported by the frame format.","solutions":["Cast the column to a supported type in the SQL/spec before frame writing","Upgrade Druid so both sides support the type, or exclude the column from the output","Check FrameColumnWriters.create's supported types before selecting columns for frame output","File/patch support for the missing ColumnType case if legitimate"],"exampleFix":"// before\nSELECT someNewTypeCol FROM ...\n// after\nSELECT CAST(someNewTypeCol AS VARCHAR) AS someNewTypeCol FROM ...","handlingStrategy":"type-guard","validationCode":"ColumnType t = signature.getColumnType(idx).orElse(null); if (t != null && !SUPPORTED_WRITE_TYPES.contains(t.getFamily())) { /* cast or drop */ }","typeGuard":"boolean isWritableType(ColumnType t) { return t != null && (t.is(LONG)||t.is(FLOAT)||t.is(DOUBLE)||t.is(STRING)||t.isArray()||t.is(COMPLEX)); }","tryCatchPattern":"try { writer = FrameColumnWriters.create(...); } catch (UnsupportedColumnTypeException e) { log.warn(\"Unwritable column {} type {}\", e.getColumnName(), e.getColumnType()); }","preventionTips":["Cast unsupported types before frame output","Keep writer-side and reader-side versions aligned","Extend the switch when adding new ColumnTypes"],"tags":["unsupported-type","writer","frame"],"backgroundTag":"unsupported-operation","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"}