{"record":{"id":"46d73fc1b7544217","repo":"apache/druid","slug":"an-inline-table-requires-one-or-more-rows-of-data","errorCode":null,"errorMessage":"An inline table requires one or more rows of data in the '%s' property","messagePattern":"An inline table requires one or more rows of data in the '(.+?)' property","errorType":"validation","errorClass":"IAE","httpStatus":null,"severity":"error","filePath":"server/src/main/java/org/apache/druid/catalog/model/table/InlineInputSourceDefn.java","lineNumber":98,"sourceCode":"      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      );\n    }\n    jsonMap.put(DATA_FIELD, String.join(\"\\n\", data));\n  }\n\n  @Override\n  protected ExternalTableSpec convertCompletedTable(\n      final ResolvedExternalTable table,\n      final Map<String, Object> args,\n      final List<ColumnSpec> columns\n  )\n  {\n    if (!args.isEmpty()) {\n      throw new ISE(\"Cannot provide arguments for an inline table\");\n    }\n    if (!CollectionUtils.isNullOrEmpty(columns)) {","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/server/src/main/java/org/apache/druid/catalog/model/table/InlineInputSourceDefn.java#L80-L116","documentation":"When converting user args to an inline input source JSON map, InlineInputSourceDefn.convertArgsToSourceMap requires at least one row of data in the 'data' property. The underlying Druid InlineInputSource does not support zero rows, so an empty data list is rejected. Thrown as IllegalArgumentException.","triggerScenarios":"Calling convertArgsToSourceMap with args whose DATA_PROPERTY ('data') string array is missing, null, or empty.","commonSituations":"Template renders with no data rows; user saves an inline table intending to add data later; an upstream step that was supposed to populate data produced an empty list.","solutions":["Provide one or more rows in the 'data' property (each list element becomes a line)","If no data exists yet, use a different input source type or defer table creation","Check the code path generating the data list for empty-result handling"],"exampleFix":"// before\nargs: {\"data\":[]}\n// after\nargs: {\"data\":[\"1,foo\",\"2,bar\"]}","handlingStrategy":"validation","validationCode":"List<String> data = (List<String>) args.get(\"data\");\nif (data == null || data.isEmpty()) {\n  throw new IllegalArgumentException(\"inline table requires non-empty 'data' property\");\n}","typeGuard":null,"tryCatchPattern":"try { defn.convertArgsToSourceMap(args); } catch (IAE e) { if (e.getMessage().contains(\"one or more rows of data\")) { /* supply data rows */ } else { throw e; } }","preventionTips":["Check upstream data population steps for empty results before creating the table","Do not create inline tables as placeholders with no rows","Default-template inline tables should include sample data"],"tags":["inline","input-source","validation","empty-value"],"backgroundTag":"empty-required-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"}