apache/druid · warning

Error analyzing column

Error message

Error analyzing column[%s] of type[%s]

What it means

While analyzing a column for segment metadata, a RuntimeException was thrown by the type-specific analyzer. SegmentAnalyzer catches it, logs this warning, and records ColumnAnalysis.error(re.getMessage()) so the broker's SQL metadata cache does not endlessly retry a failing analysis. The metadata query still completes with an error entry for that column.

Solutions

  1. Check the logged stack trace for the root RuntimeException
  2. Verify segment integrity; re-download/re-index the corrupt segment
  3. Ensure the extension handling the column's complex type is loaded on all nodes
  4. If persistent, mark the segment unusable and trigger re-ingestion

Example fix

null
Defensive patterns

Strategy: try-catch

Validate before calling

null

Type guard

null

Try / catch

// Consumers of SegmentAnalysis should check analysis.isError() per column before using stats
for (ColumnAnalysis ca : analysis.getColumns().values()) { if (ca.isError()) { /* exclude from schema */ } }

Prevention

When it happens

Trigger: Any RuntimeException inside analyzeString/analyzeNumeric/analyzeComplexColumn, e.g. reading the column's data fails, a dictionary is missing, or an extension's complex column deserialization throws.

Common situations: Corrupt or partially written segment files, column files missing on deep storage after segment moves, extension version mismatches causing deserialize failures.

Understand the failure class

Background: Database query failed: Internal Server Error 500s wrapping SQL, Prisma, and connection failures — what to check first — this error's family across 16 libraries.

Related errors


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

Appendix: source

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

            }
            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()
  {
    return analysisTypes.contains(SegmentMetadataQuery.AnalysisType.SIZE);
  }

  public boolean analyzingCardinality()
  {
    return analysisTypes.contains(SegmentMetadataQuery.AnalysisType.CARDINALITY);
  }

View on GitHub (pinned to 9b90983fd2)