{"record":{"id":"b083f27c81e2654d","repo":"apache/druid","slug":"cannot-handle-inputspec-of-class-s-b083f2","errorCode":null,"errorMessage":"Cannot handle inputSpec of class [%s]","messagePattern":"Cannot handle inputSpec of class \\[(.+?)\\]","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"multi-stage-query/src/main/java/org/apache/druid/msq/input/MapInputSpecSlicer.java","lineNumber":71,"sourceCode":"\n  @Override\n  public List<InputSlice> sliceDynamic(\n      InputSpec inputSpec,\n      @Nullable SegmentPruner segmentPruner,\n      int maxNumSlices,\n      int maxFilesPerSlice,\n      long maxBytesPerSlice\n  )\n  {\n    return getSlicer(inputSpec.getClass()).sliceDynamic(inputSpec, segmentPruner, maxNumSlices, maxFilesPerSlice, maxBytesPerSlice);\n  }\n\n  private InputSpecSlicer getSlicer(final Class<? extends InputSpec> clazz)\n  {\n    final InputSpecSlicer slicer = splitterMap.get(clazz);\n\n    if (slicer == null) {\n      throw new ISE(\"Cannot handle inputSpec of class [%s]\", clazz.getName());\n    }\n\n    return slicer;\n  }\n}\n","sourceCodeStart":53,"sourceCodeEnd":77,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/multi-stage-query/src/main/java/org/apache/druid/msq/input/MapInputSpecSlicer.java#L53-L77","documentation":"MSQ's input-slicing framework dispatches each InputSpec type to a registered InputSpecSlicer via getSlicer. This ISE is thrown when an InputSpec class has no slicer registered in splitterMap, meaning the query contains an input spec type the current slicer does not know how to split across workers.","triggerScenarios":"Calling canSliceDynamic, sliceStatic, or sliceDynamic on a MapInputSpecSlicer whose splitterMap lacks an entry for the InputSpec subclass being sliced (e.g. a new InputSpec type added without updating the map, or an exotic data source deserialized from JSON).","commonSituations":"A custom extension registers a new InputSpec; a Druid version mismatch where one broker/overlord serializes a newer InputSpec that an older controller's MapInputSpecSlicer doesn't handle; wiring bugs where a slicer is constructed with a partial map of splitters.","solutions":["Check the InputSpec class named in the message and confirm the Druid MSQ code path that produced it is supported for this query type.","If you added a custom InputSpec, register a corresponding InputSpecSlicer in the MapInputSpecSlicer's splitterMap.","Verify all Druid nodes (overlord, controller, worker) run the same version so InputSpec classes match.","If triggered by an unsupported datasource (e.g. lookup or inline passed where only table/stage are supported), rewrite the query to use a supported input source."],"exampleFix":"// before\nfinal MapInputSpecSlicer slicer = new MapInputSpecSlicer(\n    ImmutableMap.of(TableInputSpec.class, tableSlicer));\nslicer.sliceStatic(inputSpec, ...); // ISE for StageInputSpec\n// after\nfinal MapInputSpecSlicer slicer = new MapInputSpecSlicer(\n    ImmutableMap.of(\n        TableInputSpec.class, tableSlicer,\n        StageInputSpec.class, stageSlicer));","handlingStrategy":"try-catch","validationCode":"if (!ImmutableSet.of(TableInputSpec.class, StageInputSpec.class).contains(inputSpec.getClass())) {\n  throw new UnsupportedOperationException(\"No slicer for \" + inputSpec.getClass());\n}","typeGuard":null,"tryCatchPattern":"try {\n  slicer.sliceStatic(inputSpec, maxSlices);\n} catch (IllegalStateException e) {\n  if (e.getMessage() != null && e.getMessage().startsWith(\"Cannot handle inputSpec of class\")) {\n    log.error(e, \"Unsupported input spec %s\", inputSpec.getClass().getName());\n  } else {\n    throw e;\n  }\n}","preventionTips":["Keep the splitterMap aligned with every InputSpec subclass in use.","Run MSQ integration tests when adding new input spec types.","Pin all Druid nodes to the same version."],"tags":["msq","internal-error","unsupported-input-spec","dispatch"],"backgroundTag":"unsupported-operation","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"}