{"record":{"id":"c7fd26a1cc8755d2","repo":"apache/druid","slug":"can-t-read-row-memory-from-frame-wrong-frame-type","errorCode":null,"errorMessage":"Can't read row memory from frame. Wrong frame type or signature?","messagePattern":"Can't read row memory from frame\\. Wrong frame type or signature\\?","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"multi-stage-query/src/main/java/org/apache/druid/msq/indexing/processor/KeyStatisticsCollectionProcessor.java","lineNumber":150,"sourceCode":"        outputChannels(),\n        () -> clusterByStatisticsCollector = null\n    );\n  }\n\n  private IntSupplier makeRowWeightSupplier(\n      final FrameReader frameReader,\n      final FrameType frameType,\n      final ColumnSelectorFactory columnSelectorFactory\n  )\n  {\n    final Supplier<MemoryRange<Memory>> rowMemorySupplier =\n        FrameReaderUtils.makeRowMemorySupplier(columnSelectorFactory, frameType, frameReader.signature());\n\n    final int numFields = frameReader.signature().size();\n\n    if (rowMemorySupplier == null) {\n      // Can't access row memory.\n      throw new ISE(\"Can't read row memory from frame. Wrong frame type or signature?\");\n    }\n\n    return () -> {\n      final MemoryRange<Memory> rowMemory = rowMemorySupplier.get();\n\n      if (rowMemory == null) {\n        // Can't access row memory.\n        throw new ISE(\"Can't read row memory from frame. Wrong type or signature?\");\n      }\n\n      long maxValueLength = 0;\n      long totalLength = 0;\n      long currentValueStartPosition = (long) Integer.BYTES * numFields;\n\n      for (int i = 0; i < numFields; i++) {\n        final long currentValueEndPosition = rowMemory.memory().getInt(rowMemory.start() + (long) Integer.BYTES * i);\n        final long valueLength = currentValueEndPosition - currentValueStartPosition;\n","sourceCodeStart":132,"sourceCodeEnd":168,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/multi-stage-query/src/main/java/org/apache/druid/msq/indexing/processor/KeyStatisticsCollectionProcessor.java#L132-L168","documentation":"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.","triggerScenarios":"Thrown at multi-stage-query/src/main/java/org/apache/druid/msq/indexing/processor/KeyStatisticsCollectionProcessor.java:150 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Report as a bug with the query and stage plan: this indicates the processor was attached to an unsupported frame type/signature.","Check for recent changes or mismatches in FrameProcessor/FrameReader wiring in the query stack.","As a workaround, disable features that require sorted-key statistics collection (e.g. certain ORDER BY/cluster-by shuffles) and retry."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}