{"record":{"id":"472f23ffe83aa773","repo":"apache/druid","slug":"partitionsspec-s-is-not-supported","errorCode":null,"errorMessage":"partitionsSpec[%s] is not supported","messagePattern":"partitionsSpec\\[(.+?)\\] is not supported","errorType":"exception","errorClass":"UOE","httpStatus":null,"severity":"error","filePath":"indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTask.java","lineNumber":250,"sourceCode":"    this.ingestionSchema = ingestionSchema;\n    this.ingestionState = IngestionState.NOT_STARTED;\n    this.isStandAloneTask = isStandAloneTask;\n  }\n\n  @Override\n  public String getType()\n  {\n    return TYPE;\n  }\n\n  @Override\n  public boolean isReady(TaskActionClient taskActionClient) throws Exception\n  {\n    final IndexTuningConfig tuningConfig = getIngestionSchema().getTuningConfig();\n    if (tuningConfig != null && tuningConfig.getPartitionsSpec() != null) {\n      if (tuningConfig.getPartitionsSpec().getType() != SecondaryPartitionType.LINEAR\n          && tuningConfig.getPartitionsSpec().getType() != SecondaryPartitionType.HASH) {\n        throw new UOE(\"partitionsSpec[%s] is not supported\", tuningConfig.getPartitionsSpec().getClass().getName());\n      }\n    }\n    return determineLockGranularityAndTryLock(\n        taskActionClient,\n        ingestionSchema.dataSchema.getGranularitySpec().inputIntervals()\n    );\n  }\n\n  @Override\n  public boolean requireLockExistingSegments()\n  {\n    return isGuaranteedRollup(getIngestionMode(), ingestionSchema.tuningConfig)\n           || (getIngestionMode() != IngestionMode.APPEND);\n  }\n\n  @Override\n  public List<DataSegment> findSegmentsToLock(TaskActionClient taskActionClient, List<Interval> intervals)\n      throws IOException","sourceCodeStart":232,"sourceCodeEnd":268,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTask.java#L232-L268","documentation":"IndexTask.isReady validates the tuningConfig's partitionsSpec type before acquiring locks. Only LINEAR and HASH secondary partitioning are supported by the batch index task; any other type produces this UOE (Unsupported Operation Exception) naming the partitionsSpec class. It fails early, before the task does any work.","triggerScenarios":"Submitting an index task (or MSQ/batch-style spec handed to IndexTask) whose tuningConfig.partitionsSpec has a type other than LINEAR or HASH — e.g. SINGLE_DIM or a range/range-partitioning type from a different engine's spec.","commonSituations":"Copying a tuningConfig from a compaction task using range partitioning into a plain batch index task; hand-written specs using an unsupported partitionsSpec type; framework version mismatch where a new partitionsSpec type isn't supported by IndexTask.","solutions":["Change partitionsSpec to type \"linear\" (dynamic) or \"hash\" in tuningConfig","If range partitioning is required, use a compaction task or the MSQ engine instead of IndexTask","Validate the tuningConfig with the JSON schema/spec parser before submitting","Check the Druid version's supported partition types for batch ingestion"],"exampleFix":"// before\n\"partitionsSpec\": { \"type\": \"range\" }\n// after\n\"partitionsSpec\": { \"type\": \"hash\", \"numShards\": 4, \"partitionDimensions\": [] }","handlingStrategy":"validation","validationCode":"String type = tuningConfig.getPartitionsSpec().getType().name();\nif (!type.equals(\"LINEAR\") && !type.equals(\"HASH\")) {\n  throw new IllegalArgumentException(\"IndexTask supports only linear/hash, got: \" + type);\n}","typeGuard":"boolean isIndexTaskCompatible(PartitionsSpec p) {\n  return p != null && (p.getType() == SecondaryPartitionType.LINEAR\n      || p.getType() == SecondaryPartitionType.HASH);\n}","tryCatchPattern":"try {\n  ready = task.isReady(actionClient);\n} catch (UnsupportedOperationException e) {\n  log.error(\"Unsupported partitionsSpec for IndexTask: {}\", e.getMessage());\n  throw new IllegalArgumentException(\"Fix tuningConfig.partitionsSpec to linear or hash\", e);\n}","preventionTips":["Use only linear or hash partitionsSpec for batch index tasks","Route range partitioning to compaction or MSQ","Validate specs against the JSON schema of your Druid version","Check task logs before retrying with an unchanged spec"],"tags":["druid","ingestion","partitionspec","unsupported"],"backgroundTag":"unsupported-enum-value","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"}