Implementation:Apache Druid Partition Config Form
| Knowledge Sources | |
|---|---|
| Domains | Data_Ingestion, Storage_Optimization |
| Last Updated | 2026-02-10 00:00 GMT |
Overview
Concrete form-based UI pattern for configuring segment partitioning parameters in the batch ingestion wizard.
Description
The partitioning configuration step renders an AutoForm component with PARTITION_FIELDS that allows users to select a partitioning strategy and configure its parameters. The form dynamically shows/hides fields based on the selected partition type (dynamic, hashed, single_dim, range). It also includes a segmentGranularity selector from the granularitySpec.
This is a pure configuration form with no API calls — the selected values are stored in the ingestion spec's tuningConfig.partitionsSpec for use during task execution.
Usage
Import this as part of the LoadDataView partitioning step. Rendered after schema definition and before tuning parameters.
Code Reference
Source Location
- Repository: Apache Druid
- File: web-console/src/views/load-data-view/load-data-view.tsx
- Lines: L2630-L2780 (approximate)
Signature
// Rendered within LoadDataView.renderPartitionStep()
// Uses AutoForm component with PARTITION_FIELDS constant
// No standalone function — part of the wizard render pipeline
interface PartitionFields {
'spec.spec.tuningConfig.partitionsSpec.type': 'dynamic' | 'hashed' | 'range' | 'single_dim';
'spec.spec.tuningConfig.partitionsSpec.targetRowsPerSegment': number;
'spec.spec.tuningConfig.partitionsSpec.numShards': number;
'spec.spec.tuningConfig.partitionsSpec.partitionDimension': string;
'spec.spec.tuningConfig.partitionsSpec.partitionDimensions': string[];
'spec.spec.dataSchema.granularitySpec.segmentGranularity': string;
}
Import
// Internal to LoadDataView — not independently importable
import { LoadDataView } from './views/load-data-view/load-data-view';
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| spec | Partial<IngestionSpec> | Yes | Current ingestion spec with dataSchema populated |
| dimensionNames | string[] | No | Available dimension names for single_dim/range partition selection |
Outputs
| Name | Type | Description |
|---|---|---|
| spec.spec.tuningConfig.partitionsSpec | PartitionsSpec | Updated partition configuration |
| spec.spec.dataSchema.granularitySpec.segmentGranularity | string | Time chunk size for primary partitioning |
Usage Examples
Dynamic Partitioning (Default)
// In the ingestion spec:
{
tuningConfig: {
partitionsSpec: {
type: 'dynamic',
maxRowsPerSegment: 5000000,
},
},
dataSchema: {
granularitySpec: {
segmentGranularity: 'DAY',
},
},
}
Range Partitioning on Dimension
{
tuningConfig: {
partitionsSpec: {
type: 'single_dim',
targetRowsPerSegment: 5000000,
partitionDimension: 'user_id',
},
},
dataSchema: {
granularitySpec: {
segmentGranularity: 'DAY',
},
},
}