apache/druid · error · IllegalStateException

Not computing rollup

Error message

Not computing rollup

What it means

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.

Source

Thrown at indexing-service/src/main/java/org/apache/druid/indexing/common/task/CompactionTask.java:1057

                  + "queryGranularity, dimensionsSpec, and metricsSpec.", dataSegment.getId()
              );
            }

            processRollup(index);
            processQueryGranularity(index);
            processDimensionsSpec(index);
            processMetricsSpec(index);
            processMultiValuedDimensions(index);
            processProjections(index);
          }
        }
      }
    }

    public Boolean getRollup()
    {
      if (!needRollup) {
        throw new ISE("Not computing rollup");
      }

      return rollup;
    }

    public Granularity getQueryGranularity()
    {
      if (!needQueryGranularity) {
        throw new ISE("Not computing queryGranularity");
      }

      return queryGranularity;
    }

    public DimensionsSpec getDimensionsSpec()
    {
      if (!needDimensionsSpec) {
        throw new ISE("Not computing dimensionsSpec");

View on GitHub (pinned to 9b90983fd2)

Solutions

  1. Ensure the analyzer is constructed/configured with needRollup (include segment metadata analysis) before calling getRollup().
  2. Check getRollup() only after running analysis where metadata was available; otherwise supply an explicit rollup value in the compaction spec.
  3. If you cannot guarantee it, wrap the call and fall back to an explicit rollup setting.

Example fix

// before
ExistingSegmentAnalyzer analyzer = new ExistingSegmentAnalyzer(false, true, true); // no rollup
analyzer.processSegment(...);
Boolean rollup = analyzer.getRollup(); // throws
// after
ExistingSegmentAnalyzer analyzer = new ExistingSegmentAnalyzer(true, true, true);
analyzer.processSegment(...);
Boolean rollup = analyzer.getRollup();
Defensive patterns

Strategy: type-guard

Validate before calling

if (analyzer.isComputingRollup()) { rollup = analyzer.getRollup(); } else { rollup = explicitRollupFromSpec; }

Type guard

boolean canGetRollup(ExistingSegmentAnalyzer a) { return a.isComputingRollup(); }

Try / catch

try { rollup = analyzer.getRollup(); } catch (ISE e) { if (e.getMessage().equals("Not computing rollup")) { rollup = explicitValue; } else throw e; }

Prevention

When it happens

Trigger: 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.

Common situations: Custom code reusing ExistingSegmentAnalyzer with partial analysis flags; upstream auto-compaction logic reading results of an analysis that was intentionally narrowed.

Understand the failure class

Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.

Related errors


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