{"record":{"id":"c95ca861efdfd8db","repo":"apache/druid","slug":"an-inline-input-source-must-provide-one-or-more-co","errorCode":null,"errorMessage":"An inline input source must provide one or more columns","messagePattern":"An inline input source must provide one or more columns","errorType":"validation","errorClass":"IAE","httpStatus":null,"severity":"error","filePath":"server/src/main/java/org/apache/druid/catalog/model/table/InlineInputSourceDefn.java","lineNumber":83,"sourceCode":"        new Parameter(DATA_PROPERTY, ParameterType.VARCHAR_ARRAY, false)\n    );\n  }\n\n  @Override\n  public TableFunction partialTableFn(ResolvedExternalTable table)\n  {\n    return new PartialTableFunction(table, Collections.emptyList());\n  }\n\n  @Override\n  public void validate(ResolvedExternalTable table)\n  {\n    // For inline, format is required to match the data\n    if (table.inputFormatMap == null) {\n      throw new IAE(\"An inline input source must provide a format.\");\n    }\n    if (CollectionUtils.isNullOrEmpty(table.resolvedTable().spec().columns())) {\n      throw new IAE(\"An inline input source must provide one or more columns\");\n    }\n\n    super.validate(table);\n  }\n\n  @Override\n  protected void convertArgsToSourceMap(Map<String, Object> jsonMap, Map<String, Object> args)\n  {\n    jsonMap.put(InputSource.TYPE_PROPERTY, InlineInputSource.TYPE_KEY);\n    List<String> data = CatalogUtils.getStringArray(args, DATA_PROPERTY);\n\n    // Would be nice, from a completeness perspective, for the inline data\n    // source to allow zero rows of data. However, such is not the case.\n    if (CollectionUtils.isNullOrEmpty(data)) {\n      throw new IAE(\n          \"An inline table requires one or more rows of data in the '%s' property\",\n          DATA_PROPERTY\n      );","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/server/src/main/java/org/apache/druid/catalog/model/table/InlineInputSourceDefn.java#L65-L101","documentation":"InlineInputSourceDefn.validate requires an inline external table to declare at least one column. Columns define the schema against which the inline data rows are parsed. Thrown as IllegalArgumentException when the table spec's column list is null or empty.","triggerScenarios":"Validating an inline ResolvedExternalTable whose spec().columns() is empty or null, even if a format and data are provided.","commonSituations":"Defining an inline table with only data and format but no schema; programmatic spec generation that skips the columns array; UI flows where column entry was skipped.","solutions":["Add one or more ColumnSpec entries to the table spec","If columns are inferred elsewhere, pass them explicitly to convertCompletedTable instead of relying on empty columns","Check the serialized spec JSON to confirm a non-empty columns array"],"exampleFix":"// before\n{\"source\":{\"type\":\"inline\",\"data\":\"1,x\"},\"format\":{\"type\":\"csv\"},\"columns\":[]}\n// after\n{\"source\":{\"type\":\"inline\",\"data\":\"1,x\"},\"format\":{\"type\":\"csv\"},\"columns\":[{\"name\":\"n\",\"type\":\"long\"},{\"name\":\"s\",\"type\":\"string\"}]}","handlingStrategy":"validation","validationCode":"if (spec.getSource().getType().equals(\"inline\")\n    && (spec.getColumns() == null || spec.getColumns().isEmpty())) {\n  throw new IllegalArgumentException(\"inline source requires at least one column\");\n}","typeGuard":null,"tryCatchPattern":"try { defn.validate(table); } catch (IAE e) { if (e.getMessage().contains(\"one or more columns\")) { /* add columns to spec */ } else { throw e; } }","preventionTips":["Define columns whenever you define an inline table","Never pass an empty columns array; omit-and-infer is not supported for inline","Unit-test spec builders to assert non-empty columns for inline"],"tags":["inline","input-source","validation","schema","missing-field"],"backgroundTag":"missing-required-config-field","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}