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 InputSourceStep

From Leeroopedia


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

Overview

Concrete React component for selecting and validating external data sources in the SQL-based ingestion workflow.

Description

The InputSourceStep component renders a form for configuring an external data source. It uses postToSampler() internally via useQueryManager to validate connectivity and retrieve sample data. On successful connection, it outputs an InputSource object, an auto-detected InputFormat, and an optional partitionedByHint derived from the data.

This component is shared between the SQL Data Loader view and the Workbench external data dialog.

Usage

Render this component as the first step in the SQL data loader wizard. The onSet callback receives the validated source, format, and hint when the user completes the step.

Code Reference

Source Location

  • Repository: Apache Druid
  • File: web-console/src/views/workbench-view/input-source-step/input-source-step.tsx
  • Lines: L79-L350

Signature

interface InputSourceStepProps {
  initInputSource: Partial<InputSource>;
  onSet(
    inputSource: InputSource,
    inputFormat: InputFormat,
    partitionedByHint?: string,
  ): void;
}

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

Import

import { InputSourceStep } from '../workbench-view/input-source-step/input-source-step';

I/O Contract

Inputs

Name Type Required Description
initInputSource Partial<InputSource> Yes Pre-populated source configuration (may be empty for new ingestion)
onSet callback Yes Called when source is validated with InputSource, InputFormat, and optional partitionedByHint

Outputs

Name Type Description
inputSource InputSource Validated source configuration (S3, HTTP, local, etc.)
inputFormat InputFormat Auto-detected format from sample data via guessSimpleInputFormat()
partitionedByHint string or undefined Suggested PARTITIONED BY value based on data characteristics

Usage Examples

In SQL Data Loader

import { InputSourceStep } from '../workbench-view/input-source-step/input-source-step';

function SqlDataLoaderView() {
  const [step, setStep] = useState(0);

  const handleSourceSet = (
    inputSource: InputSource,
    inputFormat: InputFormat,
    partitionedByHint?: string,
  ) => {
    // Store source and format, advance to format step
    setStep(1);
  };

  return (
    <InputSourceStep
      initInputSource={{}}
      onSet={handleSourceSet}
    />
  );
}

Related Pages

Implements Principle

Requires Environment

Page Connections

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