{"record":{"id":"8368f8f84964761c","repo":"apache/druid","slug":"not-computing-rollup","errorCode":null,"errorMessage":"Not computing rollup","messagePattern":"Not computing rollup","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"indexing-service/src/main/java/org/apache/druid/indexing/common/task/CompactionTask.java","lineNumber":1057,"sourceCode":"                  + \"queryGranularity, dimensionsSpec, and metricsSpec.\", dataSegment.getId()\n              );\n            }\n\n            processRollup(index);\n            processQueryGranularity(index);\n            processDimensionsSpec(index);\n            processMetricsSpec(index);\n            processMultiValuedDimensions(index);\n            processProjections(index);\n          }\n        }\n      }\n    }\n\n    public Boolean getRollup()\n    {\n      if (!needRollup) {\n        throw new ISE(\"Not computing rollup\");\n      }\n\n      return rollup;\n    }\n\n    public Granularity getQueryGranularity()\n    {\n      if (!needQueryGranularity) {\n        throw new ISE(\"Not computing queryGranularity\");\n      }\n\n      return queryGranularity;\n    }\n\n    public DimensionsSpec getDimensionsSpec()\n    {\n      if (!needDimensionsSpec) {\n        throw new ISE(\"Not computing dimensionsSpec\");","sourceCodeStart":1039,"sourceCodeEnd":1075,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/indexing-service/src/main/java/org/apache/druid/indexing/common/task/CompactionTask.java#L1039-L1075","documentation":"ExistingSegmentAnalyzer.getRollup() is an accessor that only yields a value if rollup computation was requested (needRollup=true). Calling it when the analyzer was not configured to compute rollup throws ISE — an internal usage-contract violation, not a data problem.","triggerScenarios":"CompactionTask code (or a caller of ExistingSegmentAnalyzer) invoking getRollup() without having requested rollup in the analyzer's 'need' flags; usually a consequence of error 686's workaround where metadata is missing and rollup inference was skipped.","commonSituations":"Custom code reusing ExistingSegmentAnalyzer with partial analysis flags; upstream auto-compaction logic reading results of an analysis that was intentionally narrowed.","solutions":["Ensure the analyzer is constructed/configured with needRollup (include segment metadata analysis) before calling getRollup().","Check getRollup() only after running analysis where metadata was available; otherwise supply an explicit rollup value in the compaction spec.","If you cannot guarantee it, wrap the call and fall back to an explicit rollup setting."],"exampleFix":"// before\nExistingSegmentAnalyzer analyzer = new ExistingSegmentAnalyzer(false, true, true); // no rollup\nanalyzer.processSegment(...);\nBoolean rollup = analyzer.getRollup(); // throws\n// after\nExistingSegmentAnalyzer analyzer = new ExistingSegmentAnalyzer(true, true, true);\nanalyzer.processSegment(...);\nBoolean rollup = analyzer.getRollup();","handlingStrategy":"type-guard","validationCode":"if (analyzer.isComputingRollup()) { rollup = analyzer.getRollup(); } else { rollup = explicitRollupFromSpec; }","typeGuard":"boolean canGetRollup(ExistingSegmentAnalyzer a) { return a.isComputingRollup(); }","tryCatchPattern":"try { rollup = analyzer.getRollup(); } catch (ISE e) { if (e.getMessage().equals(\"Not computing rollup\")) { rollup = explicitValue; } else throw e; }","preventionTips":["Construct ExistingSegmentAnalyzer with all need-flags true unless you deliberately skip a metric.","Only read getters after analysis completes on at least one segment with metadata.","Centralize analyzer construction so flags are consistent across call sites."],"tags":["druid","compaction","internal-api","invariant"],"backgroundTag":"internal-invariant-violation","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}