Implementation:Apache Druid Lookup Completions
| Knowledge Sources | |
|---|---|
| Domains | Web_Console, Lookups |
| Last Updated | 2026-02-10 10:00 GMT |
Overview
Defines JSON autocompletion rules for the lookup extractor factory editor in the Druid web console.
Description
LOOKUP_COMPLETIONS is a constant array of JsonCompletionRule objects that provides context-aware autocompletion when editing lookup configurations in JSON mode. The rules support three lookup types: map (simple key-value pairs), cachedNamespace (external source with caching), and kafka (Kafka topic-based lookups). For the cachedNamespace type, nested completions cover extractionNamespace configuration including URI-based and JDBC-based data loading, with further nested rules for parse spec formats (CSV, TSV, simpleJson, customJson).
Usage
This module is consumed by the lookup edit dialog component, which passes the completions array to the JsonInput component when editing lookup configurations in JSON mode.
Code Reference
Source Location
- Repository: Apache Druid
- File: web-console/src/dialogs/lookup-edit-dialog/lookup-completions.ts
- Lines: 1-302
Signature
export const LOOKUP_COMPLETIONS: JsonCompletionRule[]
Import
import { LOOKUP_COMPLETIONS } from './lookup-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 |
|---|---|---|
| LOOKUP_COMPLETIONS | JsonCompletionRule[] |
Array of completion rules covering root-level type selection (map, cachedNamespace, kafka), conditional properties per type, extractionNamespace configuration (uri, jdbc), namespaceParseSpec formats (csv, tsv, simpleJson, customJson), and JDBC connection properties (connectorConfig, table, keyColumn, valueColumn) |
Usage Examples
Providing completions to a lookup JSON editor
import { LOOKUP_COMPLETIONS } from './lookup-completions';
<JsonInput
value={lookupSpec}
onChange={setLookupSpec}
setError={setJsonError}
jsonCompletions={LOOKUP_COMPLETIONS}
/>