apache/druid · warning

Unknown column type[ ] for column[ ].

Error message

Unknown column type[%s] for column[%s].

What it means

SegmentAnalyzer.analyze encountered a column whose capabilities report a type it does not know how to analyze (not STRING, LONG, FLOAT, DOUBLE, or COMPLEX in the switch). It logs a warning and stores a ColumnAnalysis error 'unknown_type_<type>' rather than failing the metadata query.

Solutions

  1. Upgrade Druid so processing and the segment versions match (analyzer knows the new type)
  2. Exclude that column from segmentMetadata analysis if stats are unnecessary
  3. Re-ingest data converting the column to a supported type
  4. Check capabilities.asTypeString() output to identify the unsupported type and its producer

Example fix

// before: analyze all columns including arrays
// SegmentMetadataQuery with default analyzer
// after: limit analyzed columns to supported types
// query.setAnalyzersSpec(new AnalyzerSpec(ImmutableList.of("channel"), ...))
Defensive patterns

Strategy: validation

Validate before calling

if (capabilities.getType() not in (STRING, LONG, FLOAT, DOUBLE, COMPLEX)) skip analysis for this column;

Type guard

null

Try / catch

null

Prevention

When it happens

Trigger: A column's ValueType in the switch statement hits the default branch, e.g. new/experimental value types (arrays, or types from extensions) that SegmentAnalyzer does not handle.

Common situations: Running an older broker/processing version against segments with newer column types (e.g. array-typed columns), or extension-provided complex types not supported by the metadata analyzer.

Related errors


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

Appendix: source

Thrown at processing/src/main/java/org/apache/druid/query/metadata/SegmentAnalyzer.java:152

            analysis = analyzeNumericColumn(capabilities, numRows, Double.BYTES);
            break;
          case STRING:
            final BaseColumnHolder stringHolder = index != null ? index.getColumnHolder(columnName) : null;
            if (stringHolder != null) {
              analysis = analyzeStringColumn(capabilities, stringHolder);
            } else {
              analysis = analyzeStringColumn(capabilities, columnInspector, cursorFactory, columnName);
            }
            break;
          case ARRAY:
            analysis = analyzeArrayColumn(capabilities);
            break;
          case COMPLEX:
            final BaseColumnHolder columnHolder = index != null ? index.getColumnHolder(columnName) : null;
            analysis = analyzeComplexColumn(capabilities, numRows, columnHolder);
            break;
          default:
            log.warn("Unknown column type[%s] for column[%s].", capabilities.asTypeString(), columnName);
            analysis = ColumnAnalysis.error(StringUtils.format("unknown_type_%s", capabilities.asTypeString()));
        }
      }
      catch (RuntimeException re) {
        // eat the exception and add error analysis, this is preferrable to exploding since exploding results in
        // the broker downstream SQL metadata cache left in a state where it is unable to completely finish
        // the SQL schema relies on this stuff functioning, and so will continuously retry when it faces a failure
        log.warn(re, "Error analyzing column[%s] of type[%s]", columnName, capabilities.asTypeString());
        analysis = ColumnAnalysis.error(re.getMessage());
      }

      columns.put(columnName, analysis);
    }

    return columns;
  }

  public boolean analyzingSize()

View on GitHub (pinned to 9b90983fd2)