{"record":{"id":"a908ce313f282a09","repo":"apache/druid","slug":"cannot-handle-column-s-with-unknown-type","errorCode":null,"errorMessage":"Cannot handle column [%s] with unknown type","messagePattern":"Cannot handle column \\[(.+?)\\] with unknown type","errorType":"exception","errorClass":"UnsupportedColumnTypeException","httpStatus":null,"severity":"error","filePath":"processing/src/main/java/org/apache/druid/frame/field/FieldWriters.java","lineNumber":67,"sourceCode":"  }\n\n  /**\n   * Helper used by {@link RowBasedFrameWriterFactory}.\n   *\n   * The returned {@link FieldWriter} objects are not thread-safe.\n   *\n   * @throws UnsupportedColumnTypeException if \"type\" cannot be handled\n   */\n  public static FieldWriter create(\n      final FrameType frameType,\n      final ColumnSelectorFactory columnSelectorFactory,\n      final String columnName,\n      final ColumnType columnType,\n      final boolean removeNullBytes\n  )\n  {\n    if (columnType == null) {\n      throw new UnsupportedColumnTypeException(columnName, null);\n    }\n\n    switch (columnType.getType()) {\n      case LONG:\n        return makeLongWriter(columnSelectorFactory, columnName);\n\n      case FLOAT:\n        return makeFloatWriter(columnSelectorFactory, columnName, frameType);\n\n      case DOUBLE:\n        return makeDoubleWriter(columnSelectorFactory, columnName, frameType);\n\n      case STRING:\n        return makeStringWriter(columnSelectorFactory, columnName, removeNullBytes);\n\n      case COMPLEX:\n        return makeComplexWriter(columnSelectorFactory, columnName, columnType.getComplexTypeName());\n","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/frame/field/FieldWriters.java#L49-L85","documentation":"FieldWriters.create builds a frame field writer for a column; before dispatching on the ColumnType it rejects a null columnType with UnsupportedColumnTypeException reported as 'Cannot handle column [%s] with unknown type'. A column arriving at frame writing without a resolved type is an upstream schema-resolution failure.","triggerScenarios":"Calling FieldWriters.create(columnSelectorFactory, columnName, null, removeNullBytes) — the ColumnSelectorFactory produced no ColumnType for the column (e.g. the column does not exist in the row signature, or type resolution was skipped).","commonSituations":"Queries referencing a column missing from the cursor/row signature; MSQ stages where a column was dropped upstream but downstream still requests it; bugs in type propagation leaving types unresolved for virtual/derived columns.","solutions":["Verify the column exists in the source row signature and its name matches exactly (case-sensitive).","Ensure the upstream stage/operator actually resolves and exposes the column's type before frame writing.","Enable query-explain/debugging to see the stage's signature and find where the column disappeared.","Fix the planner/operator bug if a derived column lacks type resolution."],"exampleFix":"// before\nColumnType type = rowSignature.getColumnType(name); // may be null\nFieldWriters.create(factory, name, type, false);\n// after\nColumnType type = rowSignature.getColumnType(name);\nif (type == null) {\n  throw new ISE(\"Column [%s] missing from row signature [%s]\", name, rowSignature);\n}\nFieldWriters.create(factory, name, type, false);","handlingStrategy":"validation","validationCode":"ColumnType t = rowSignature.getColumnType(columnName);\nif (t == null) { throw new IllegalStateException(\"column [\" + columnName + \"] absent from row signature \" + rowSignature); }","typeGuard":null,"tryCatchPattern":"try { FieldWriters.create(factory, name, t, false); } catch (UnsupportedColumnTypeException e) { log.error(\"untyped/missing column {}\", name); throw e; }","preventionTips":["Resolve column types from the row signature before frame writing","Use exact, case-sensitive column names","Ensure upstream operators propagate types for derived columns"],"tags":["column-type","frames","null-type"],"backgroundTag":"missing-required-argument","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"}