apache/druid · error · IllegalStateException

Can't read row memory from frame. Wrong frame type or…

Error message

Can't read row memory from frame. Wrong frame type or signature?

What it means

Thrown in makeRowWeightSupplier when FrameReaderUtils.makeRowMemorySupplier returns null, meaning the channel's frame layout does not expose raw row memory that the cluster-by statistics collector can read directly (wrong FrameType or the frame signature is not one contiguous memory-readable row). This is an internal engine invariant failure for memory-accessible input frames.

Solutions

  1. Report as a bug with the query and stage plan: this indicates the processor was attached to an unsupported frame type/signature.
  2. Check for recent changes or mismatches in FrameProcessor/FrameReader wiring in the query stack.
  3. As a workaround, disable features that require sorted-key statistics collection (e.g. certain ORDER BY/cluster-by shuffles) and retry.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at multi-stage-query/src/main/java/org/apache/druid/msq/indexing/processor/KeyStatisticsCollectionProcessor.java:150 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at multi-stage-query/src/main/java/org/apache/druid/msq/indexing/processor/KeyStatisticsCollectionProcessor.java:150

        outputChannels(),
        () -> clusterByStatisticsCollector = null
    );
  }

  private IntSupplier makeRowWeightSupplier(
      final FrameReader frameReader,
      final FrameType frameType,
      final ColumnSelectorFactory columnSelectorFactory
  )
  {
    final Supplier<MemoryRange<Memory>> rowMemorySupplier =
        FrameReaderUtils.makeRowMemorySupplier(columnSelectorFactory, frameType, frameReader.signature());

    final int numFields = frameReader.signature().size();

    if (rowMemorySupplier == null) {
      // Can't access row memory.
      throw new ISE("Can't read row memory from frame. Wrong frame type or signature?");
    }

    return () -> {
      final MemoryRange<Memory> rowMemory = rowMemorySupplier.get();

      if (rowMemory == null) {
        // Can't access row memory.
        throw new ISE("Can't read row memory from frame. Wrong type or signature?");
      }

      long maxValueLength = 0;
      long totalLength = 0;
      long currentValueStartPosition = (long) Integer.BYTES * numFields;

      for (int i = 0; i < numFields; i++) {
        final long currentValueEndPosition = rowMemory.memory().getInt(rowMemory.start() + (long) Integer.BYTES * i);
        final long valueLength = currentValueEndPosition - currentValueStartPosition;

View on GitHub (pinned to 9b90983fd2)