Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Apache Druid InputFormatStep

From Leeroopedia


Knowledge Sources
Domains Data_Ingestion, SQL_Ingestion
Last Updated 2026-02-10 00:00 GMT

Overview

Concrete React component for refining input format and generating typed column declarations in the SQL-based ingestion workflow.

Description

The InputFormatStep component takes the validated InputSource and initial InputFormat from the source step and allows users to adjust format settings. It uses postToSampler() internally to preview parsed data and generates SqlColumnDeclaration objects with inferred types. The component outputs an InputSourceFormatAndMore object containing the finalized source, format, column signature, time expression, and array mode.

Usage

Render this component as the second step in the SQL data loader wizard. The onSet callback receives the complete format configuration when the user confirms.

Code Reference

Source Location

  • Repository: Apache Druid
  • File: web-console/src/views/workbench-view/input-format-step/input-format-step.tsx
  • Lines: L92-L346

Signature

interface InputFormatStepProps {
  initInputSource: InputSource;
  initInputFormat: Partial<InputFormat>;
  onSet(result: InputSourceFormatAndMore): void;
}

interface InputSourceFormatAndMore {
  inputSource: InputSource;
  inputFormat: InputFormat;
  signature: SqlColumnDeclaration[];
  timeExpression: SqlExpression | undefined;
  arrayMode: ArrayIngestMode;
}

export const InputFormatStep = React.memo(function InputFormatStep(
  props: InputFormatStepProps,
): JSX.Element {
  // ...
});

Import

import { InputFormatStep } from '../workbench-view/input-format-step/input-format-step';

I/O Contract

Inputs

Name Type Required Description
initInputSource InputSource Yes Validated source from Step 1
initInputFormat Partial<InputFormat> Yes Auto-detected format from Step 1
onSet callback Yes Called with InputSourceFormatAndMore on completion

Outputs

Name Type Description
inputSource InputSource Finalized source configuration
inputFormat InputFormat Finalized format configuration
signature SqlColumnDeclaration[] Typed column declarations for EXTERN()
timeExpression SqlExpression or undefined Auto-detected time parsing expression
arrayMode ArrayIngestMode How multi-value arrays are handled

Usage Examples

In SQL Data Loader

import { InputFormatStep } from '../workbench-view/input-format-step/input-format-step';

<InputFormatStep
  initInputSource={validatedSource}
  initInputFormat={detectedFormat}
  onSet={(result: InputSourceFormatAndMore) => {
    // result.signature = [
    //   { name: 'ts', type: SqlType.VARCHAR },
    //   { name: 'user', type: SqlType.VARCHAR },
    //   { name: 'count', type: SqlType.BIGINT },
    // ]
    // result.timeExpression = TIME_PARSE("ts")
    setFormatResult(result);
    setStep(2);
  }}
/>

Related Pages

Implements Principle

Requires Environment

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment