Implementation:Apache Druid Compaction Config Completions
| Knowledge Sources | |
|---|---|
| Domains | Web_Console, Compaction |
| Last Updated | 2026-02-10 10:00 GMT |
Overview
Defines JSON autocompletion rules for the compaction configuration editor in the Druid web console.
Description
COMPACTION_CONFIG_COMPLETIONS is a constant array of JsonCompletionRule objects that powers intelligent autocompletion within the JSON editor used for editing compaction configurations. The rules are organized hierarchically by JSON path, providing context-aware suggestions for properties such as dataSource, skipOffsetFromLatest, taskPriority, tuningConfig, ioConfig, dimensionsSpec, granularitySpec, and their nested sub-properties. Conditional completions are provided for partitioning types (dynamic, hashed, range, single_dim) so that only relevant properties are suggested based on the current type value.
Usage
This module is consumed by the CompactionConfigDialog component, which passes the completions array to the JsonInput component when the user switches to the JSON editing tab.
Code Reference
Source Location
- Repository: Apache Druid
- File: web-console/src/dialogs/compaction-config-dialog/compaction-config-completions.ts
- Lines: 1-401
Signature
export const COMPACTION_CONFIG_COMPLETIONS: JsonCompletionRule[]
Import
import { COMPACTION_CONFIG_COMPLETIONS } from './compaction-config-completions';
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| (none) | N/A | N/A | This is a constant data definition with no runtime inputs |
Outputs
| Name | Type | Description |
|---|---|---|
| COMPACTION_CONFIG_COMPLETIONS | JsonCompletionRule[] |
Array of completion rules covering root-level properties (dataSource, skipOffsetFromLatest, taskPriority, tuningConfig, ioConfig, dimensionsSpec, transformSpec, metricsSpec, granularitySpec, taskContext), nested tuningConfig and partitionsSpec properties, and conditional completions for dynamic, hashed, range, and single_dim partition types |
Usage Examples
Providing completions to JsonInput
import { COMPACTION_CONFIG_COMPLETIONS } from './compaction-config-completions';
<JsonInput
value={currentConfig}
onChange={setCurrentConfig}
setError={setJsonError}
issueWithValue={value => AutoForm.issueWithModel(value, COMPACTION_CONFIG_FIELDS)}
height="100%"
jsonCompletions={COMPACTION_CONFIG_COMPLETIONS}
/>