{"record":{"id":"096b26eb5806d499","repo":"apache/druid","slug":"unknown-column-type-for-column-s","errorCode":null,"errorMessage":"Unknown column type for column[%s]","messagePattern":"Unknown column type for column\\[(.+?)\\]","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"processing/src/main/java/org/apache/druid/query/metadata/SegmentAnalyzer.java","lineNumber":116,"sourceCode":"    final CursorFactory cursorFactory = Objects.requireNonNull(segment.as(CursorFactory.class));\n\n    final int numRows = rowCountInspector != null ? rowCountInspector.getNumRows() : 0;\n\n    // Use LinkedHashMap to preserve column order.\n    final Map<String, ColumnAnalysis> columns = new LinkedHashMap<>();\n\n    final RowSignature rowSignature = cursorFactory.getRowSignature();\n    for (String columnName : rowSignature.getColumnNames()) {\n      final ColumnCapabilities capabilities;\n\n      if (columnInspector != null) {\n        capabilities = columnInspector.getColumnCapabilities(columnName);\n      } else {\n        capabilities = null;\n      }\n\n      if (capabilities == null) {\n        log.warn(\"Unknown column type for column[%s]\", columnName);\n        columns.put(columnName, ColumnAnalysis.error(\"unknown_type\"));\n        continue;\n      }\n\n      ColumnAnalysis analysis;\n      try {\n        switch (capabilities.getType()) {\n          case LONG:\n            final int bytesPerRow =\n                ColumnHolder.TIME_COLUMN_NAME.equals(columnName) ? NUM_BYTES_IN_TIMESTAMP : Long.BYTES;\n\n            analysis = analyzeNumericColumn(capabilities, numRows, bytesPerRow);\n            break;\n          case FLOAT:\n            analysis = analyzeNumericColumn(capabilities, numRows, NUM_BYTES_IN_TEXT_FLOAT);\n            break;\n          case DOUBLE:\n            analysis = analyzeNumericColumn(capabilities, numRows, Double.BYTES);","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/query/metadata/SegmentAnalyzer.java#L98-L134","documentation":"SegmentAnalyzer.analyze could not determine the capabilities (type) of a column while building segment metadata (e.g. for a segmentMetadata/SELECT metadata query). Instead of failing the query, it logs a warning and records a ColumnAnalysis with error 'unknown_type' for that column. This typically means the column exists but its type cannot be resolved from the column capabilities.","triggerScenarios":"A segmentMetadata or schema-rolling query hits a segment whose column has null capabilities, e.g. metadata-less segments, unsupported/legacy column formats, or columns added via a handler that does not report capabilities.","commonSituations":"Older segments created before a type was introduced, third-party extensions producing columns without capabilities, schema rollup ingestion leaving columns untyped.","solutions":["Re-index/re-ingest the affected segment so columns carry proper capabilities","Check which extension/data format produced the segment and upgrade it","Ignore the column's stats — the query still returns other column analyses","Compare Druid versions of the segment and the cluster (version mismatch in segment format)"],"exampleFix":"null","handlingStrategy":"validation","validationCode":"ColumnCapabilities caps = column.getColumnCapabilities(name);\nif (caps == null || caps.getType() == null) { /* skip analysis or re-index segment */ }","typeGuard":"null","tryCatchPattern":"null","preventionTips":["Re-index legacy segments lacking column capabilities","Keep segment-producing extensions and cluster versions aligned","Handle ColumnAnalysis.error(\"unknown_type\") entries in metadata consumers"],"tags":["metadata","segment","column"],"backgroundTag":"type-mismatch","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"}