apache/druid · error · IllegalArgumentException

Catalog definition for the [%s] input source already contain

Error message

Catalog definition for the [%s] input source already contains column definitions

What it means

Thrown by BaseInputSourceDefn.selectPartialTableColumns when a catalog table definition supplies its own column list while the caller also passes explicit columns. Druid does not allow columns to be defined in both places for this input source; it either uses the provided columns or falls back to the table's catalog columns.

Source

Thrown at server/src/main/java/org/apache/druid/catalog/model/table/BaseInputSourceDefn.java:277

  /**
   * Convert the format spec, if any, to an input format.
   */
  protected abstract InputFormat convertTableToFormat(ResolvedExternalTable table);

  /**
   *  Choose table or SQL-provided columns: table takes precedence.
   */
  protected List<ColumnSpec> selectPartialTableColumns(
      final ResolvedExternalTable table,
      final List<ColumnSpec> columns
  )
  {
    final List<ColumnSpec> tableCols = table.resolvedTable().spec().columns();
    if (CollectionUtils.isNullOrEmpty(tableCols)) {
      return columns;
    } else if (!CollectionUtils.isNullOrEmpty(columns)) {
      throw new IAE(
          "Catalog definition for the [%s] input source already contains column definitions",
          typeValue()
      );
    } else {
      return tableCols;
    }
  }
}

View on GitHub (pinned to 9b90983fd2)

Solutions

  1. Remove the column definitions from the catalog table spec and supply them only in the call, or vice versa.
  2. If the table's catalog schema is authoritative, pass null/empty columns to selectPartialTableColumns.
  3. For ad-hoc TABLE() functions, create the external table without catalog columns.
  4. Review the table definition in the catalog and drop the redundant columns section.

Example fix

// before: table has columns in catalog AND fn(...) (<col> <type>) schema
// after: remove columns from catalog spec, keep only the SQL schema
{"spec":{"table":{"columns":[]},...}}
Defensive patterns

Strategy: validation

Validate before calling

List<ColumnSpec> catalogCols = table.resolvedTable().spec().columns();
if (!catalogCols.isEmpty() && columns != null && !columns.isEmpty()) {
  throw new IllegalStateException("columns defined in both catalog spec and call arguments");
}

Try / catch

try { cols = defn.selectPartialTableColumns(table, columns); } catch (IAE e) { cols = table.resolvedTable().spec().columns(); }

Prevention

When it happens

Trigger: Invoking a table function or query path that calls selectPartialTableColumns(columns) with a non-empty columns argument, when the underlying catalog table spec (table.resolvedTable().spec().columns()) already contains column definitions.

Common situations: A user defines a schema on the external table in the catalog and then also supplies a schema via TABLE(fn(...)(col type, ...)) in SQL; duplication of schema between catalog UI editing and SQL table function arguments.

Understand the failure class

Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.

Related errors


AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07). Data as JSON: /api/errors/72da000a30fb11f5. Report an issue: GitHub.