apache/druid · error · IAE
If a local input source sets property %s, it must also set p
Error message
If a local input source sets property %s, it must also set property %s
What it means
A local input source's filter only applies to files discovered under baseDir, so validate rejects a config that sets filter without baseDir. Thrown as IllegalArgumentException when filter is non-empty but baseDir is absent.
Source
Thrown at server/src/main/java/org/apache/druid/catalog/model/table/LocalInputSourceDefn.java:95
}
@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
);
}
super.validate(table);
}
@Override
protected List<ParameterDefn> adHocTableFnParameters()
{View on GitHub (pinned to 9b90983fd2)
Solutions
- Add the baseDir property alongside filter
- Or remove the filter if you intend to use an explicit files list (filter does not apply to it)
- Restructure the config so discovery uses baseDir + filter instead of files
Example fix
// before
{"type":"local","files":["/data/a.csv"],"filter":"*.csv"}
// after
{"type":"local","baseDir":"/data","filter":"*.csv"} Defensive patterns
Strategy: validation
Validate before calling
if (src.get("filter") != null && !((String) src.get("filter")).isEmpty()
&& !src.containsKey("baseDir")) {
throw new IllegalArgumentException("filter requires baseDir");
} Try / catch
try { defn.validate(table); } catch (IAE e) { if (e.getMessage().contains("must also set property")) { /* add baseDir or drop filter */ } else { throw e; } } Prevention
- Remember filter only works with baseDir-based discovery
- When using an explicit files list, do not set filter
- Document this constraint in config templates
When it happens
Trigger: Validating a local input source where the filter field is set, the baseDir field is missing, and (per the first check) files is provided or the baseDir/files check already passed — specifically the !hasBaseDir && hasFilter case.
Common situations: User adds a filter pattern to a files-based local source assuming it filters that list; config template that emits filter but skips baseDir when a path variable is empty.
Related errors
- A local input source requires one property of %s or %s
- A local input source accepts only one of %s or %s
- '%s' must be a string or an array of strings
- S3 requires one of %s, %s or %s
- When using the %s parameter, %s must also be provided
AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07).
Data as JSON: /api/errors/c78a9f095f160402.
Report an issue: GitHub.