{"record":{"id":"e2371fd68a131387","repo":"apache/druid","slug":"no-complextypename-cannot-write-column-s","errorCode":null,"errorMessage":"No complexTypeName, cannot write column [%s]","messagePattern":"No complexTypeName, cannot write column \\[(.+?)\\]","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"processing/src/main/java/org/apache/druid/frame/field/FieldWriters.java","lineNumber":197,"sourceCode":"  private static FieldWriter makeDoubleArrayWriter(\n      final ColumnSelectorFactory selectorFactory,\n      final String columnName,\n      final FrameType frameType\n  )\n  {\n    final ColumnValueSelector<?> selector =\n        TypeCastSelectors.makeColumnValueSelector(selectorFactory, columnName, ColumnType.DOUBLE_ARRAY);\n    return NumericArrayFieldWriter.getDoubleArrayFieldWriter(selector, frameType);\n  }\n\n  private static FieldWriter makeComplexWriter(\n      final ColumnSelectorFactory selectorFactory,\n      final String columnName,\n      @Nullable final String columnTypeName\n  )\n  {\n    if (columnTypeName == null) {\n      throw new ISE(\"No complexTypeName, cannot write column [%s]\", columnName);\n    }\n\n    final ComplexMetricSerde serde = ComplexMetrics.getSerdeForType(columnTypeName);\n    if (serde == null) {\n      throw new ISE(\"No serde for complexTypeName[%s], cannot write column [%s]\", columnTypeName, columnName);\n    }\n\n    final ColumnValueSelector<?> selector =\n        TypeCastSelectors.makeColumnValueSelector(selectorFactory, columnName, ColumnType.ofComplex(columnTypeName));\n    return new ComplexFieldWriter(serde, selector);\n  }\n}\n","sourceCodeStart":179,"sourceCodeEnd":210,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/frame/field/FieldWriters.java#L179-L210","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Ensure the complex column's type name is set in the column metadata before frame writing.","Verify the segment/query path preserves complexTypeName through to FieldWriters.create.","If the column should not be complex, correct the column type in the schema or transform."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Java: ensure complex type name present before create()\nif (column instanceof ComplexColumnHolder && column.getComplexTypeName() == null) {\n  throw new IllegalStateException(\"Complex column \" + name + \" lacks a complexTypeName\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  FieldWriters.create(...);\n} catch (IllegalStateException e) {\n  if (e.getMessage().contains(\"No complexTypeName\")) {\n    // fix metadata or skip column\n  } else throw e;\n}","preventionTips":["Always build complex column holders with an explicit complexTypeName.","Validate segment/column metadata completeness before frame writing."],"tags":["complex-column","serde","missing-argument","druid"],"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"}