apache/druid · error · IAE

Cannot provide columns for an inline table

Error message

Cannot provide columns for an inline table

What it means

InlineInputSourceDefn.convertCompletedTable rejects a non-empty columns list because columns for a completed inline table are already part of the resolved table spec. Supplying them again is contradictory and throws IllegalArgumentException.

Solutions

  1. Pass null or an empty list for the columns parameter when the input source is inline
  2. Ensure the table spec itself contains the columns
  3. If columns must be supplied, use the args-based conversion path instead

Example fix

// before
defn.convertCompletedTable(table, Collections.emptyMap(), columns);
// after
defn.convertCompletedTable(table, Collections.emptyMap(), null);
Defensive patterns

Strategy: validation

Validate before calling

if (columns != null && !columns.isEmpty()) {
  throw new IllegalArgumentException("inline convertCompletedTable requires null/empty columns");
}

Try / catch

try { defn.convertCompletedTable(table, args, columns); } catch (IAE e) { if (e.getMessage().contains("Cannot provide columns")) { columns = null; /* retry */ } else { throw e; } }

Prevention

When it happens

Trigger: Calling convertCompletedTable for an inline table with a non-null, non-empty columns list.

Common situations: Shared conversion helper that passes columns for all input source types; code migrated from the args-based convertArgsToSourceMap path where columns were expected; copy-paste of another definition's convertCompletedTable call.

Understand the failure class

Background: "must be a positive integer", "cannot be empty", "invalid argument": how invalid-argument errors work across open-source libraries — this error's family across 33 libraries.

Related errors


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

Appendix: source

Thrown at server/src/main/java/org/apache/druid/catalog/model/table/InlineInputSourceDefn.java:117

          "An inline table requires one or more rows of data in the '%s' property",
          DATA_PROPERTY
      );
    }
    jsonMap.put(DATA_FIELD, String.join("\n", data));
  }

  @Override
  protected ExternalTableSpec convertCompletedTable(
      final ResolvedExternalTable table,
      final Map<String, Object> args,
      final List<ColumnSpec> columns
  )
  {
    if (!args.isEmpty()) {
      throw new ISE("Cannot provide arguments for an inline table");
    }
    if (!CollectionUtils.isNullOrEmpty(columns)) {
      throw new IAE("Cannot provide columns for an inline table");
    }
    return convertTable(table);
  }

  @Override
  protected void auditInputSource(Map<String, Object> jsonMap)
  {
    // Special handling of the data property which, in SQL, is a null-delimited
    // list of rows. The user will usually provide a trailing newline which should
    // not be interpreted as an empty data row. That is, if the data ends with
    // a newline, the inline input source will interpret that as a blank line, oddly.
    String data = CatalogUtils.getString(jsonMap, DATA_FIELD);
    if (data != null && !data.endsWith("\n")) {
      jsonMap.put(DATA_FIELD, data + "\n");
    }
  }
}

View on GitHub (pinned to 9b90983fd2)