apache/druid · error · IllegalStateException

No complexTypeName, cannot write column [%s]

Error message

No complexTypeName, cannot write column [%s]

What it means

makeComplexWriter needs a registered complex column type name (e.g. hyperUnique, quantilesDoublesSketch) to look up the ComplexMetricSerde used to serialize the column. When columnTypeName is null, the complex column cannot be serialized, so an ISE is thrown. This is an internal precondition: COMPLEX columns only reach here when a complex type name must be available.

Source

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

  private static FieldWriter makeDoubleArrayWriter(
      final ColumnSelectorFactory selectorFactory,
      final String columnName,
      final FrameType frameType
  )
  {
    final ColumnValueSelector<?> selector =
        TypeCastSelectors.makeColumnValueSelector(selectorFactory, columnName, ColumnType.DOUBLE_ARRAY);
    return NumericArrayFieldWriter.getDoubleArrayFieldWriter(selector, frameType);
  }

  private static FieldWriter makeComplexWriter(
      final ColumnSelectorFactory selectorFactory,
      final String columnName,
      @Nullable final String columnTypeName
  )
  {
    if (columnTypeName == null) {
      throw new ISE("No complexTypeName, cannot write column [%s]", columnName);
    }

    final ComplexMetricSerde serde = ComplexMetrics.getSerdeForType(columnTypeName);
    if (serde == null) {
      throw new ISE("No serde for complexTypeName[%s], cannot write column [%s]", columnTypeName, columnName);
    }

    final ColumnValueSelector<?> selector =
        TypeCastSelectors.makeColumnValueSelector(selectorFactory, columnName, ColumnType.ofComplex(columnTypeName));
    return new ComplexFieldWriter(serde, selector);
  }
}

View on GitHub (pinned to 9b90983fd2)

Solutions

  1. Ensure the complex column's type name is set in the column metadata before frame writing.
  2. Verify the segment/query path preserves complexTypeName through to FieldWriters.create.
  3. If the column should not be complex, correct the column type in the schema or transform.
Defensive patterns

Strategy: validation

Validate before calling

// Java: ensure complex type name present before create()
if (column instanceof ComplexColumnHolder && column.getComplexTypeName() == null) {
  throw new IllegalStateException("Complex column " + name + " lacks a complexTypeName");
}

Try / catch

try {
  FieldWriters.create(...);
} catch (IllegalStateException e) {
  if (e.getMessage().contains("No complexTypeName")) {
    // fix metadata or skip column
  } else throw e;
}

Prevention

When it happens

Trigger: Calling FieldWriters.create(...) for a COMPLEX-typed column where the ColumnHolder/ColumnType carries no complex type name (complexTypeName == null), e.g. a synthetic or partially-built complex column.

Common situations: Frame-writing a segment whose complex column metadata is incomplete; constructing column selector factories in tests or ingestion code without setting the complex type name; version-mismatched segment metadata missing the serde type.

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/e2371fd68a131387. Report an issue: GitHub.