{"record":{"id":"771209ba2b66980a","repo":"apache/druid","slug":"s-secondary-partition-type-is-not-supported","errorCode":null,"errorMessage":"[%s] secondary partition type is not supported","messagePattern":"\\[(.+?)\\] secondary partition type 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":857,"sourceCode":"        );\n        sequenceNameFunction = localSegmentAllocator.getSequenceNameFunction();\n        segmentAllocator = localSegmentAllocator;\n        break;\n      case LINEAR:\n        segmentAllocator = SegmentAllocators.forLinearPartitioning(\n            toolbox,\n            baseSequenceName,\n            null,\n            dataSchema,\n            getTaskLockHelper(),\n            getIngestionMode(),\n            partitionAnalysis.getPartitionsSpec(),\n            null\n        );\n        sequenceNameFunction = segmentAllocator.getSequenceNameFunction();\n        break;\n      default:\n        throw new UOE(\"[%s] secondary partition type is not supported\", partitionsSpec.getType());\n    }\n\n    final TransactionalSegmentPublisher publisher = buildSegmentPublisher(toolbox);\n\n    String effectiveId = getContextValue(CompactionTask.CTX_KEY_APPENDERATOR_TRACKING_TASK_ID, null);\n    if (effectiveId == null) {\n      effectiveId = getId();\n    }\n\n    final Appenderator appenderator = BatchAppenderators.newAppenderator(\n        effectiveId,\n        toolbox.getAppenderatorsManager(),\n        buildSegmentsSegmentGenerationMetrics,\n        toolbox,\n        dataSchema,\n        tuningConfig,\n        buildSegmentsMeters,\n        buildSegmentsParseExceptionHandler","sourceCodeStart":839,"sourceCodeEnd":875,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/indexing-service/src/main/java/org/apache/druid/indexing/common/task/IndexTask.java#L839-L875","documentation":"In IndexTask.generateAndPublishSegments, a switch over the partitionsSpec type handles HASH, LINEAR and a couple of variants; the default branch throws UOE stating the secondary partition type is not supported. This is the last line of defense against a partitionsSpec type the batch index task cannot allocate segments for.","triggerScenarios":"partitionsSpec.getType() reaching the segment-allocation switch with a value outside {LINEAR, HASH and the explicitly handled variants} — typically custom or newer partition types, or a corrupted/unparsed spec defaulting to an unexpected type.","commonSituations":"Submitting specs written for the MSQ or compaction engine to a classic IndexTask; plugin-provided partitioning strategies; Druid version skew between spec producer and task runner.","solutions":["Use a supported partitionsSpec type (linear/hash) in tuningConfig","Check for typos or invalid values in the \"type\" field of partitionsSpec","Run range/dimension partitioning via compaction task or MSQ instead","Align spec-writing tooling with the Druid version of the overlord/task runner"],"exampleFix":"// before\n\"partitionsSpec\": { \"type\": \"single_dim\", \"targetRowsPerSegment\": 5000000 }\n// after\n\"partitionsSpec\": { \"type\": \"hash\", \"partitionDimensions\": [\"dim\"], \"numShards\": 4 }","handlingStrategy":"validation","validationCode":"SecondaryPartitionType t = partitionsSpec.getType();\nif (t != SecondaryPartitionType.LINEAR && t != SecondaryPartitionType.HASH) {\n  throw new IllegalArgumentException(\"Secondary partition type not supported by IndexTask: \" + t);\n}","typeGuard":"boolean allocatable(PartitionsSpec p) {\n  return SecondaryPartitionType.LINEAR.equals(p.getType())\n      || SecondaryPartitionType.HASH.equals(p.getType());\n}","tryCatchPattern":"try {\n  submitTask(spec);\n} catch (UnsupportedOperationException e) {\n  if (e.getMessage().endsWith(\"secondary partition type is not supported\")) {\n    spec.getTuningConfig().setPartitionsSpec(defaultHashSpec());\n    submitTask(spec);\n  } else throw e;\n}","preventionTips":["Use engine-appropriate specs: MSQ/compaction for range partitioning","Enumerate allowed partitionsSpec types in submission tooling","Keep overlord and spec-producer Druid versions in sync","Dry-run spec parsing before submission"],"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"}