{"record":{"id":"44a6b3df88af2d53","repo":"apache/druid","slug":"error-analyzing-column-s-of-type-s","errorCode":null,"errorMessage":"Error analyzing column[%s] of type[%s]","messagePattern":"Error analyzing column\\[(.+?)\\] of type\\[(.+?)\\]","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"processing/src/main/java/org/apache/druid/query/metadata/SegmentAnalyzer.java","lineNumber":160,"sourceCode":"            }\n            break;\n          case ARRAY:\n            analysis = analyzeArrayColumn(capabilities);\n            break;\n          case COMPLEX:\n            final BaseColumnHolder columnHolder = index != null ? index.getColumnHolder(columnName) : null;\n            analysis = analyzeComplexColumn(capabilities, numRows, columnHolder);\n            break;\n          default:\n            log.warn(\"Unknown column type[%s] for column[%s].\", capabilities.asTypeString(), columnName);\n            analysis = ColumnAnalysis.error(StringUtils.format(\"unknown_type_%s\", capabilities.asTypeString()));\n        }\n      }\n      catch (RuntimeException re) {\n        // eat the exception and add error analysis, this is preferrable to exploding since exploding results in\n        // the broker downstream SQL metadata cache left in a state where it is unable to completely finish\n        // the SQL schema relies on this stuff functioning, and so will continuously retry when it faces a failure\n        log.warn(re, \"Error analyzing column[%s] of type[%s]\", columnName, capabilities.asTypeString());\n        analysis = ColumnAnalysis.error(re.getMessage());\n      }\n\n      columns.put(columnName, analysis);\n    }\n\n    return columns;\n  }\n\n  public boolean analyzingSize()\n  {\n    return analysisTypes.contains(SegmentMetadataQuery.AnalysisType.SIZE);\n  }\n\n  public boolean analyzingCardinality()\n  {\n    return analysisTypes.contains(SegmentMetadataQuery.AnalysisType.CARDINALITY);\n  }","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/query/metadata/SegmentAnalyzer.java#L142-L178","documentation":"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.","triggerScenarios":"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.","commonSituations":"Corrupt or partially written segment files, column files missing on deep storage after segment moves, extension version mismatches causing deserialize failures.","solutions":["Check the logged stack trace for the root RuntimeException","Verify segment integrity; re-download/re-index the corrupt segment","Ensure the extension handling the column's complex type is loaded on all nodes","If persistent, mark the segment unusable and trigger re-ingestion"],"exampleFix":"null","handlingStrategy":"try-catch","validationCode":"null","typeGuard":"null","tryCatchPattern":"// Consumers of SegmentAnalysis should check analysis.isError() per column before using stats\nfor (ColumnAnalysis ca : analysis.getColumns().values()) { if (ca.isError()) { /* exclude from schema */ } }","preventionTips":["Monitor logs for repeated column analysis failures pointing at corrupt segments","Verify segment file integrity on deep storage","Ensure all required extensions are loaded on every node"],"tags":["metadata","segment","runtime-error"],"backgroundTag":"database-query-failed","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"}