apache/druid · error · IAE

A local input source requires one property of

Error message

A local input source requires one property of %s or %s

What it means

LocalInputSourceDefn.validate requires a local input source to specify at least one of baseDir or files. Without either, Druid has nothing to read. Thrown as IllegalArgumentException during table validation.

Solutions

  1. Set the baseDir property to the directory containing the files
  2. Or provide a non-empty files list of explicit paths
  3. Re-run validation after adding one of the two properties

Example fix

// before
{"type":"local","filter":"*.csv"}
// after
{"type":"local","baseDir":"/data/incoming","filter":"*.csv"}
Defensive patterns

Strategy: validation

Validate before calling

Map<String,Object> src = table.getInputSourceMap();
if (!src.containsKey("baseDir")
    && (src.get("files") == null || ((List<?>) src.get("files")).isEmpty())) {
  throw new IllegalArgumentException("local source needs baseDir or files");
}

Try / catch

try { defn.validate(table); } catch (IAE e) { if (e.getMessage().contains("requires one property")) { /* set baseDir or files */ } else { throw e; } }

Prevention

When it happens

Trigger: Validating a local ResolvedExternalTable whose inputSourceMap contains neither the baseDir field nor a non-empty files list.

Common situations: Local source config created programmatically with neither property set; switching from another source type and deleting paths without adding new ones; partial edits to the source JSON.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


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

Appendix: source

Thrown at server/src/main/java/org/apache/druid/catalog/model/table/LocalInputSourceDefn.java:88

    return LocalInputSource.TYPE_KEY;
  }

  @Override
  protected Class<? extends InputSource> inputSourceClass()
  {
    return LocalInputSource.class;
  }

  @Override
  public void validate(ResolvedExternalTable table)
  {
    final Map<String, Object> sourceMap = new HashMap<>(table.inputSourceMap);
    final boolean hasBaseDir = sourceMap.containsKey(BASE_DIR_FIELD);
    final boolean hasFiles = !CollectionUtils.isNullOrEmpty(CatalogUtils.safeGet(sourceMap, FILES_FIELD, List.class));
    final boolean hasFilter = !Strings.isNullOrEmpty(CatalogUtils.getString(sourceMap, FILTER_FIELD));

    if (!hasBaseDir && !hasFiles) {
      throw new IAE(
          "A local input source requires one property of %s or %s",
          BASE_DIR_FIELD,
          FILES_FIELD
      );
    }
    if (!hasBaseDir && hasFilter) {
      throw new IAE(
          "If a local input source sets property %s, it must also set property %s",
          FILTER_FIELD,
          BASE_DIR_FIELD
      );
    }
    if (hasBaseDir && hasFiles) {
      throw new IAE(
          "A local input source accepts only one of %s or %s",
          BASE_DIR_FIELD,
          FILES_FIELD
      );

View on GitHub (pinned to 9b90983fd2)