{"record":{"id":"cbf20db80f95a0bf","repo":"apache/druid","slug":"cannot-handle-column-s-with-unknown-type-cbf20d","errorCode":null,"errorMessage":"Cannot handle column [%s] with unknown type","messagePattern":"Cannot handle column \\[(.+?)\\] with unknown type","errorType":"validation","errorClass":"UnsupportedColumnTypeException","httpStatus":null,"severity":"error","filePath":"processing/src/main/java/org/apache/druid/frame/write/columnar/FrameColumnWriters.java","lineNumber":67,"sourceCode":"  private FrameColumnWriters()\n  {\n    // No instantiation.\n  }\n\n  /**\n   * Helper used by {@link ColumnarFrameWriterFactory}.\n   *\n   * @throws UnsupportedColumnTypeException if \"type\" cannot be handled\n   */\n  static FrameColumnWriter create(\n      final ColumnSelectorFactory columnSelectorFactory,\n      final MemoryAllocator allocator,\n      final String column,\n      final ColumnType type\n  )\n  {\n    if (type == null) {\n      throw new UnsupportedColumnTypeException(column, null);\n    }\n\n    switch (type.getType()) {\n      case LONG:\n        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:","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/frame/write/columnar/FrameColumnWriters.java#L49-L85","documentation":"FrameColumnWriters.create builds a column writer for the given ColumnType. A null type means the RowSignature never assigned a type to the column, so no writer can be chosen; it throws UnsupportedColumnTypeException(column, null) immediately. This fails fast at frame-writing time for untyped columns.","triggerScenarios":"Calling FrameColumnWriters.create (via FrameWriterFactory/FrameWriterUtils pipelines) with a signature column whose ColumnType is null — e.g. a signature built from inferred or external schema without a type.","commonSituations":"Ingestion/MSQ specs selecting untyped expressions (NULL literals, untyped nested queries); programmatic RowSignature building omitting types; schema inference returning nothing for empty input.","solutions":["Give every column an explicit type in the RowSignature or ingestion spec","CAST untyped expressions in the SQL (e.g. CAST(x AS BIGINT)) before they reach frame writing","Fix schema-inference code so it never yields null ColumnTypes"],"exampleFix":"// before\n.add(\"nullableCol\", null)\n// after\n.add(\"nullableCol\", ColumnType.STRING)","handlingStrategy":"validation","validationCode":"Preconditions.checkNotNull(signature.getColumnType(colIdx).orElse(null), \"Column %s must be typed\", column);","typeGuard":"boolean writableColumnType(ColumnType t) { return t != null; }","tryCatchPattern":"try { FrameColumnWriters.create(...); } catch (UnsupportedColumnTypeException e) { /* assign a type and rebuild the writer */ }","preventionTips":["Never build RowSignature entries without types","CAST NULL/untyped expressions in SQL","Validate signatures before FrameWriterFactory creation"],"tags":["unsupported-type","writer","frame"],"backgroundTag":"schema-validation-failed","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"}