apache/druid · error · UnsupportedColumnTypeException

Cannot handle column [%s] with unknown type

Error message

Cannot handle column [%s] with unknown type

What it means

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.

Source

Thrown at processing/src/main/java/org/apache/druid/frame/field/FieldWriters.java:67

  }

  /**
   * Helper used by {@link RowBasedFrameWriterFactory}.
   *
   * The returned {@link FieldWriter} objects are not thread-safe.
   *
   * @throws UnsupportedColumnTypeException if "type" cannot be handled
   */
  public static FieldWriter create(
      final FrameType frameType,
      final ColumnSelectorFactory columnSelectorFactory,
      final String columnName,
      final ColumnType columnType,
      final boolean removeNullBytes
  )
  {
    if (columnType == null) {
      throw new UnsupportedColumnTypeException(columnName, null);
    }

    switch (columnType.getType()) {
      case LONG:
        return makeLongWriter(columnSelectorFactory, columnName);

      case FLOAT:
        return makeFloatWriter(columnSelectorFactory, columnName, frameType);

      case DOUBLE:
        return makeDoubleWriter(columnSelectorFactory, columnName, frameType);

      case STRING:
        return makeStringWriter(columnSelectorFactory, columnName, removeNullBytes);

      case COMPLEX:
        return makeComplexWriter(columnSelectorFactory, columnName, columnType.getComplexTypeName());

View on GitHub (pinned to 9b90983fd2)

Solutions

  1. Verify the column exists in the source row signature and its name matches exactly (case-sensitive).
  2. Ensure the upstream stage/operator actually resolves and exposes the column's type before frame writing.
  3. Enable query-explain/debugging to see the stage's signature and find where the column disappeared.
  4. Fix the planner/operator bug if a derived column lacks type resolution.

Example fix

// before
ColumnType type = rowSignature.getColumnType(name); // may be null
FieldWriters.create(factory, name, type, false);
// after
ColumnType type = rowSignature.getColumnType(name);
if (type == null) {
  throw new ISE("Column [%s] missing from row signature [%s]", name, rowSignature);
}
FieldWriters.create(factory, name, type, false);
Defensive patterns

Strategy: validation

Validate before calling

ColumnType t = rowSignature.getColumnType(columnName);
if (t == null) { throw new IllegalStateException("column [" + columnName + "] absent from row signature " + rowSignature); }

Try / catch

try { FieldWriters.create(factory, name, t, false); } catch (UnsupportedColumnTypeException e) { log.error("untyped/missing column {}", name); throw e; }

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07). Data as JSON: /api/errors/a908ce313f282a09. Report an issue: GitHub.